From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: [RFC v5 83/86] isa: add isa_address_space() Date: Wed, 20 Jul 2011 19:50:33 +0300 Message-ID: <1311180636-17012-84-git-send-email-avi@redhat.com> References: <1311180636-17012-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]:48109 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752273Ab1GTQuy (ORCPT ); Wed, 20 Jul 2011 12:50:54 -0400 In-Reply-To: <1311180636-17012-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 | 7 +++++++ hw/isa.h | 1 + 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/hw/isa-bus.c b/hw/isa-bus.c index 2765543..d770df9 100644 --- a/hw/isa-bus.c +++ b/hw/isa-bus.c @@ -202,4 +202,11 @@ static char *isabus_get_fw_dev_path(DeviceState *dev) return strdup(path); } +#include "exec-memory.h" + +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 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qja57-0004nd-0V for qemu-devel@nongnu.org; Wed, 20 Jul 2011 12:57:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qja52-0006BD-QA for qemu-devel@nongnu.org; Wed, 20 Jul 2011 12:57:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjZyw-0004xP-T8 for qemu-devel@nongnu.org; Wed, 20 Jul 2011 12:50:47 -0400 From: Avi Kivity Date: Wed, 20 Jul 2011 19:50:33 +0300 Message-Id: <1311180636-17012-84-git-send-email-avi@redhat.com> In-Reply-To: <1311180636-17012-1-git-send-email-avi@redhat.com> References: <1311180636-17012-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [RFC v5 83/86] isa: add isa_address_space() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org 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 | 7 +++++++ hw/isa.h | 1 + 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/hw/isa-bus.c b/hw/isa-bus.c index 2765543..d770df9 100644 --- a/hw/isa-bus.c +++ b/hw/isa-bus.c @@ -202,4 +202,11 @@ static char *isabus_get_fw_dev_path(DeviceState *dev) return strdup(path); } +#include "exec-memory.h" + +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