summary refs log tree commit diff stats
path: root/system/physmem.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-09-29 13:33:02 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-10-07 05:03:56 +0200
commit3a0539afcbdf83aa919e32a36107bbe357ae9ef2 (patch)
tree4db5853c1b2e8a651ca7a877ee65c0e63530c570 /system/physmem.c
parent81aef73696c37c1680412e52d0a63c9c1fdd0466 (diff)
downloadfocaccia-qemu-3a0539afcbdf83aa919e32a36107bbe357ae9ef2.tar.gz
focaccia-qemu-3a0539afcbdf83aa919e32a36107bbe357ae9ef2.zip
system/physmem: Un-inline cpu_physical_memory_is_clean()
Avoid maintaining large functions in header, rely on the
linker to optimize at linking time.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20251001175448.18933-9-philmd@linaro.org>
Diffstat (limited to 'system/physmem.c')
-rw-r--r--system/physmem.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/system/physmem.c b/system/physmem.c
index 3d81272f9f..e555b3196f 100644
--- a/system/physmem.c
+++ b/system/physmem.c
@@ -943,6 +943,15 @@ bool cpu_physical_memory_get_dirty_flag(ram_addr_t addr, unsigned client)
     return physical_memory_get_dirty(addr, 1, client);
 }
 
+bool cpu_physical_memory_is_clean(ram_addr_t addr)
+{
+    bool vga = cpu_physical_memory_get_dirty_flag(addr, DIRTY_MEMORY_VGA);
+    bool code = cpu_physical_memory_get_dirty_flag(addr, DIRTY_MEMORY_CODE);
+    bool migration =
+        cpu_physical_memory_get_dirty_flag(addr, DIRTY_MEMORY_MIGRATION);
+    return !(vga && code && migration);
+}
+
 /* Note: start and end must be within the same ram block.  */
 bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t start,
                                               ram_addr_t length,