mm.h 2.4 KB

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