blob: 1651d5aa04a630c6a52cebb79d1d1ed6f84f41d3 [file] [log] [blame]
Russell King3ff15592006-11-30 13:53:54 +00001#ifdef CONFIG_MMU
2
Nicolas Pitre5f0fbf92008-09-16 13:05:53 -04003/* the upper-most page table pointer */
Russell King1b2e2b72006-08-21 17:06:38 +01004extern pmd_t *top_pmd;
5
6#define TOP_PTE(x) pte_offset_kernel(top_pmd, x)
7
Russell Kingde27c302011-07-02 14:46:27 +01008/*
9 * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
10 * specific hacks for copying pages efficiently, while 0xffff4000
11 * is reserved for VIPT aliasing flushing by generic code.
12 *
13 * Note that we don't allow VIPT aliasing caches with SMP.
14 */
15#define COPYPAGE_MINICACHE 0xffff8000
16#define COPYPAGE_V6_FROM 0xffff8000
17#define COPYPAGE_V6_TO 0xffffc000
18/* PFN alias flushing, for VIPT caches */
19#define FLUSH_ALIAS_START 0xffff4000
20
Russell King67ece142011-07-02 15:20:44 +010021static inline void set_top_pte(unsigned long va, pte_t pte)
22{
23 set_pte_ext(TOP_PTE(va), pte, 0);
24 local_flush_tlb_kernel_page(va);
25}
26
Russell King0d31fe42011-07-04 11:22:27 +010027static inline pte_t get_top_pte(unsigned long va)
28{
29 return *TOP_PTE(va);
30}
31
Russell King1b2e2b72006-08-21 17:06:38 +010032static inline pmd_t *pmd_off_k(unsigned long virt)
33{
Russell Kingcc780af2011-05-26 19:50:30 +010034 return pmd_offset(pud_offset(pgd_offset_k(virt), virt), virt);
Russell King1b2e2b72006-08-21 17:06:38 +010035}
36
Russell Kingb29e9f52007-04-21 10:47:29 +010037struct mem_type {
Russell Kingf6e33542010-11-16 00:22:09 +000038 pteval_t prot_pte;
Catalin Marinas442e70c2011-09-05 17:51:56 +010039 pmdval_t prot_l1;
40 pmdval_t prot_sect;
Russell Kingb29e9f52007-04-21 10:47:29 +010041 unsigned int domain;
42};
43
44const struct mem_type *get_mem_type(unsigned int type);
45
Russell King7b0a1002009-10-24 14:11:59 +010046extern void __flush_dcache_page(struct address_space *mapping, struct page *page);
47
Nicolas Pitre576d2f22011-09-16 01:14:23 -040048/*
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
Russell King3ff15592006-11-30 13:53:54 +000062#endif
63
Russell King022ae532011-07-08 21:26:59 +010064#ifdef CONFIG_ZONE_DMA
65extern u32 arm_dma_limit;
66#else
67#define arm_dma_limit ((u32)~0)
68#endif
69
Russell King8d717a52010-05-22 19:47:18 +010070void __init bootmem_init(void);
Russell King2778f622010-07-09 16:27:52 +010071void arm_mm_memblock_reserve(void);