sysbus: add sysbus_address_space()

Given a bus device, retrieves the memory address space for its bus.

Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
Avi Kivity 2011-12-08 15:57:34 +02:00
parent ab0115e10c
commit 62ec4832ea
2 changed files with 6 additions and 0 deletions

View File

@ -261,3 +261,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();
}

View File

@ -57,6 +57,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,