From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6PHz-0001X5-VH for qemu-devel@nongnu.org; Tue, 28 Aug 2012 13:09:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6PHq-0002yL-1R for qemu-devel@nongnu.org; Tue, 28 Aug 2012 13:09:19 -0400 Received: from thoth.sbs.de ([192.35.17.2]:26886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6PHp-0002y4-O7 for qemu-devel@nongnu.org; Tue, 28 Aug 2012 13:09:09 -0400 Message-ID: <503CFB2B.8070509@siemens.com> Date: Tue, 28 Aug 2012 19:08:59 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <76c2fcb7375a3b75f2b46fb24f4902d77df2600a.1345549695.git.julien.grall@citrix.com> <5037A77C.3070607@suse.de> <503CE6E1.2040302@citrix.com> In-Reply-To: <503CE6E1.2040302@citrix.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V5 1/8] isa: add isa_address_space_io List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Julien Grall Cc: "avi@redhat.com" , Stefano Stabellini , Gerd Hoffmann , =?ISO-8859-15?Q?Andreas_F=E4rber?= , "qemu-devel@nongnu.org" On 2012-08-28 17:42, Julien Grall wrote: > On 08/24/2012 05:10 PM, Andreas F=E4rber wrote: >> Am 22.08.2012 14:27, schrieb Julien Grall: >> =20 >>> 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 >>> --- >>> hw/isa-bus.c | 5 +++++ >>> hw/isa.h | 1 + >>> 2 files changed, 6 insertions(+), 0 deletions(-) >>> >>> diff --git a/hw/isa-bus.c b/hw/isa-bus.c >>> index f9b2373..662c86b 100644 >>> --- a/hw/isa-bus.c >>> +++ b/hw/isa-bus.c >>> @@ -244,4 +244,9 @@ MemoryRegion *isa_address_space(ISADevice *dev) >>> return get_system_memory(); >>> } >>> >>> +MemoryRegion *isa_address_space_io(ISADevice *dev) >>> +{ >>> + return get_system_io(); >>> +} >>> =20 >> Unlike the address_space above, there's an address_space_io field in >> ISABus, so I guess the implementation of this function should rather >> obtain the device's BusState via isa_bus_from_device(dev) and return i= ts >> field rather than hardcoding get_system_io() here. >> =20 > I use this function in hw/dma.c. For the moment, the code doesn't > use ISA device, so I pass NULL to isa_address_space_io > (See patch 6). Yes, there are some old drivers in QEMU that doesn't follow QOM or even qdev patterns. They may not work on systems Andreas is thinking of anyway. But this is a generic service, so it should try harder: If a device is given, use the io space of its bus. If not, fall back to isabus. Jan --=20 Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux