1 #ifndef _ASM_X86_PGTABLE_64_DEFS_H 2 #define _ASM_X86_PGTABLE_64_DEFS_H 3 4 #include <asm/sparsemem.h> 5 6 #ifndef __ASSEMBLY__ 7 #include <linux/types.h> 8 9 /* 10 * These are used to make use of C type-checking.. 11 */ 12 typedef unsigned long pteval_t; 13 typedef unsigned long pmdval_t; 14 typedef unsigned long pudval_t; 15 typedef unsigned long pgdval_t; 16 typedef unsigned long pgprotval_t; 17 18 typedef struct { pteval_t pte; } pte_t; 19 20 #endif /* !__ASSEMBLY__ */ 21 22 #define SHARED_KERNEL_PMD 0 23 24 /* 25 * PGDIR_SHIFT determines what a top-level page table entry can map 26 */ 27 #define PGDIR_SHIFT 39 28 #define PTRS_PER_PGD 512 29 30 /* 31 * 3rd level page 32 */ 33 #define PUD_SHIFT 30 34 #define PTRS_PER_PUD 512 35 36 /* 37 * PMD_SHIFT determines the size of the area a middle-level 38 * page table can map 39 */ 40 #define PMD_SHIFT 21 41 #define PTRS_PER_PMD 512 42 43 /* 44 * entries per page directory level 45 */ 46 #define PTRS_PER_PTE 512 47 48 #define PMD_SIZE (_AC(1, UL) << PMD_SHIFT) 49 #define PMD_MASK (~(PMD_SIZE - 1)) 50 #define PUD_SIZE (_AC(1, UL) << PUD_SHIFT) 51 #define PUD_MASK (~(PUD_SIZE - 1)) 52 #define PGDIR_SIZE (_AC(1, UL) << PGDIR_SHIFT) 53 #define PGDIR_MASK (~(PGDIR_SIZE - 1)) 54 55 /* See Documentation/x86/x86_64/mm.txt for a description of the memory map. */ 56 #define MAXMEM _AC(__AC(1, UL) << MAX_PHYSMEM_BITS, UL) 57 #define VMALLOC_START _AC(0xffffc90000000000, UL) 58 #define VMALLOC_END _AC(0xffffe8ffffffffff, UL) 59 #define VMEMMAP_START _AC(0xffffea0000000000, UL) 60 #define MODULES_VADDR (__START_KERNEL_map + KERNEL_IMAGE_SIZE) 61 #define MODULES_END _AC(0xffffffffff000000, UL) 62 #define MODULES_LEN (MODULES_END - MODULES_VADDR) 63 #define ESPFIX_PGD_ENTRY _AC(-2, UL) 64 #define ESPFIX_BASE_ADDR (ESPFIX_PGD_ENTRY << PGDIR_SHIFT) 65 #define EFI_VA_START ( -4 * (_AC(1, UL) << 30)) 66 #define EFI_VA_END (-68 * (_AC(1, UL) << 30)) 67 68 #define EARLY_DYNAMIC_PAGE_TABLES 64 69 70 #endif /* _ASM_X86_PGTABLE_64_DEFS_H */ 71