mirror of https://gitee.com/openkylin/linux.git
x86: unify pte_present
Impact: cleanup Unify and demacro pte_present. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
This commit is contained in:
parent
8de01da35e
commit
7c683851d9
|
@ -440,6 +440,11 @@ static inline int pte_same(pte_t a, pte_t b)
|
||||||
return a.pte == b.pte;
|
return a.pte == b.pte;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int pte_present(pte_t a)
|
||||||
|
{
|
||||||
|
return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
|
|
||||||
#ifdef CONFIG_X86_32
|
#ifdef CONFIG_X86_32
|
||||||
|
|
|
@ -85,8 +85,6 @@ extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t);
|
||||||
/* The boot page tables (all created as a single array) */
|
/* The boot page tables (all created as a single array) */
|
||||||
extern unsigned long pg0[];
|
extern unsigned long pg0[];
|
||||||
|
|
||||||
#define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE))
|
|
||||||
|
|
||||||
/* To avoid harmful races, pmd_none(x) should check only the lower when PAE */
|
/* To avoid harmful races, pmd_none(x) should check only the lower when PAE */
|
||||||
#define pmd_none(x) (!(unsigned long)pmd_val((x)))
|
#define pmd_none(x) (!(unsigned long)pmd_val((x)))
|
||||||
#define pmd_present(x) (pmd_val((x)) & _PAGE_PRESENT)
|
#define pmd_present(x) (pmd_val((x)) & _PAGE_PRESENT)
|
||||||
|
|
|
@ -169,8 +169,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_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? */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue