From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLdBc-0007bL-HF for qemu-devel@nongnu.org; Tue, 09 Oct 2012 13:01:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLdBb-0001tf-GA for qemu-devel@nongnu.org; Tue, 09 Oct 2012 13:01:40 -0400 Message-ID: <50745859.7020906@redhat.com> Date: Tue, 09 Oct 2012 19:01:13 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1349714816-12618-1-git-send-email-Bharat.Bhushan@freescale.com> <1349714816-12618-3-git-send-email-Bharat.Bhushan@freescale.com> <50730BA3.5000005@suse.de> <5073E8AA.8030107@redhat.com> <6A3DF150A5B70D4F9B66A25E3F7C888D064B85C2@039-SN2MPN1-022.039d.mgd.msft.net> <50745695.2060508@redhat.com> <6A3DF150A5B70D4F9B66A25E3F7C888D064B8639@039-SN2MPN1-022.039d.mgd.msft.net> In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D064B8639@039-SN2MPN1-022.039d.mgd.msft.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/3] e500: Adding CCSR memory region List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bhushan Bharat-R65777 Cc: "qemu-devel@nongnu.org" , "qemu-ppc@nongnu.org" , =?ISO-8859-1?Q?Andreas_F=E4rber?= , "agraf@suse.de" On 10/09/2012 06:57 PM, Bhushan Bharat-R65777 wrote: >=20 >=20 >> -----Original Message----- >> From: Avi Kivity [mailto:avi@redhat.com] >> Sent: Tuesday, October 09, 2012 10:24 PM >> To: Bhushan Bharat-R65777 >> Cc: Andreas F=E4rber; agraf@suse.de; qemu-ppc@nongnu.org; qemu-devel@n= ongnu.org >> Subject: Re: [PATCH 2/3] e500: Adding CCSR memory region >>=20 >> On 10/09/2012 06:45 PM, Bhushan Bharat-R65777 wrote: >> > >> > What about adding a API: >> > void sysbus_mmio_map_to_mr(SysBusDevice *dev, int n, target_phys_add= r_t addr, >> > MemoryRegion *mr) { >> > assert(n >=3D 0 && n < dev->num_mmio); >> > >> > if (dev->mmio[n].addr =3D=3D addr) { >> > /* ??? region already mapped here. */ >> > return; >> > } >> > if (dev->mmio[n].addr !=3D (target_phys_addr_t)-1) { >> > /* Unregister previous mapping. */ >> > memory_region_del_subregion(mr, dev->mmio[n].memory); >> > } >> > dev->mmio[n].addr =3D addr; >> > memory_region_add_subregion(mr, addr, dev->mmio[n].memory); } >> > >>=20 >> I think you can just use sysbus_mmio_get_region(). There are plenty o= f other >> users, so there's precedent. >=20 > You mean something like this : memory_region_add_subregion(mr, addr, sy= sbus_mmio_get_region(dev, 0); >=20 > Ok, but this will still not resolve the issue of not setting the "dev->= mmio[n].addr", no ? Correct. But there are 20 uses already, so it can't matter much. If someone wants to fix them, they can write a new API and do a sweep. But really, sysbus just needs to go away. It's pointless to give it more and more features. --=20 error compiling committee.c: too many arguments to function