summaryrefslogtreecommitdiffstats
path: root/include/exec/memory.h
diff options
context:
space:
mode:
authorPeter Maydell2021-03-23 22:15:16 +0100
committerPeter Maydell2021-03-23 22:15:17 +0100
commit1a4d83b5643e8e965cbc16950f78066a7cd27cb4 (patch)
treea5e53f053125069a45475df9ec3c257f455259ab /include/exec/memory.h
parentMerge remote-tracking branch 'remotes/aperard/tags/pull-xen-20210323' into st... (diff)
parenttarget/arm: Set ARMMMUFaultInfo.level in user-only arm_cpu_tlb_fill (diff)
downloadqemu-1a4d83b5643e8e965cbc16950f78066a7cd27cb4.tar.gz
qemu-1a4d83b5643e8e965cbc16950f78066a7cd27cb4.tar.xz
qemu-1a4d83b5643e8e965cbc16950f78066a7cd27cb4.zip
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20210323' into staging
target-arm queue: * hw/arm/virt: Disable pl011 clock migration if needed * target/arm: Make M-profile VTOR loads on reset handle memory aliasing * target/arm: Set ARMMMUFaultInfo.level in user-only arm_cpu_tlb_fill # gpg: Signature made Tue 23 Mar 2021 14:26:09 GMT # gpg: using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE # gpg: issuer "peter.maydell@linaro.org" # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate] # gpg: aka "Peter Maydell <pmaydell@gmail.com>" [ultimate] # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate] # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE * remotes/pmaydell/tags/pull-target-arm-20210323: target/arm: Set ARMMMUFaultInfo.level in user-only arm_cpu_tlb_fill target/arm: Make M-profile VTOR loads on reset handle memory aliasing hw/core/loader: Add new function rom_ptr_for_as() memory: Add offset_in_region to flatview_cb arguments memory: Document flatview_for_each_range() memory: Make flatview_cb return bool, not int hw/arm/virt: Disable pl011 clock migration if needed Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/exec/memory.h')
-rw-r--r--include/exec/memory.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 260ddd8ade..5728a681b2 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -776,11 +776,35 @@ 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*);
+/**
+ * typedef flatview_cb: callback for flatview_for_each_range()
+ *
+ * @start: start address of the range within the FlatView
+ * @len: length of the range in bytes
+ * @mr: MemoryRegion covering this range
+ * @offset_in_region: offset of the first byte of the range within @mr
+ * @opaque: data pointer passed to flatview_for_each_range()
+ *
+ * Returns: true to stop the iteration, false to keep going.
+ */
+typedef bool (*flatview_cb)(Int128 start,
+ Int128 len,
+ const MemoryRegion *mr,
+ hwaddr offset_in_region,
+ void *opaque);
-void flatview_for_each_range(FlatView *fv, flatview_cb cb , void *opaque);
+/**
+ * flatview_for_each_range: Iterate through a FlatView
+ * @fv: the FlatView to iterate through
+ * @cb: function to call for each range
+ * @opaque: opaque data pointer to pass to @cb
+ *
+ * A FlatView is made up of a list of non-overlapping ranges, each of
+ * which is a slice of a MemoryRegion. This function iterates through
+ * each range in @fv, calling @cb. The callback function can terminate
+ * iteration early by returning 'true'.
+ */
+void flatview_for_each_range(FlatView *fv, flatview_cb cb, void *opaque);
/**
* struct MemoryRegionSection: describes a fragment of a #MemoryRegion