Jeremy Fitzhardinge | fb35514 | 2009-02-08 18:50:52 -0800 | [diff] [blame] | 1 | #ifndef _ASM_X86_PGTABLE_64_DEFS_H |
| 2 | #define _ASM_X86_PGTABLE_64_DEFS_H |
| 3 | |
Jeremy Fitzhardinge | 54321d9 | 2009-02-11 10:20:05 -0800 | [diff] [blame^] | 4 | #ifndef __ASSEMBLY__ |
| 5 | #include <linux/types.h> |
| 6 | |
| 7 | /* |
| 8 | * These are used to make use of C type-checking.. |
| 9 | */ |
| 10 | typedef unsigned long pteval_t; |
| 11 | typedef unsigned long pmdval_t; |
| 12 | typedef unsigned long pudval_t; |
| 13 | typedef unsigned long pgdval_t; |
| 14 | typedef unsigned long pgprotval_t; |
| 15 | |
| 16 | typedef struct { pteval_t pte; } pte_t; |
| 17 | |
| 18 | #endif /* !__ASSEMBLY__ */ |
| 19 | |
Jeremy Fitzhardinge | fb35514 | 2009-02-08 18:50:52 -0800 | [diff] [blame] | 20 | #define SHARED_KERNEL_PMD 0 |
| 21 | |
| 22 | /* |
| 23 | * PGDIR_SHIFT determines what a top-level page table entry can map |
| 24 | */ |
| 25 | #define PGDIR_SHIFT 39 |
| 26 | #define PTRS_PER_PGD 512 |
| 27 | |
| 28 | /* |
| 29 | * 3rd level page |
| 30 | */ |
| 31 | #define PUD_SHIFT 30 |
| 32 | #define PTRS_PER_PUD 512 |
| 33 | |
| 34 | /* |
| 35 | * PMD_SHIFT determines the size of the area a middle-level |
| 36 | * page table can map |
| 37 | */ |
| 38 | #define PMD_SHIFT 21 |
| 39 | #define PTRS_PER_PMD 512 |
| 40 | |
| 41 | /* |
| 42 | * entries per page directory level |
| 43 | */ |
| 44 | #define PTRS_PER_PTE 512 |
| 45 | |
| 46 | #define PMD_SIZE (_AC(1, UL) << PMD_SHIFT) |
| 47 | #define PMD_MASK (~(PMD_SIZE - 1)) |
| 48 | #define PUD_SIZE (_AC(1, UL) << PUD_SHIFT) |
| 49 | #define PUD_MASK (~(PUD_SIZE - 1)) |
| 50 | #define PGDIR_SIZE (_AC(1, UL) << PGDIR_SHIFT) |
| 51 | #define PGDIR_MASK (~(PGDIR_SIZE - 1)) |
| 52 | |
| 53 | |
| 54 | #define MAXMEM _AC(__AC(1, UL) << MAX_PHYSMEM_BITS, UL) |
| 55 | #define VMALLOC_START _AC(0xffffc20000000000, UL) |
| 56 | #define VMALLOC_END _AC(0xffffe1ffffffffff, UL) |
| 57 | #define VMEMMAP_START _AC(0xffffe20000000000, UL) |
| 58 | #define MODULES_VADDR _AC(0xffffffffa0000000, UL) |
| 59 | #define MODULES_END _AC(0xffffffffff000000, UL) |
| 60 | #define MODULES_LEN (MODULES_END - MODULES_VADDR) |
| 61 | |
| 62 | #endif /* _ASM_X86_PGTABLE_64_DEFS_H */ |