mm.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #ifdef CONFIG_MMU
  2. #include <linux/list.h>
  3. #include <linux/vmalloc.h>
  4. /* the upper-most page table pointer */
  5. extern pmd_t *top_pmd;
  6. /*
  7. * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
  8. * specific hacks for copying pages efficiently, while 0xffff4000
  9. * is reserved for VIPT aliasing flushing by generic code.
  10. *
  11. * Note that we don't allow VIPT aliasing caches with SMP.
  12. */
  13. #define COPYPAGE_MINICACHE 0xffff8000
  14. #define COPYPAGE_V6_FROM 0xffff8000
  15. #define COPYPAGE_V6_TO 0xffffc000
  16. /* PFN alias flushing, for VIPT caches */
  17. #define FLUSH_ALIAS_START 0xffff4000
  18. static inline void set_top_pte(unsigned long va, pte_t pte)
  19. {
  20. pte_t *ptep = pte_offset_kernel(top_pmd, va);
  21. set_pte_ext(ptep, pte, 0);
  22. local_flush_tlb_kernel_page(va);
  23. }
  24. static inline pte_t get_top_pte(unsigned long va)
  25. {
  26. pte_t *ptep = pte_offset_kernel(top_pmd, va);
  27. return *ptep;
  28. }
  29. static inline pmd_t *pmd_off_k(unsigned long virt)
  30. {
  31. return pmd_offset(pud_offset(pgd_offset_k(virt), virt), virt);
  32. }
  33. struct mem_type {
  34. pteval_t prot_pte;
  35. pmdval_t prot_l1;
  36. pmdval_t prot_sect;
  37. unsigned int domain;
  38. };
  39. const struct mem_type *get_mem_type(unsigned int type);
  40. extern void __flush_dcache_page(struct address_space *mapping, struct page *page);
  41. /*
  42. * ARM specific vm_struct->flags bits.
  43. */
  44. /* (super)section-mapped I/O regions used by ioremap()/iounmap() */
  45. #define VM_ARM_SECTION_MAPPING 0x80000000
  46. /* permanent static mappings from iotable_init() */
  47. #define VM_ARM_STATIC_MAPPING 0x40000000
  48. /* empty mapping */
  49. #define VM_ARM_EMPTY_MAPPING 0x20000000
  50. /* mapping type (attributes) for permanent static mappings */
  51. #define VM_ARM_MTYPE(mt) ((mt) << 20)
  52. #define VM_ARM_MTYPE_MASK (0x1f << 20)
  53. /* consistent regions used by dma_alloc_attrs() */
  54. #define VM_ARM_DMA_CONSISTENT 0x20000000
  55. struct static_vm {
  56. struct vm_struct vm;
  57. struct list_head list;
  58. };
  59. extern struct list_head static_vmlist;
  60. extern struct static_vm *find_static_vm_vaddr(void *vaddr);
  61. extern __init void add_static_vm_early(struct static_vm *svm);
  62. #endif
  63. #ifdef CONFIG_ZONE_DMA
  64. extern phys_addr_t arm_dma_limit;
  65. #else
  66. #define arm_dma_limit ((phys_addr_t)~0)
  67. #endif
  68. extern phys_addr_t arm_lowmem_limit;
  69. void __init bootmem_init(void);
  70. void arm_mm_memblock_reserve(void);
  71. void dma_contiguous_remap(void);