Commit a61bb29a authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge

x86: unify pgd_bad

Impact: cleanup

Unify and demacro pgd_bad.
Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
parent 30f10316
...@@ -23,11 +23,6 @@ static inline int pud_none(pud_t pud) ...@@ -23,11 +23,6 @@ static inline int pud_none(pud_t pud)
return pud_val(pud) == 0; return pud_val(pud) == 0;
} }
static inline int pud_bad(pud_t pud)
{
return (pud_val(pud) & ~(PTE_PFN_MASK | _KERNPG_TABLE | _PAGE_USER)) != 0;
}
/* Rules for using set_pte: the pte being assigned *must* be /* Rules for using set_pte: the pte being assigned *must* be
* either not present or in a state where the hardware will * either not present or in a state where the hardware will
* not attempt to update the pte. In places where this is * not attempt to update the pte. In places where this is
......
...@@ -546,6 +546,11 @@ static inline int pud_large(pud_t pud) ...@@ -546,6 +546,11 @@ static inline int pud_large(pud_t pud)
return (pud_val(pud) & (_PAGE_PSE | _PAGE_PRESENT)) == return (pud_val(pud) & (_PAGE_PSE | _PAGE_PRESENT)) ==
(_PAGE_PSE | _PAGE_PRESENT); (_PAGE_PSE | _PAGE_PRESENT);
} }
static inline int pud_bad(pud_t pud)
{
return (pud_val(pud) & ~(PTE_PFN_MASK | _KERNPG_TABLE | _PAGE_USER)) != 0;
}
#endif /* PAGETABLE_LEVELS > 2 */ #endif /* PAGETABLE_LEVELS > 2 */
#if PAGETABLE_LEVELS > 3 #if PAGETABLE_LEVELS > 3
......
...@@ -154,11 +154,6 @@ static inline void native_pgd_clear(pgd_t *pgd) ...@@ -154,11 +154,6 @@ static inline void native_pgd_clear(pgd_t *pgd)
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
static inline int pud_bad(pud_t pud)
{
return (pud_val(pud) & ~(PTE_PFN_MASK | _PAGE_USER)) != _KERNPG_TABLE;
}
static inline int pmd_bad(pmd_t pmd) static inline int pmd_bad(pmd_t pmd)
{ {
return (pmd_val(pmd) & ~(PTE_PFN_MASK | _PAGE_USER)) != _KERNPG_TABLE; return (pmd_val(pmd) & ~(PTE_PFN_MASK | _PAGE_USER)) != _KERNPG_TABLE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment