From patchwork Tue Dec 4 16:48:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [1/6] isa: Add isa_address_space_io() Date: Tue, 04 Dec 2012 06:48:11 -0000 From: =?utf-8?q?Andreas_F=C3=A4rber_=3Cafaerber=40suse=2Ede=3E?= X-Patchwork-Id: 203688 Message-Id: <1354639696-22168-2-git-send-email-afaerber@suse.de> To: qemu-devel@nongnu.org Cc: Julien Grall , =?UTF-8?q?Andreas=20F=C3=A4rber?= From: Julien Grall 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 Acked-by: Avi Kivity Signed-off-by: Andreas Färber --- hw/isa-bus.c | 9 +++++++++ hw/isa.h | 1 + 2 Dateien geändert, 10 Zeilen hinzugefügt(+) diff --git a/hw/isa-bus.c b/hw/isa-bus.c index 685fdc0..144a88e 100644 --- a/hw/isa-bus.c +++ b/hw/isa-bus.c @@ -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) diff --git a/hw/isa.h b/hw/isa.h index f9382e8..9d719fa 100644 --- 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);