1 #ifndef _ASM_POWERPC_PGTABLE_H
2 #define _ASM_POWERPC_PGTABLE_H
5 #include <linux/mmdebug.h>
6 #include <linux/mmzone.h>
7 #include <asm/processor.h> /* For TASK_SIZE */
13 #endif /* !__ASSEMBLY__ */
15 #ifdef CONFIG_PPC_BOOK3S
16 #include <asm/book3s/pgtable.h>
18 #include <asm/nohash/pgtable.h>
19 #endif /* !CONFIG_PPC_BOOK3S */
23 #include <asm/tlbflush.h>
25 /* Keep these as a macros to avoid include dependency mess */
26 #define pte_page(x) pfn_to_page(pte_pfn(x))
27 #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
30 * ZERO_PAGE is a global shared page that is always zero: used
31 * for zero-mapped memory areas etc..
33 extern unsigned long empty_zero_page[];
34 #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
36 extern pgd_t swapper_pg_dir[];
38 void limit_zone_pfn(enum zone_type zone, unsigned long max_pfn);
39 int dma_pfn_limit_to_zone(u64 pfn_limit);
40 extern void paging_init(void);
43 * kern_addr_valid is intended to indicate whether an address is a valid
44 * kernel address. Most 32-bit archs define it as always true (like this)
45 * but most 64-bit archs actually perform a test. What should we do here?
47 #define kern_addr_valid(addr) (1)
49 #include <asm-generic/pgtable.h>
53 * This gets called at the end of handling a page fault, when
54 * the kernel has put a new PTE into the page table for the process.
55 * We use it to ensure coherency between the i-cache and d-cache
56 * for the page which has just been mapped in.
57 * On machines which use an MMU hash table, we use this to put a
58 * corresponding HPTE into the hash table ahead of time, instead of
59 * waiting for the inevitable extra hash-table miss exception.
61 extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);
63 extern int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr,
64 unsigned long end, int write,
65 struct page **pages, int *nr);
66 #ifndef CONFIG_TRANSPARENT_HUGEPAGE
67 #define pmd_large(pmd) 0
69 pte_t *__find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
70 bool *is_thp, unsigned *shift);
71 static inline pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
72 bool *is_thp, unsigned *shift)
74 VM_WARN(!arch_irqs_disabled(),
75 "%s called with irq enabled\n", __func__);
76 return __find_linux_pte_or_hugepte(pgdir, ea, is_thp, shift);
79 unsigned long vmalloc_to_phys(void *vmalloc_addr);
81 void pgtable_cache_add(unsigned shift, void (*ctor)(void *));
82 void pgtable_cache_init(void);
83 #endif /* __ASSEMBLY__ */
85 #endif /* _ASM_POWERPC_PGTABLE_H */