xref: /openbmc/linux/arch/arm/mm/mm.h (revision 95e9fd10)
1 #ifdef CONFIG_MMU
2 
3 /* the upper-most page table pointer */
4 extern pmd_t *top_pmd;
5 
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 
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 
26 static inline pte_t get_top_pte(unsigned long va)
27 {
28 	pte_t *ptep = pte_offset_kernel(top_pmd, va);
29 	return *ptep;
30 }
31 
32 static inline pmd_t *pmd_off_k(unsigned long virt)
33 {
34 	return pmd_offset(pud_offset(pgd_offset_k(virt), virt), virt);
35 }
36 
37 struct mem_type {
38 	pteval_t prot_pte;
39 	pmdval_t prot_l1;
40 	pmdval_t prot_sect;
41 	unsigned int domain;
42 };
43 
44 const struct mem_type *get_mem_type(unsigned int type);
45 
46 extern void __flush_dcache_page(struct address_space *mapping, struct page *page);
47 
48 /*
49  * ARM specific vm_struct->flags bits.
50  */
51 
52 /* (super)section-mapped I/O regions used by ioremap()/iounmap() */
53 #define VM_ARM_SECTION_MAPPING	0x80000000
54 
55 /* permanent static mappings from iotable_init() */
56 #define VM_ARM_STATIC_MAPPING	0x40000000
57 
58 /* mapping type (attributes) for permanent static mappings */
59 #define VM_ARM_MTYPE(mt)		((mt) << 20)
60 #define VM_ARM_MTYPE_MASK	(0x1f << 20)
61 
62 /* consistent regions used by dma_alloc_attrs() */
63 #define VM_ARM_DMA_CONSISTENT	0x20000000
64 
65 #endif
66 
67 #ifdef CONFIG_ZONE_DMA
68 extern phys_addr_t arm_dma_limit;
69 #else
70 #define arm_dma_limit ((phys_addr_t)~0)
71 #endif
72 
73 extern phys_addr_t arm_lowmem_limit;
74 
75 void __init bootmem_init(void);
76 void arm_mm_memblock_reserve(void);
77 void dma_contiguous_remap(void);
78