From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcbUg-0004CU-WE for qemu-devel@nongnu.org; Sun, 25 Nov 2012 07:39:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TcbUf-0000rR-Av for qemu-devel@nongnu.org; Sun, 25 Nov 2012 07:39:30 -0500 Received: from cantor2.suse.de ([195.135.220.15]:57624 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcbUf-0000rA-0j for qemu-devel@nongnu.org; Sun, 25 Nov 2012 07:39:29 -0500 Message-ID: <50B21177.6010107@suse.de> Date: Sun, 25 Nov 2012 13:39:19 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <35452e244b3dd7f3ebc972d39406a2f2b4ab2718.1348052498.git.julien.grall@citrix.com> In-Reply-To: <35452e244b3dd7f3ebc972d39406a2f2b4ab2718.1348052498.git.julien.grall@citrix.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V10 1/8] isa: add isa_address_space_io List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Julien Grall Cc: qemu-devel@nongnu.org, jan.kiszka@siemens.com, kraxel@redhat.com, avi@redhat.com, Stefano.Stabellini@eu.citrix.com Am 19.09.2012 13:50, schrieb 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. >=20 > Signed-off-by: Julien Grall Reviewed-by: Andreas F=E4rber A note below: > --- > hw/isa-bus.c | 9 +++++++++ > hw/isa.h | 1 + > 2 files changed, 10 insertions(+), 0 deletions(-) >=20 > diff --git a/hw/isa-bus.c b/hw/isa-bus.c > index f9b2373..c1d8309 100644 > --- a/hw/isa-bus.c > +++ b/hw/isa-bus.c > @@ -244,4 +244,13 @@ MemoryRegion *isa_address_space(ISADevice *dev) > return get_system_memory(); > } > =20 > +MemoryRegion *isa_address_space_io(ISADevice *dev) > +{ > + if (dev) { > + return isa_bus_from_device(dev)->address_space_io; This assumes that the device is attached to an ISABus already... > + } > + > + return isabus->address_space_io; ...and that the ISABus has been set globally, which I think is an assumption we make elsewhere as well, i.e. it cannot be used at instance_init time but in qdev initfn/realizefn. Andreas > +} > + > type_init(isabus_register_types) > diff --git a/hw/isa.h b/hw/isa.h > index dc97052..3891c1f 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); >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg