diff options
-rw-r--r-- | arch/x86/include/asm/pgtable-3level.h | 5 | ||||
-rw-r--r-- | arch/x86/include/asm/pgtable.h | 7 | ||||
-rw-r--r-- | arch/x86/include/asm/pgtable_64.h | 1 |
3 files changed, 7 insertions, 6 deletions
diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h index 51832fa04743..524bd91b9952 100644 --- a/arch/x86/include/asm/pgtable-3level.h +++ b/arch/x86/include/asm/pgtable-3level.h | |||
@@ -28,11 +28,6 @@ static inline int pud_bad(pud_t pud) | |||
28 | return (pud_val(pud) & ~(PTE_PFN_MASK | _KERNPG_TABLE | _PAGE_USER)) != 0; | 28 | return (pud_val(pud) & ~(PTE_PFN_MASK | _KERNPG_TABLE | _PAGE_USER)) != 0; |
29 | } | 29 | } |
30 | 30 | ||
31 | static inline int pud_present(pud_t pud) | ||
32 | { | ||
33 | return pud_val(pud) & _PAGE_PRESENT; | ||
34 | } | ||
35 | |||
36 | /* Rules for using set_pte: the pte being assigned *must* be | 31 | /* Rules for using set_pte: the pte being assigned *must* be |
37 | * either not present or in a state where the hardware will | 32 | * either not present or in a state where the hardware will |
38 | * not attempt to update the pte. In places where this is | 33 | * not attempt to update the pte. In places where this is |
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 17fcc17d6b4f..c117b28df151 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
@@ -445,6 +445,13 @@ static inline int pte_present(pte_t a) | |||
445 | return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE); | 445 | return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE); |
446 | } | 446 | } |
447 | 447 | ||
448 | #if PAGETABLE_LEVELS > 2 | ||
449 | static inline int pud_present(pud_t pud) | ||
450 | { | ||
451 | return pud_val(pud) & _PAGE_PRESENT; | ||
452 | } | ||
453 | #endif /* PAGETABLE_LEVELS > 2 */ | ||
454 | |||
448 | #endif /* __ASSEMBLY__ */ | 455 | #endif /* __ASSEMBLY__ */ |
449 | 456 | ||
450 | #ifdef CONFIG_X86_32 | 457 | #ifdef CONFIG_X86_32 |
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h index 35b8dbc068e0..acdc27b202c8 100644 --- a/arch/x86/include/asm/pgtable_64.h +++ b/arch/x86/include/asm/pgtable_64.h | |||
@@ -194,7 +194,6 @@ static inline int pgd_large(pgd_t pgd) { return 0; } | |||
194 | #define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD - 1)) | 194 | #define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD - 1)) |
195 | #define pud_offset(pgd, address) \ | 195 | #define pud_offset(pgd, address) \ |
196 | ((pud_t *)pgd_page_vaddr(*(pgd)) + pud_index((address))) | 196 | ((pud_t *)pgd_page_vaddr(*(pgd)) + pud_index((address))) |
197 | #define pud_present(pud) (pud_val((pud)) & _PAGE_PRESENT) | ||
198 | 197 | ||
199 | static inline int pud_large(pud_t pte) | 198 | static inline int pud_large(pud_t pte) |
200 | { | 199 | { |