1#ifndef _ASM_POWERPC_PGTABLE_H
2#define _ASM_POWERPC_PGTABLE_H
3
4#ifndef __ASSEMBLY__
5#include <linux/mmdebug.h>
6#include <linux/mmzone.h>
7#include <asm/processor.h>
8#include <asm/mmu.h>
9#include <asm/page.h>
10
11struct mm_struct;
12
13#endif
14
15#ifdef CONFIG_PPC_BOOK3S
16#include <asm/book3s/pgtable.h>
17#else
18#include <asm/nohash/pgtable.h>
19#endif
20
21#ifndef __ASSEMBLY__
22
23#include <asm/tlbflush.h>
24
25
26#define pte_page(x) pfn_to_page(pte_pfn(x))
27#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
28
29
30
31
32
33extern unsigned long empty_zero_page[];
34#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
35
36extern pgd_t swapper_pg_dir[];
37
38void limit_zone_pfn(enum zone_type zone, unsigned long max_pfn);
39int dma_pfn_limit_to_zone(u64 pfn_limit);
40extern void paging_init(void);
41
42
43
44
45
46
47#define kern_addr_valid(addr) (1)
48
49#include <asm-generic/pgtable.h>
50
51
52
53
54
55
56
57
58
59
60
61extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);
62
63extern 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
68#endif
69pte_t *__find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
70 bool *is_thp, unsigned *shift);
71static inline pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
72 bool *is_thp, unsigned *shift)
73{
74 if (!arch_irqs_disabled()) {
75 pr_info("%s called with irq enabled\n", __func__);
76 dump_stack();
77 }
78 return __find_linux_pte_or_hugepte(pgdir, ea, is_thp, shift);
79}
80
81unsigned long vmalloc_to_phys(void *vmalloc_addr);
82
83#endif
84
85#endif
86