Patchwork [02/23] sysbus: add sysbus_address_space()

login
register
mail settings
Submitter Avi Kivity
Date Dec. 19, 2011, 2:13 p.m.
Message ID <1324304024-11220-3-git-send-email-avi@redhat.com>
Download mbox | patch
Permalink /patch/132240/
State New
Headers show

Comments

Avi Kivity - Dec. 19, 2011, 2:13 p.m.
Given a bus device, retrieves the memory address space for its bus.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 hw/sysbus.c |    5 +++++
 hw/sysbus.h |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/sysbus.c b/hw/sysbus.c
index b315a8c..492a7c6 100644
--- a/hw/sysbus.c
+++ b/hw/sysbus.c
@@ -277,3 +277,8 @@  void sysbus_del_io(SysBusDevice *dev, MemoryRegion *mem)
 {
     memory_region_del_subregion(get_system_io(), mem);
 }
+
+MemoryRegion *sysbus_address_space(SysBusDevice *dev)
+{
+    return get_system_memory();
+}
diff --git a/hw/sysbus.h b/hw/sysbus.h
index 9bac582..7cecf98 100644
--- a/hw/sysbus.h
+++ b/hw/sysbus.h
@@ -62,6 +62,7 @@  void sysbus_del_memory(SysBusDevice *dev, MemoryRegion *mem);
 void sysbus_add_io(SysBusDevice *dev, target_phys_addr_t addr,
                    MemoryRegion *mem);
 void sysbus_del_io(SysBusDevice *dev, MemoryRegion *mem);
+MemoryRegion *sysbus_address_space(SysBusDevice *dev);
 
 /* Legacy helper function for creating devices.  */
 DeviceState *sysbus_create_varargs(const char *name,