From 06f824c8294178b85f7ca740a1e0928c54e5014e Mon Sep 17 00:00:00 2001 From: Balazs Gerofi Date: Thu, 4 May 2017 04:47:16 +0900 Subject: [PATCH] pte_update_phys(): update physical address of a PTE --- arch/x86/kernel/include/arch-memory.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/kernel/include/arch-memory.h b/arch/x86/kernel/include/arch-memory.h index 2997ca9d..d072251f 100644 --- a/arch/x86/kernel/include/arch-memory.h +++ b/arch/x86/kernel/include/arch-memory.h @@ -204,6 +204,11 @@ static inline int pte_is_fileoff(pte_t *ptep, size_t pgsize) } } +static inline void pte_update_phys(pte_t *ptep, unsigned long phys) +{ + *ptep = (*ptep & ~PT_PHYSMASK) | (phys & PT_PHYSMASK); +} + static inline uintptr_t pte_get_phys(pte_t *ptep) { return (*ptep & PT_PHYSMASK);