summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/pgtable.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2009-02-05 20:31:09 +0100
committerJeremy Fitzhardinge <jeremy@goop.org>2009-02-06 21:31:50 +0100
commit30f103167fcf2b08de64f5f37ece6bfff7392290 (patch)
tree7e99ef357c99e8663b88fc684a20536bcd451e43 /arch/x86/include/asm/pgtable.h
parentx86: unify pud_large (diff)
downloadlinux-30f103167fcf2b08de64f5f37ece6bfff7392290.tar.xz
linux-30f103167fcf2b08de64f5f37ece6bfff7392290.zip
x86: unify pgd_bad
Impact: cleanup Unify and demacro pgd_bad. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86/include/asm/pgtable.h')
-rw-r--r--arch/x86/include/asm/pgtable.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 0c734e2a90ca..ebcb60e6a961 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -574,6 +574,11 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address)
{
return (pud_t *)pgd_page_vaddr(*pgd) + pud_index(address);
}
+
+static inline int pgd_bad(pgd_t pgd)
+{
+ return (pgd_val(pgd) & ~(PTE_PFN_MASK | _PAGE_USER)) != _KERNPG_TABLE;
+}
#endif /* PAGETABLE_LEVELS > 3 */
#endif /* __ASSEMBLY__ */