1 #ifndef _ASM_POWERPC_PGTABLE_TYPES_H
2 #define _ASM_POWERPC_PGTABLE_TYPES_H
4 #ifdef CONFIG_STRICT_MM_TYPECHECKS
5 /* These are used to make use of C type-checking. */
8 typedef struct { pte_basic_t pte
; } pte_t
;
9 #define __pte(x) ((pte_t) { (x) })
10 static inline pte_basic_t
pte_val(pte_t x
)
17 typedef struct { unsigned long pmd
; } pmd_t
;
18 #define __pmd(x) ((pmd_t) { (x) })
19 static inline unsigned long pmd_val(pmd_t x
)
25 * 64 bit hash always use 4 level table. Everybody else use 4 level
26 * only for 4K page size.
28 #if defined(CONFIG_PPC_BOOK3S_64) || !defined(CONFIG_PPC_64K_PAGES)
29 typedef struct { unsigned long pud
; } pud_t
;
30 #define __pud(x) ((pud_t) { (x) })
31 static inline unsigned long pud_val(pud_t x
)
35 #endif /* CONFIG_PPC_BOOK3S_64 || !CONFIG_PPC_64K_PAGES */
36 #endif /* CONFIG_PPC64 */
39 typedef struct { unsigned long pgd
; } pgd_t
;
40 #define __pgd(x) ((pgd_t) { (x) })
41 static inline unsigned long pgd_val(pgd_t x
)
46 /* Page protection bits */
47 typedef struct { unsigned long pgprot
; } pgprot_t
;
48 #define pgprot_val(x) ((x).pgprot)
49 #define __pgprot(x) ((pgprot_t) { (x) })
54 * .. while these make it easier on the compiler
57 typedef pte_basic_t pte_t
;
59 static inline pte_basic_t
pte_val(pte_t pte
)
65 typedef unsigned long pmd_t
;
67 static inline unsigned long pmd_val(pmd_t pmd
)
72 #if defined(CONFIG_PPC_BOOK3S_64) || !defined(CONFIG_PPC_64K_PAGES)
73 typedef unsigned long pud_t
;
75 static inline unsigned long pud_val(pud_t pud
)
79 #endif /* CONFIG_PPC_BOOK3S_64 || !CONFIG_PPC_64K_PAGES */
80 #endif /* CONFIG_PPC64 */
82 typedef unsigned long pgd_t
;
84 static inline unsigned long pgd_val(pgd_t pgd
)
89 typedef unsigned long pgprot_t
;
90 #define pgprot_val(x) (x)
91 #define __pgprot(x) (x)
93 #endif /* CONFIG_STRICT_MM_TYPECHECKS */
95 * With hash config 64k pages additionally define a bigger "real PTE" type that
96 * gathers the "second half" part of the PTE for pseudo 64k pages
98 #if defined(CONFIG_PPC_64K_PAGES) && defined(CONFIG_PPC_STD_MMU_64)
99 typedef struct { pte_t pte
; unsigned long hidx
; } real_pte_t
;
101 typedef struct { pte_t pte
; } real_pte_t
;
103 #endif /* _ASM_POWERPC_PGTABLE_TYPES_H */
This page took 0.033925 seconds and 6 git commands to generate.