qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 2/3] memory: Provide an equality function for Mem


From: Dr. David Alan Gilbert (git)
Subject: [Qemu-devel] [PATCH v2 2/3] memory: Provide an equality function for MemoryRegionSections
Date: Wed, 14 Aug 2019 18:55:34 +0100

From: "Dr. David Alan Gilbert" <address@hidden>

Provide a comparison function that checks all the fields are the same.

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
---
 include/exec/memory.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/exec/memory.h b/include/exec/memory.h
index a74a58c289..ce62e847bd 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -496,6 +496,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
  *
-- 
2.21.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]