summary refs log tree commit diff stats
path: root/include/exec/memory.h
diff options
context:
space:
mode:
authorAlexander Bulekov <alxndr@bu.edu>2020-10-23 11:07:30 -0400
committerThomas Huth <thuth@redhat.com>2020-10-24 07:43:48 +0200
commitfb5ef4eeecd88b583d5a6dc8f7dc217179cbfc98 (patch)
tree015e22472b9e1a7141dd6c72c6e58116180aead1 /include/exec/memory.h
parentd232b87ec6e3a8a04db9b647f61a1e3a6855a58f (diff)
downloadfocaccia-qemu-fb5ef4eeecd88b583d5a6dc8f7dc217179cbfc98.tar.gz
focaccia-qemu-fb5ef4eeecd88b583d5a6dc8f7dc217179cbfc98.zip
memory: Add FlatView foreach function
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20201023150746.107063-2-alxndr@bu.edu>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'include/exec/memory.h')
-rw-r--r--include/exec/memory.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 622207bde1..042918dd16 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -719,6 +719,11 @@ static inline FlatView *address_space_to_flatview(AddressSpace *as)
     return qatomic_rcu_read(&as->current_map);
 }
 
+typedef int (*flatview_cb)(Int128 start,
+                           Int128 len,
+                           const MemoryRegion*, void*);
+
+void flatview_for_each_range(FlatView *fv, flatview_cb cb , void *opaque);
 
 /**
  * struct MemoryRegionSection: describes a fragment of a #MemoryRegion