Patchwork memory: Push typedefs into qemu-common

login
register
mail settings
Submitter Jan Kiszka
Date Oct. 2, 2011, 4:42 p.m.
Message ID <4E889484.4040603@web.de>
Download mbox | patch
Permalink /patch/117336/
State New
Headers show

Comments

Jan Kiszka - Oct. 2, 2011, 4:42 p.m.
From: Jan Kiszka <jan.kiszka@siemens.com>

There is a circular dependency between memory.h and ioport.h /wrt type
definitions now. Resolve it by pushing MemoryRegion and
MemoryRegionPortio typedefs into qemu-common.h.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 ioport.h      |    3 ---
 memory.h      |    2 --
 qemu-common.h |    2 ++
 3 files changed, 2 insertions(+), 5 deletions(-)
Avi Kivity - Oct. 2, 2011, 5 p.m.
On 10/02/2011 06:42 PM, Jan Kiszka wrote:
> From: Jan Kiszka<jan.kiszka@siemens.com>
>
> There is a circular dependency between memory.h and ioport.h /wrt type
> definitions now. Resolve it by pushing MemoryRegion and
> MemoryRegionPortio typedefs into qemu-common.h.
>
>

Yuck.  I'll just change PortioList to say 'struct MemoryRegion'.

I'm still surprised I don't see it.

Patch

diff --git a/ioport.h b/ioport.h
index 968cc23..f1bd663 100644
--- a/ioport.h
+++ b/ioport.h
@@ -52,9 +52,6 @@  uint8_t cpu_inb(pio_addr_t addr);
 uint16_t cpu_inw(pio_addr_t addr);
 uint32_t cpu_inl(pio_addr_t addr);
 
-typedef struct MemoryRegion MemoryRegion;
-typedef struct MemoryRegionPortio MemoryRegionPortio;
-
 typedef struct PortioList {
     const MemoryRegionPortio *ports;
     MemoryRegion *address_space;
diff --git a/memory.h b/memory.h
index d77c1f1..275404a 100644
--- a/memory.h
+++ b/memory.h
@@ -26,8 +26,6 @@ 
 #include "ioport.h"
 
 typedef struct MemoryRegionOps MemoryRegionOps;
-typedef struct MemoryRegion MemoryRegion;
-typedef struct MemoryRegionPortio MemoryRegionPortio;
 typedef struct MemoryRegionMmio MemoryRegionMmio;
 
 /* Must match *_DIRTY_FLAGS in cpu-all.h.  To be replaced with dynamic
diff --git a/qemu-common.h b/qemu-common.h
index 5e87bdf..8cb26f6 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -264,6 +264,8 @@  typedef struct SSIBus SSIBus;
 typedef struct EventNotifier EventNotifier;
 typedef struct VirtIODevice VirtIODevice;
 typedef struct QEMUSGList QEMUSGList;
+typedef struct MemoryRegion MemoryRegion;
+typedef struct MemoryRegionPortio MemoryRegionPortio;
 
 typedef uint64_t pcibus_t;