arm64: Add some sanity assertions.

Change-Id: I8a5aff200e37907e06baa204bb509e4401eec21e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8349
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
This commit is contained in:
Owen Anderson 2024-09-20 05:36:08 +00:00 committed by Fredrik Holmqvist
parent caaee6cc6e
commit da8c631e31

View File

@ -597,6 +597,7 @@ VMSAv8TranslationMap::Unmap(addr_t start, addr_t end)
ProcessRange(fPageTable, fInitialLevel, start, size, nullptr,
[=](uint64_t* ptePtr, uint64_t effectiveVa) {
ASSERT(effectiveVa <= end);
uint64_t oldPte = atomic_get_and_set64((int64_t*)ptePtr, 0);
FlushVAIfAccessed(oldPte, effectiveVa);
});
@ -888,6 +889,8 @@ VMSAv8TranslationMap::Protect(addr_t start, addr_t end, uint32 attributes, uint3
ProcessRange(fPageTable, fInitialLevel, start, size, nullptr,
[=](uint64_t* ptePtr, uint64_t effectiveVa) {
ASSERT(effectiveVa <= end);
// We need to use an atomic compare-swap loop because we must
// need to clear somes bits while setting others.
while (true) {