From 04f1b3f401a1d2ce2b357a1e7987b9707bb9698b Mon Sep 17 00:00:00 2001 From: NAKAMURA Gou Date: Tue, 24 Jun 2014 12:10:17 +0900 Subject: [PATCH] add pte_xchg() --- arch/x86/kernel/include/arch-memory.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/x86/kernel/include/arch-memory.h b/arch/x86/kernel/include/arch-memory.h index 8704299a..1181b0e3 100644 --- a/arch/x86/kernel/include/arch-memory.h +++ b/arch/x86/kernel/include/arch-memory.h @@ -158,6 +158,15 @@ static inline uintptr_t pte_get_phys(pte_t *ptep) return (*ptep & PT_PHYSMASK); } +#if 0 /* XXX: workaround. cannot use panic() here */ +static inline void pte_xchg(pte_t *ptep, pte_t *valp) +{ + *valp = xchg(ptep, *valp); +} +#else +#define pte_xchg(p,vp) do { *(vp) = xchg((p), *(vp)); } while (0) +#endif + struct page_table; void set_pte(pte_t *ppte, unsigned long phys, enum ihk_mc_pt_attribute attr); pte_t *get_pte(struct page_table *pt, void *virt, enum ihk_mc_pt_attribute attr);