Commit a034a010 authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge

x86: unify pte_none

Impact: cleanup

Unify and demacro pte_none.
Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
parent 45c82b5a
...@@ -53,8 +53,6 @@ static inline pte_t native_ptep_get_and_clear(pte_t *xp) ...@@ -53,8 +53,6 @@ static inline pte_t native_ptep_get_and_clear(pte_t *xp)
#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp) #define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp)
#endif #endif
#define pte_none(x) (!(x).pte_low)
/* /*
* Bits _PAGE_BIT_PRESENT, _PAGE_BIT_FILE and _PAGE_BIT_PROTNONE are taken, * Bits _PAGE_BIT_PRESENT, _PAGE_BIT_FILE and _PAGE_BIT_PROTNONE are taken,
* split up the 29 bits of offset into this range: * split up the 29 bits of offset into this range:
......
...@@ -151,11 +151,6 @@ static inline int pte_same(pte_t a, pte_t b) ...@@ -151,11 +151,6 @@ static inline int pte_same(pte_t a, pte_t b)
return a.pte_low == b.pte_low && a.pte_high == b.pte_high; return a.pte_low == b.pte_low && a.pte_high == b.pte_high;
} }
static inline int pte_none(pte_t pte)
{
return !pte.pte_low && !pte.pte_high;
}
/* /*
* Bits 0, 6 and 7 are taken in the low part of the pte, * Bits 0, 6 and 7 are taken in the low part of the pte,
* put the 32 bits of offset into the high part. * put the 32 bits of offset into the high part.
......
...@@ -429,6 +429,11 @@ static inline void __init paravirt_pagetable_setup_done(pgd_t *base) ...@@ -429,6 +429,11 @@ static inline void __init paravirt_pagetable_setup_done(pgd_t *base)
} }
#endif /* CONFIG_PARAVIRT */ #endif /* CONFIG_PARAVIRT */
static inline int pte_none(pte_t pte)
{
return !pte.pte;
}
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
......
...@@ -171,7 +171,6 @@ static inline int pmd_bad(pmd_t pmd) ...@@ -171,7 +171,6 @@ 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;
} }
#define pte_none(x) (!pte_val((x)))
#define pte_present(x) (pte_val((x)) & (_PAGE_PRESENT | _PAGE_PROTNONE)) #define pte_present(x) (pte_val((x)) & (_PAGE_PRESENT | _PAGE_PROTNONE))
#define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT)) /* FIXME: is this right? */ #define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT)) /* FIXME: is this right? */
......
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