summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-07-02 13:40:48 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2013-07-04 17:42:45 +0200
commit3ce10901ca8da9142dcdcde198fda1a4c290934c (patch)
tree1d2e886c106132afbdb9901db62062fbc525a5d7 /include
parent46637be269aaaceb9867ffdf176e906401138fff (diff)
downloadqemu-3ce10901ca8da9142dcdcde198fda1a4c290934c.tar.gz
memory: introduce memory_region_present
This new API will avoid having too many memory_region_ref/unref in paths that currently use memory_region_find. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/exec/memory.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h
index d2466a7a97..c8d0bf445d 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -837,6 +837,18 @@ void memory_region_set_alias_offset(MemoryRegion *mr,
hwaddr offset);
/**
+ * memory_region_present: translate an address/size relative to a
+ * MemoryRegion into a #MemoryRegionSection.
+ *
+ * Answer whether a #MemoryRegion within @parent covers the address
+ * @addr.
+ *
+ * @parent: a MemoryRegion within which @addr is a relative address
+ * @addr: the area within @parent to be searched
+ */
+bool memory_region_present(MemoryRegion *parent, hwaddr addr);
+
+/**
* memory_region_find: translate an address/size relative to a
* MemoryRegion into a #MemoryRegionSection.
*