1 #ifndef _ASM_X86_PGTABLE_64_DEFS_H
2 #define _ASM_X86_PGTABLE_64_DEFS_H
4 #include <asm/sparsemem.h>
7 #include <linux/types.h>
11 * These are used to make use of C type-checking..
13 typedef unsigned long pteval_t;
14 typedef unsigned long pmdval_t;
15 typedef unsigned long pudval_t;
16 typedef unsigned long p4dval_t;
17 typedef unsigned long pgdval_t;
18 typedef unsigned long pgprotval_t;
20 typedef struct { pteval_t pte; } pte_t;
22 #endif /* !__ASSEMBLY__ */
24 #define SHARED_KERNEL_PMD 0
27 * PGDIR_SHIFT determines what a top-level page table entry can map
29 #define PGDIR_SHIFT 39
30 #define PTRS_PER_PGD 512
36 #define PTRS_PER_PUD 512
39 * PMD_SHIFT determines the size of the area a middle-level
43 #define PTRS_PER_PMD 512
46 * entries per page directory level
48 #define PTRS_PER_PTE 512
50 #define PMD_SIZE (_AC(1, UL) << PMD_SHIFT)
51 #define PMD_MASK (~(PMD_SIZE - 1))
52 #define PUD_SIZE (_AC(1, UL) << PUD_SHIFT)
53 #define PUD_MASK (~(PUD_SIZE - 1))
54 #define PGDIR_SIZE (_AC(1, UL) << PGDIR_SHIFT)
55 #define PGDIR_MASK (~(PGDIR_SIZE - 1))
57 /* See Documentation/x86/x86_64/mm.txt for a description of the memory map. */
58 #define MAXMEM _AC(__AC(1, UL) << MAX_PHYSMEM_BITS, UL)
59 #define VMALLOC_SIZE_TB _AC(32, UL)
60 #define __VMALLOC_BASE _AC(0xffffc90000000000, UL)
61 #define __VMEMMAP_BASE _AC(0xffffea0000000000, UL)
62 #ifdef CONFIG_RANDOMIZE_MEMORY
63 #define VMALLOC_START vmalloc_base
64 #define VMEMMAP_START vmemmap_base
66 #define VMALLOC_START __VMALLOC_BASE
67 #define VMEMMAP_START __VMEMMAP_BASE
68 #endif /* CONFIG_RANDOMIZE_MEMORY */
69 #define VMALLOC_END (VMALLOC_START + _AC((VMALLOC_SIZE_TB << 40) - 1, UL))
70 #define MODULES_VADDR (__START_KERNEL_map + KERNEL_IMAGE_SIZE)
71 /* The module sections ends with the start of the fixmap */
72 #define MODULES_END __fix_to_virt(__end_of_fixed_addresses + 1)
73 #define MODULES_LEN (MODULES_END - MODULES_VADDR)
74 #define ESPFIX_PGD_ENTRY _AC(-2, UL)
75 #define ESPFIX_BASE_ADDR (ESPFIX_PGD_ENTRY << PGDIR_SHIFT)
76 #define EFI_VA_START ( -4 * (_AC(1, UL) << 30))
77 #define EFI_VA_END (-68 * (_AC(1, UL) << 30))
79 #define EARLY_DYNAMIC_PAGE_TABLES 64
81 #endif /* _ASM_X86_PGTABLE_64_DEFS_H */