Subversion Repositories Kolibri OS

Rev

Rev 6936 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6936 Rev 7143
Line 18... Line 18...
18
#define _PAGE_BIT_GLOBAL	8	/* Global TLB entry PPro+ */
18
#define _PAGE_BIT_GLOBAL	8	/* Global TLB entry PPro+ */
19
#define _PAGE_BIT_SOFTW1	9	/* available for programmer */
19
#define _PAGE_BIT_SOFTW1	9	/* available for programmer */
20
#define _PAGE_BIT_SOFTW2	10	/* " */
20
#define _PAGE_BIT_SOFTW2	10	/* " */
21
#define _PAGE_BIT_SOFTW3	11	/* " */
21
#define _PAGE_BIT_SOFTW3	11	/* " */
22
#define _PAGE_BIT_PAT_LARGE	12	/* On 2MB or 1GB pages */
22
#define _PAGE_BIT_PAT_LARGE	12	/* On 2MB or 1GB pages */
-
 
23
#define _PAGE_BIT_SOFTW4	58	/* available for programmer */
-
 
24
#define _PAGE_BIT_PKEY_BIT0	59	/* Protection Keys, bit 1/4 */
-
 
25
#define _PAGE_BIT_PKEY_BIT1	60	/* Protection Keys, bit 2/4 */
-
 
26
#define _PAGE_BIT_PKEY_BIT2	61	/* Protection Keys, bit 3/4 */
-
 
27
#define _PAGE_BIT_PKEY_BIT3	62	/* Protection Keys, bit 4/4 */
-
 
28
#define _PAGE_BIT_NX		63	/* No execute: only valid after cpuid check */
-
 
29
 
23
#define _PAGE_BIT_SPECIAL	_PAGE_BIT_SOFTW1
30
#define _PAGE_BIT_SPECIAL	_PAGE_BIT_SOFTW1
24
#define _PAGE_BIT_CPA_TEST	_PAGE_BIT_SOFTW1
31
#define _PAGE_BIT_CPA_TEST	_PAGE_BIT_SOFTW1
25
#define _PAGE_BIT_HIDDEN	_PAGE_BIT_SOFTW3 /* hidden by kmemcheck */
32
#define _PAGE_BIT_HIDDEN	_PAGE_BIT_SOFTW3 /* hidden by kmemcheck */
26
#define _PAGE_BIT_SOFT_DIRTY	_PAGE_BIT_SOFTW3 /* software dirty tracking */
33
#define _PAGE_BIT_SOFT_DIRTY	_PAGE_BIT_SOFTW3 /* software dirty tracking */
27
#define _PAGE_BIT_SOFTW4	58	/* available for programmer */
-
 
28
#define _PAGE_BIT_DEVMAP		_PAGE_BIT_SOFTW4
34
#define _PAGE_BIT_DEVMAP	_PAGE_BIT_SOFTW4
29
#define _PAGE_BIT_NX           63       /* No execute: only valid after cpuid check */
-
 
Line 30... Line 35...
30
 
35
 
31
/* If _PAGE_BIT_PRESENT is clear, we use these: */
36
/* If _PAGE_BIT_PRESENT is clear, we use these: */
32
/* - if the user mapped it with PROT_NONE; pte_present gives true */
37
/* - if the user mapped it with PROT_NONE; pte_present gives true */
Line 45... Line 50...
45
#define _PAGE_SOFTW2	(_AT(pteval_t, 1) << _PAGE_BIT_SOFTW2)
50
#define _PAGE_SOFTW2	(_AT(pteval_t, 1) << _PAGE_BIT_SOFTW2)
46
#define _PAGE_PAT	(_AT(pteval_t, 1) << _PAGE_BIT_PAT)
51
#define _PAGE_PAT	(_AT(pteval_t, 1) << _PAGE_BIT_PAT)
47
#define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE)
52
#define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE)
48
#define _PAGE_SPECIAL	(_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL)
53
#define _PAGE_SPECIAL	(_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL)
49
#define _PAGE_CPA_TEST	(_AT(pteval_t, 1) << _PAGE_BIT_CPA_TEST)
54
#define _PAGE_CPA_TEST	(_AT(pteval_t, 1) << _PAGE_BIT_CPA_TEST)
-
 
55
#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
-
 
56
#define _PAGE_PKEY_BIT0	(_AT(pteval_t, 1) << _PAGE_BIT_PKEY_BIT0)
-
 
