From patchwork Mon Aug 15 14:17:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 1067672 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7FEI1GB026614 for ; Mon, 15 Aug 2011 14:18:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753941Ab1HOOSF (ORCPT ); Mon, 15 Aug 2011 10:18:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28625 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753649Ab1HOORp (ORCPT ); Mon, 15 Aug 2011 10:17:45 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7FEHhH2020757 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 15 Aug 2011 10:17:43 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p7FEHgJi019042; Mon, 15 Aug 2011 10:17:43 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id AFB01250B5D; Mon, 15 Aug 2011 17:17:40 +0300 (IDT) From: Avi Kivity To: Anthony Liguori , qemu-devel@nongnu.org Cc: kvm@vger.kernel.org Subject: [PATCH v2 21/24] isa: add isa_address_space() Date: Mon, 15 Aug 2011 17:17:35 +0300 Message-Id: <1313417858-6454-22-git-send-email-avi@redhat.com> In-Reply-To: <1313417858-6454-1-git-send-email-avi@redhat.com> References: <1313417858-6454-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 15 Aug 2011 14:18:35 +0000 (UTC) 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);