1
2
3
4
5
6
7
8
9
10#ifndef _ASM_PGTABLE_2LEVEL_HWDEF_H
11#define _ASM_PGTABLE_2LEVEL_HWDEF_H
12
13
14
15
16
17
18
19#define PMD_TYPE_MASK (_AT(pmdval_t, 3) << 0)
20#define PMD_TYPE_FAULT (_AT(pmdval_t, 0) << 0)
21#define PMD_TYPE_TABLE (_AT(pmdval_t, 1) << 0)
22#define PMD_TYPE_SECT (_AT(pmdval_t, 2) << 0)
23#define PMD_PXNTABLE (_AT(pmdval_t, 1) << 2)
24#define PMD_BIT4 (_AT(pmdval_t, 1) << 4)
25#define PMD_DOMAIN(x) (_AT(pmdval_t, (x)) << 5)
26#define PMD_DOMAIN_MASK PMD_DOMAIN(0x0f)
27#define PMD_PROTECTION (_AT(pmdval_t, 1) << 9)
28
29
30
31#define PMD_SECT_PXN (_AT(pmdval_t, 1) << 0)
32#define PMD_SECT_BUFFERABLE (_AT(pmdval_t, 1) << 2)
33#define PMD_SECT_CACHEABLE (_AT(pmdval_t, 1) << 3)
34#define PMD_SECT_XN (_AT(pmdval_t, 1) << 4)
35#define PMD_SECT_AP_WRITE (_AT(pmdval_t, 1) << 10)
36#define PMD_SECT_AP_READ (_AT(pmdval_t, 1) << 11)
37#define PMD_SECT_TEX(x) (_AT(pmdval_t, (x)) << 12)
38#define PMD_SECT_APX (_AT(pmdval_t, 1) << 15)
39#define PMD_SECT_S (_AT(pmdval_t, 1) << 16)
40#define PMD_SECT_nG (_AT(pmdval_t, 1) << 17)
41#define PMD_SECT_SUPER (_AT(pmdval_t, 1) << 18)
42#define PMD_SECT_AF (_AT(pmdval_t, 0))
43
44#define PMD_SECT_UNCACHED (_AT(pmdval_t, 0))
45#define PMD_SECT_BUFFERED (PMD_SECT_BUFFERABLE)
46#define PMD_SECT_WT (PMD_SECT_CACHEABLE)
47#define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
48#define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE)
49#define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
50#define PMD_SECT_CACHE_MASK (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
51#define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2))
52
53
54
55
56
57
58
59
60
61#define PTE_TYPE_MASK (_AT(pteval_t, 3) << 0)
62#define PTE_TYPE_FAULT (_AT(pteval_t, 0) << 0)
63#define PTE_TYPE_LARGE (_AT(pteval_t, 1) << 0)
64#define PTE_TYPE_SMALL (_AT(pteval_t, 2) << 0)
65#define PTE_TYPE_EXT (_AT(pteval_t, 3) << 0)
66#define PTE_BUFFERABLE (_AT(pteval_t, 1) << 2)
67#define PTE_CACHEABLE (_AT(pteval_t, 1) << 3)
68
69
70
71
72#define PTE_EXT_XN (_AT(pteval_t, 1) << 0)
73#define PTE_EXT_AP_MASK (_AT(pteval_t, 3) << 4)
74#define PTE_EXT_AP0 (_AT(pteval_t, 1) << 4)
75#define PTE_EXT_AP1 (_AT(pteval_t, 2) << 4)
76#define PTE_EXT_AP_UNO_SRO (_AT(pteval_t, 0) << 4)
77#define PTE_EXT_AP_UNO_SRW (PTE_EXT_AP0)
78#define PTE_EXT_AP_URO_SRW (PTE_EXT_AP1)
79#define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0)
80#define PTE_EXT_TEX(x) (_AT(pteval_t, (x)) << 6)
81#define PTE_EXT_APX (_AT(pteval_t, 1) << 9)
82#define PTE_EXT_COHERENT (_AT(pteval_t, 1) << 9)
83#define PTE_EXT_SHARED (_AT(pteval_t, 1) << 10)
84#define PTE_EXT_NG (_AT(pteval_t, 1) << 11)
85
86
87
88
89#define PTE_SMALL_AP_MASK (_AT(pteval_t, 0xff) << 4)
90#define PTE_SMALL_AP_UNO_SRO (_AT(pteval_t, 0x00) << 4)
91#define PTE_SMALL_AP_UNO_SRW (_AT(pteval_t, 0x55) << 4)
92#define PTE_SMALL_AP_URO_SRW (_AT(pteval_t, 0xaa) << 4)
93#define PTE_SMALL_AP_URW_SRW (_AT(pteval_t, 0xff) << 4)
94
95#define PHYS_MASK (~0UL)
96
97#endif
98