summaryrefslogtreecommitdiffstats
path: root/include/exec
diff options
context:
space:
mode:
authorDr. David Alan Gilbert2019-08-14 19:55:34 +0200
committerMichael S. Tsirkin2019-09-25 16:15:59 +0200
commit9366cf02e4e31c2a8128904d4d8290a0fad5f888 (patch)
tree8694ca013068005c5fd7b57fd526a4d71fcde7fb /include/exec
parentmemory: Align MemoryRegionSections fields (diff)
downloadqemu-9366cf02e4e31c2a8128904d4d8290a0fad5f888.tar.gz
qemu-9366cf02e4e31c2a8128904d4d8290a0fad5f888.tar.xz
qemu-9366cf02e4e31c2a8128904d4d8290a0fad5f888.zip
memory: Provide an equality function for MemoryRegionSections
Provide a comparison function that checks all the fields are the same. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190814175535.2023-3-dgilbert@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/exec')
-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 a1e6d846cc..6e67043ee0 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -504,6 +504,18 @@ struct MemoryRegionSection {
bool nonvolatile;
};
+static inline bool MemoryRegionSection_eq(MemoryRegionSection *a,
+ MemoryRegionSection *b)
+{
+ return a->mr == b->mr &&
+ a->fv == b->fv &&
+ a->offset_within_region == b->offset_within_region &&
+ a->offset_within_address_space == b->offset_within_address_space &&
+ int128_eq(a->size, b->size) &&
+ a->readonly == b->readonly &&
+ a->nonvolatile == b->nonvolatile;
+}
+
/**
* memory_region_init: Initialize a memory region
*