aboutsummaryrefslogtreecommitdiff
path: root/hw/isa/isa-bus.c
diff options
context:
space:
mode:
authorHervé Poussineau <hpoussin@reactos.org>2015-02-01 09:12:50 +0100
committerLeon Alrae <leon.alrae@imgtec.com>2015-02-13 14:09:27 +0000
commitbb2ed009e7e4b278c0234143f6b6c1126f68ba35 (patch)
tree2cb7cb302484dc2ed4a95f511758575b1359dd01 /hw/isa/isa-bus.c
parentcd2d5541271f1934345d8ca42f5fafff1744eee7 (diff)
downloadqemu-bb2ed009e7e4b278c0234143f6b6c1126f68ba35.zip
qemu-bb2ed009e7e4b278c0234143f6b6c1126f68ba35.tar.gz
qemu-bb2ed009e7e4b278c0234143f6b6c1126f68ba35.tar.bz2
isa: add memory space parameter to isa_bus_new
Currently, keep current behaviour by always using get_system_memory(). Also use QOM casts when possible. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Diffstat (limited to 'hw/isa/isa-bus.c')
-rw-r--r--hw/isa/isa-bus.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index cc85e53..fd6a3a1 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -21,7 +21,6 @@
#include "hw/sysbus.h"
#include "sysemu/sysemu.h"
#include "hw/isa/isa.h"
-#include "exec/address-spaces.h"
static ISABus *isabus;
hwaddr isa_mem_base = 0;
@@ -44,7 +43,8 @@ static const TypeInfo isa_bus_info = {
.class_init = isa_bus_class_init,
};
-ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space_io)
+ISABus *isa_bus_new(DeviceState *dev, MemoryRegion* address_space,
+ MemoryRegion *address_space_io)
{
if (isabus) {
fprintf(stderr, "Can't create a second ISA bus\n");
@@ -56,6 +56,7 @@ ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space_io)
}
isabus = ISA_BUS(qbus_create(TYPE_ISA_BUS, dev, NULL));
+ isabus->address_space = address_space;
isabus->address_space_io = address_space_io;
return isabus;
}
@@ -250,7 +251,11 @@ static char *isabus_get_fw_dev_path(DeviceState *dev)
MemoryRegion *isa_address_space(ISADevice *dev)
{
- return get_system_memory();
+ if (dev) {
+ return isa_bus_from_device(dev)->address_space;
+ }
+
+ return isabus->address_space;
}
MemoryRegion *isa_address_space_io(ISADevice *dev)