]> git.proxmox.com Git - qemu.git/commitdiff
isa: Add isa_address_space_io()
authorJulien Grall <julien.grall@citrix.com>
Wed, 19 Sep 2012 11:50:02 +0000 (12:50 +0100)
committerAndreas Färber <afaerber@suse.de>
Tue, 4 Dec 2012 13:50:21 +0000 (14:50 +0100)
This function permits to retrieve ISA IO address space.
It will be usefull when we need to pass IO address space as argument.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
hw/isa-bus.c
hw/isa.h

index 685fdc0f8295acd327a3856dcf6fef0980c206ac..144a88e27263e765cd89821af841d001dc128277 100644 (file)
@@ -264,4 +264,13 @@ MemoryRegion *isa_address_space(ISADevice *dev)
     return get_system_memory();
 }
 
+MemoryRegion *isa_address_space_io(ISADevice *dev)
+{
+    if (dev) {
+        return isa_bus_from_device(dev)->address_space_io;
+    }
+
+    return isabus->address_space_io;
+}
+
 type_init(isabus_register_types)
index f9382e8367b5ed0b61785a4fe80dddc5813390ee..9d719fa3c85b0621bb169833f4b4abb6a4d4fff2 100644 (file)
--- a/hw/isa.h
+++ b/hw/isa.h
@@ -43,6 +43,7 @@ void isa_bus_irqs(ISABus *bus, qemu_irq *irqs);
 qemu_irq isa_get_irq(ISADevice *dev, int isairq);
 void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq);
 MemoryRegion *isa_address_space(ISADevice *dev);
+MemoryRegion *isa_address_space_io(ISADevice *dev);
 ISADevice *isa_create(ISABus *bus, const char *name);
 ISADevice *isa_try_create(ISABus *bus, const char *name);
 ISADevice *isa_create_simple(ISABus *bus, const char *name);