Blob Blame History Raw
From 7c11083dcfe6e621276d306d18ef09b789ecb119 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Mon, 12 Aug 2013 15:59:33 +0200
Subject: memory_mapping: Move MemoryMappingList typedef to qemu/typedefs.h

RH-Author: Laszlo Ersek <lersek@redhat.com>
Message-id: <1376323180-12863-4-git-send-email-lersek@redhat.com>
Patchwork-id: 53162
O-Subject: [RHEL-7 qemu-kvm PATCH 03/10] memory_mapping: Move MemoryMappingList typedef to qemu/typedefs.h
Bugzilla: 981582
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Radim Krcmar <rkrcmar@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>

From: Andreas Färber <afaerber@suse.de>

This will avoid issues with hwaddr and ram_addr_t when including
sysemu/memory_mapping.h for CONFIG_USER_ONLY, e.g., from qom/cpu.h.

Signed-off-by: Andreas Färber <afaerber@suse.de>
(cherry picked from commit 6d4d3ae77dbb756d454c2deb2ef844b0cc7bde7b)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 93aae81..1218a61 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -22,6 +22,8 @@ typedef struct AddressSpace AddressSpace;
 typedef struct MemoryRegion MemoryRegion;
 typedef struct MemoryRegionSection MemoryRegionSection;
 
+typedef struct MemoryMappingList MemoryMappingList;
+
 typedef struct NICInfo NICInfo;
 typedef struct HCIInfo HCIInfo;
 typedef struct AudioState AudioState;
diff --git a/include/sysemu/memory_mapping.h b/include/sysemu/memory_mapping.h
index 6f01524..1f71c32 100644
--- a/include/sysemu/memory_mapping.h
+++ b/include/sysemu/memory_mapping.h
@@ -15,6 +15,7 @@
 #define MEMORY_MAPPING_H
 
 #include "qemu/queue.h"
+#include "qemu/typedefs.h"
 
 /* The physical and virtual address in the memory mapping are contiguous. */
 typedef struct MemoryMapping {
@@ -24,11 +25,11 @@ typedef struct MemoryMapping {
     QTAILQ_ENTRY(MemoryMapping) next;
 } MemoryMapping;
 
-typedef struct MemoryMappingList {
+struct MemoryMappingList {
     unsigned int num;
     MemoryMapping *last_mapping;
     QTAILQ_HEAD(, MemoryMapping) head;
-} MemoryMappingList;
+};
 
 int cpu_get_memory_mapping(MemoryMappingList *list, CPUArchState *env);