From 7a4da4df48c7de409552f61368855b63cb2e1896 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Tue, 13 Jan 2026 10:26:32 +0800 Subject: [PATCH] mmu: check if remap does anything --- libcortex_a9/src/mmu.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libcortex_a9/src/mmu.rs b/libcortex_a9/src/mmu.rs index 74b2fe2..cbbaf4b 100644 --- a/libcortex_a9/src/mmu.rs +++ b/libcortex_a9/src/mmu.rs @@ -407,6 +407,10 @@ impl L1Table { let index = (virtual_addr >> 20) as usize; let entry = &mut self.table[index]; + if entry.0 & 0x000f_ffff == new_physical_base { + // don't waste time with flushing caches if there's no change + return; + } let section = entry.get_section(); *entry = L1Entry::from_section(new_physical_base, section);