1
2
3
4
5
6
7 #ifndef _ASM_PGTABLE_2LEVEL_TYPES_H
8 #define _ASM_PGTABLE_2LEVEL_TYPES_H
9
10 #include <asm/types.h>
11
12 typedef u32 pteval_t;
13 typedef u32 pmdval_t;
14
15 #undef STRICT_MM_TYPECHECKS
16
17 #ifdef STRICT_MM_TYPECHECKS
18
19
20
21 typedef struct { pteval_t pte; } pte_t;
22 typedef struct { pmdval_t pmd; } pmd_t;
23 typedef struct { pmdval_t pgd[2]; } pgd_t;
24 typedef struct { pteval_t pgprot; } pgprot_t;
25
26 #define pte_val(x) ((x).pte)
27 #define pmd_val(x) ((x).pmd)
28 #define pgd_val(x) ((x).pgd[0])
29 #define pgprot_val(x) ((x).pgprot)
30
31 #define __pte(x) ((pte_t) { (x) } )
32 #define __pmd(x) ((pmd_t) { (x) } )
33 #define __pgprot(x) ((pgprot_t) { (x) } )
34
35 #else
36
37
38
39 typedef pteval_t pte_t;
40 typedef pmdval_t pmd_t;
41 typedef pmdval_t pgd_t[2];
42 typedef pteval_t pgprot_t;
43
44 #define pte_val(x) (x)
45 #define pmd_val(x) (x)
46 #define pgd_val(x) ((x)[0])
47 #define pgprot_val(x) (x)
48
49 #define __pte(x) (x)
50 #define __pmd(x) (x)
51 #define __pgprot(x) (x)
52
53 #endif
54
55 #endif