H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 1 | #ifndef _ASM_X86_PGTABLE_3LEVEL_DEFS_H |
| 2 | #define _ASM_X86_PGTABLE_3LEVEL_DEFS_H |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | |
Jeremy Fitzhardinge | 54321d9 | 2009-02-11 10:20:05 -0800 | [diff] [blame] | 4 | #ifndef __ASSEMBLY__ |
| 5 | #include <linux/types.h> |
| 6 | |
| 7 | typedef u64 pteval_t; |
| 8 | typedef u64 pmdval_t; |
| 9 | typedef u64 pudval_t; |
| 10 | typedef u64 pgdval_t; |
| 11 | typedef u64 pgprotval_t; |
| 12 | |
| 13 | typedef union { |
| 14 | struct { |
| 15 | unsigned long pte_low, pte_high; |
| 16 | }; |
| 17 | pteval_t pte; |
| 18 | } pte_t; |
| 19 | #endif /* !__ASSEMBLY__ */ |
| 20 | |
Jeremy Fitzhardinge | 5311ab6 | 2007-05-02 19:27:13 +0200 | [diff] [blame] | 21 | #ifdef CONFIG_PARAVIRT |
Jeremy Fitzhardinge | 93b1eab | 2007-10-16 11:51:29 -0700 | [diff] [blame] | 22 | #define SHARED_KERNEL_PMD (pv_info.shared_kernel_pmd) |
Jeremy Fitzhardinge | 5311ab6 | 2007-05-02 19:27:13 +0200 | [diff] [blame] | 23 | #else |
| 24 | #define SHARED_KERNEL_PMD 1 |
| 25 | #endif |
| 26 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | /* |
| 28 | * PGDIR_SHIFT determines what a top-level page table entry can map |
| 29 | */ |
| 30 | #define PGDIR_SHIFT 30 |
| 31 | #define PTRS_PER_PGD 4 |
| 32 | |
| 33 | /* |
| 34 | * PMD_SHIFT determines the size of the area a middle-level |
| 35 | * page table can map |
| 36 | */ |
| 37 | #define PMD_SHIFT 21 |
| 38 | #define PTRS_PER_PMD 512 |
| 39 | |
| 40 | /* |
| 41 | * entries per page directory level |
| 42 | */ |
| 43 | #define PTRS_PER_PTE 512 |
| 44 | |
Jeremy Fitzhardinge | 54321d9 | 2009-02-11 10:20:05 -0800 | [diff] [blame] | 45 | |
H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 46 | #endif /* _ASM_X86_PGTABLE_3LEVEL_DEFS_H */ |