diff options
Diffstat (limited to 'arch/x86/include/asm/pgtable_64.h')
-rw-r--r-- | arch/x86/include/asm/pgtable_64.h | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h index 545a0e042bb..ba09289acca 100644 --- a/arch/x86/include/asm/pgtable_64.h +++ b/arch/x86/include/asm/pgtable_64.h | |||
@@ -146,7 +146,7 @@ static inline void native_pgd_clear(pgd_t *pgd) | |||
146 | #define PGDIR_MASK (~(PGDIR_SIZE - 1)) | 146 | #define PGDIR_MASK (~(PGDIR_SIZE - 1)) |
147 | 147 | ||
148 | 148 | ||
149 | #define MAXMEM _AC(0x00003fffffffffff, UL) | 149 | #define MAXMEM _AC(__AC(1, UL) << MAX_PHYSMEM_BITS, UL) |
150 | #define VMALLOC_START _AC(0xffffc20000000000, UL) | 150 | #define VMALLOC_START _AC(0xffffc20000000000, UL) |
151 | #define VMALLOC_END _AC(0xffffe1ffffffffff, UL) | 151 | #define VMALLOC_END _AC(0xffffe1ffffffffff, UL) |
152 | #define VMEMMAP_START _AC(0xffffe20000000000, UL) | 152 | #define VMEMMAP_START _AC(0xffffe20000000000, UL) |
@@ -177,12 +177,6 @@ static inline int pmd_bad(pmd_t pmd) | |||
177 | #define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT)) /* FIXME: is this right? */ | 177 | #define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT)) /* FIXME: is this right? */ |
178 | 178 | ||
179 | /* | 179 | /* |
180 | * Macro to mark a page protection value as "uncacheable". | ||
181 | */ | ||
182 | #define pgprot_noncached(prot) \ | ||
183 | (__pgprot(pgprot_val((prot)) | _PAGE_PCD | _PAGE_PWT)) | ||
184 | |||
185 | /* | ||
186 | * Conversion functions: convert a page and protection to a page entry, | 180 | * Conversion functions: convert a page and protection to a page entry, |
187 | * and a page entry and page directory to the page they refer to. | 181 | * and a page entry and page directory to the page they refer to. |
188 | */ | 182 | */ |
@@ -250,10 +244,22 @@ static inline int pud_large(pud_t pte) | |||
250 | extern int direct_gbpages; | 244 | extern int direct_gbpages; |
251 | 245 | ||
252 | /* Encode and de-code a swap entry */ | 246 | /* Encode and de-code a swap entry */ |
253 | #define __swp_type(x) (((x).val >> 1) & 0x3f) | 247 | #if _PAGE_BIT_FILE < _PAGE_BIT_PROTNONE |
254 | #define __swp_offset(x) ((x).val >> 8) | 248 | #define SWP_TYPE_BITS (_PAGE_BIT_FILE - _PAGE_BIT_PRESENT - 1) |
255 | #define __swp_entry(type, offset) ((swp_entry_t) { ((type) << 1) | \ | 249 | #define SWP_OFFSET_SHIFT (_PAGE_BIT_PROTNONE + 1) |
256 | ((offset) << 8) }) | 250 | #else |
251 | #define SWP_TYPE_BITS (_PAGE_BIT_PROTNONE - _PAGE_BIT_PRESENT - 1) | ||
252 | #define SWP_OFFSET_SHIFT (_PAGE_BIT_FILE + 1) | ||
253 | #endif | ||
254 | |||
255 | #define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > SWP_TYPE_BITS) | ||
256 | |||
257 | #define __swp_type(x) (((x).val >> (_PAGE_BIT_PRESENT + 1)) \ | ||
258 | & ((1U << SWP_TYPE_BITS) - 1)) | ||
259 | #define __swp_offset(x) ((x).val >> SWP_OFFSET_SHIFT) | ||
260 | #define __swp_entry(type, offset) ((swp_entry_t) { \ | ||
261 | ((type) << (_PAGE_BIT_PRESENT + 1)) \ | ||
262 | | ((offset) << SWP_OFFSET_SHIFT) }) | ||
257 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val((pte)) }) | 263 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val((pte)) }) |
258 | #define __swp_entry_to_pte(x) ((pte_t) { .pte = (x).val }) | 264 | #define __swp_entry_to_pte(x) ((pte_t) { .pte = (x).val }) |
259 | 265 | ||