aboutsummaryrefslogtreecommitdiff
path: root/system/memory_mapping.c
diff options
context:
space:
mode:
Diffstat (limited to 'system/memory_mapping.c')
-rw-r--r--system/memory_mapping.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/system/memory_mapping.c b/system/memory_mapping.c
index 6f884c5..da708a0 100644
--- a/system/memory_mapping.c
+++ b/system/memory_mapping.c
@@ -12,11 +12,12 @@
*/
#include "qemu/osdep.h"
+#include "qemu/range.h"
#include "qapi/error.h"
-#include "sysemu/memory_mapping.h"
-#include "exec/memory.h"
-#include "exec/address-spaces.h"
+#include "system/memory_mapping.h"
+#include "system/memory.h"
+#include "system/address-spaces.h"
#include "hw/core/cpu.h"
//#define DEBUG_GUEST_PHYS_REGION_ADD
@@ -353,8 +354,7 @@ void memory_mapping_filter(MemoryMappingList *list, int64_t begin,
MemoryMapping *cur, *next;
QTAILQ_FOREACH_SAFE(cur, &list->head, next, next) {
- if (cur->phys_addr >= begin + length ||
- cur->phys_addr + cur->length <= begin) {
+ if (!ranges_overlap(cur->phys_addr, cur->length, begin, length)) {
QTAILQ_REMOVE(&list->head, cur, next);
g_free(cur);
list->num--;