57
#define _PAGE_PKEY_BIT1	(_AT(pteval_t, 1) << _PAGE_BIT_PKEY_BIT1)
-
 
58
#define _PAGE_PKEY_BIT2	(_AT(pteval_t, 1) << _PAGE_BIT_PKEY_BIT2)
-
 
59
#define _PAGE_PKEY_BIT3	(_AT(pteval_t, 1) << _PAGE_BIT_PKEY_BIT3)
-
 
60
#else
-
 
61
#define _PAGE_PKEY_BIT0	(_AT(pteval_t, 0))
-
 
62
#define _PAGE_PKEY_BIT1	(_AT(pteval_t, 0))
-
 
63
#define _PAGE_PKEY_BIT2	(_AT(pteval_t, 0))
-
 
64
#define _PAGE_PKEY_BIT3	(_AT(pteval_t, 0))
-
 
65
#endif
50
#define __HAVE_ARCH_PTE_SPECIAL
66
#define __HAVE_ARCH_PTE_SPECIAL
Line -... Line 67...
-
 
67
 
-
 
68
#define _PAGE_PKEY_MASK (_PAGE_PKEY_BIT0 | \
-
 
69
			 _PAGE_PKEY_BIT1 | \
-
 
70
			 _PAGE_PKEY_BIT2 | \
-
 
71
			 _PAGE_PKEY_BIT3)
51
 
72
 
52
#ifdef CONFIG_KMEMCHECK
73
#ifdef CONFIG_KMEMCHECK
53
#define _PAGE_HIDDEN	(_AT(pteval_t, 1) << _PAGE_BIT_HIDDEN)
74
#define _PAGE_HIDDEN	(_AT(pteval_t, 1) << _PAGE_BIT_HIDDEN)
54
#else
75
#else
55
#define _PAGE_HIDDEN	(_AT(pteval_t, 0))
76
#define _PAGE_HIDDEN	(_AT(pteval_t, 0))
Line 97... Line 118...
97
#define _PAGE_TABLE	(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER |	\
118
#define _PAGE_TABLE	(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER |	\
98
			 _PAGE_ACCESSED | _PAGE_DIRTY)
119
			 _PAGE_ACCESSED | _PAGE_DIRTY)
99
#define _KERNPG_TABLE	(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED |	\
120
#define _KERNPG_TABLE	(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED |	\
100
			 _PAGE_DIRTY)
121
			 _PAGE_DIRTY)
Line -... Line 122...
-
 
122
 
101
 
123
/*
-
 
124
 * Set of bits not changed in pte_modify.  The pte's
-
 
125
 * protection key is treated like _PAGE_RW, for
-
 
126
 * instance, and is *not* included in this mask since
-
 
127
 * pte_modify() does modify it.
102
/* Set of bits not changed in pte_modify */
128
 */
103
#define _PAGE_CHG_MASK	(PTE_PFN_MASK | _PAGE_PCD | _PAGE_PWT |		\
129
#define _PAGE_CHG_MASK	(PTE_PFN_MASK | _PAGE_PCD | _PAGE_PWT |		\
104
			 _PAGE_SPECIAL | _PAGE_ACCESSED | _PAGE_DIRTY |	\
130
			 _PAGE_SPECIAL | _PAGE_ACCESSED | _PAGE_DIRTY |	\
105
			 _PAGE_SOFT_DIRTY)
131
			 _PAGE_SOFT_DIRTY)
Line 213... Line 239...
213
#include 
239
#include 
Line 214... Line 240...
214
 
240
 
215
/* Extracts the PFN from a (pte|pmd|pud|pgd)val_t of a 4KB page */
241
/* Extracts the PFN from a (pte|pmd|pud|pgd)val_t of a 4KB page */
Line -... Line 242...
-
 
242
#define PTE_PFN_MASK		((pteval_t)PHYSICAL_PAGE_MASK)
216
#define PTE_PFN_MASK		((pteval_t)PHYSICAL_PAGE_MASK)
243
 
-
 
244
/*
-
 
245
 *  Extracts the flags from a (pte|pmd|pud|pgd)val_t
217
 
246
 *  This includes the protection key value.
Line 218... Line 247...
218
/* Extracts the flags from a (pte|pmd|pud|pgd)val_t of a 4KB page */
247
 */
Line 219... Line 248...
219
#define PTE_FLAGS_MASK		(~PTE_PFN_MASK)
248
#define PTE_FLAGS_MASK		(~PTE_PFN_MASK)