From eed2bacfd2519e45498b585a147f11b0fd01c3c7 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Mon, 2 Jun 2014 15:25:06 +0200 Subject: memory: add memory_region_is_mapped() API which allows to check if MemoryRegion is already mapped. Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/exec/memory.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/exec') diff --git a/include/exec/memory.h b/include/exec/memory.h index 549ae734e6..f4c8d4933e 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -847,6 +847,14 @@ void memory_region_set_alias_offset(MemoryRegion *mr, */ bool memory_region_present(MemoryRegion *container, hwaddr addr); +/** + * memory_region_is_mapped: returns true if #MemoryRegion is mapped + * into any address space. + * + * @mr: a #MemoryRegion which should be checked if it's mapped + */ +bool memory_region_is_mapped(MemoryRegion *mr); + /** * memory_region_find: translate an address/size relative to a * MemoryRegion into a #MemoryRegionSection. -- cgit 1.4.1