From: Avi Kivity Subject: [PATCH 21/24] isa: add isa_address_space() Date: Mon, 8 Aug 2011 20:07:06 +0300 Message-ID: <1312823229-12822-22-git-send-email-avi@redhat.com> References: <1312823229-12822-1-git-send-email-avi@redhat.com> Cc: kvm@vger.kernel.org To: qemu-devel@nongnu.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:11951 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753503Ab1HHRHp (ORCPT ); Mon, 8 Aug 2011 13:07:45 -0400 In-Reply-To: <1312823229-12822-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: A helper that returns the address space used by ISA devices. Useful for getting rid of isa_mem_base, multiple ISA buses, or ISA buses behind bridges. Signed-off-by: Avi Kivity --- hw/isa-bus.c | 6 ++++++ hw/isa.h | 1 + 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/hw/isa-bus.c b/hw/isa-bus.c index 2765543..1cb497f 100644 --- a/hw/isa-bus.c +++ b/hw/isa-bus.c @@ -20,6 +20,7 @@ #include "monitor.h" #include "sysbus.h" #include "isa.h" +#include "exec-memory.h" struct ISABus { BusState qbus; @@ -202,4 +203,9 @@ static char *isabus_get_fw_dev_path(DeviceState *dev) return strdup(path); } +MemoryRegion *isa_address_space(ISADevice *dev) +{ + return get_system_memory(); +} + device_init(isabus_register_devices) diff --git a/hw/isa.h b/hw/isa.h index f1f2181..f344699 100644 --- a/hw/isa.h +++ b/hw/isa.h @@ -32,6 +32,7 @@ void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq); void isa_init_ioport(ISADevice *dev, uint16_t ioport); void isa_init_ioport_range(ISADevice *dev, uint16_t start, uint16_t length); void isa_qdev_register(ISADeviceInfo *info); +MemoryRegion *isa_address_space(ISADevice *dev); ISADevice *isa_create(const char *name); ISADevice *isa_try_create(const char *name); ISADevice *isa_create_simple(const char *name); -- 1.7.5.3