From c062bccf5223f556901a86995c77e77f7136da01 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Mon, 30 Sep 2024 08:37:30 +0000 Subject: [PATCH] arm64: Make more consistent use of is_pte_accessed Change-Id: Ic86dc2fd6471cf25e64966515866fcc143f8d908 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8425 Reviewed-by: waddlesplash Haiku-Format: Haiku-format Bot Tested-by: Commit checker robot --- src/system/kernel/arch/arm64/VMSAv8TranslationMap.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/system/kernel/arch/arm64/VMSAv8TranslationMap.cpp b/src/system/kernel/arch/arm64/VMSAv8TranslationMap.cpp index ebcc8f26ac..ea9cda81fd 100644 --- a/src/system/kernel/arch/arm64/VMSAv8TranslationMap.cpp +++ b/src/system/kernel/arch/arm64/VMSAv8TranslationMap.cpp @@ -645,7 +645,7 @@ VMSAv8TranslationMap::UnmapPage(VMArea* area, addr_t address, bool updatePageQue pinner.Unlock(); locker.Detach(); - PageUnmapped(area, (oldPte & kPteAddrMask) >> fPageBits, (oldPte & kAttrAF) != 0, + PageUnmapped(area, (oldPte & kPteAddrMask) >> fPageBits, is_pte_accessed(oldPte), is_pte_dirty(oldPte), updatePageQueue); return B_OK; @@ -681,7 +681,7 @@ VMSAv8TranslationMap::UnmapPages(VMArea* area, addr_t address, size_t size, bool DEBUG_PAGE_ACCESS_START(page); // transfer the accessed/dirty flags to the page - page->accessed = (oldPte & kAttrAF) != 0; + page->accessed = is_pte_accessed(oldPte); page->modified = is_pte_dirty(oldPte); // remove the mapping object/decrement the wired_count of the @@ -796,7 +796,7 @@ VMSAv8TranslationMap::UnmapArea(VMArea* area, bool deletingAddressSpace, // invalidate the mapping, if necessary if (is_pte_dirty(oldPte)) page->modified = true; - if (oldPte & kAttrAF) + if (is_pte_accessed(oldPte)) page->accessed = true; if (pageFullyUnmapped) { @@ -859,7 +859,7 @@ VMSAv8TranslationMap::Query(addr_t va, phys_addr_t* pa, uint32* flags) uint64_t pte = atomic_get64((int64_t*)ptePtr); *pa = pte & kPteAddrMask; *flags |= PAGE_PRESENT | B_KERNEL_READ_AREA; - if ((pte & kAttrAF) != 0) + if (is_pte_accessed(pte)) *flags |= PAGE_ACCESSED; if (is_pte_dirty(pte)) *flags |= PAGE_MODIFIED;