From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQN7w-0000Tn-VR for qemu-devel@nongnu.org; Tue, 15 Nov 2011 12:48:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RQN7u-0000Xs-6j for qemu-devel@nongnu.org; Tue, 15 Nov 2011 12:48:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQN7t-0000Xi-Vv for qemu-devel@nongnu.org; Tue, 15 Nov 2011 12:48:54 -0500 Message-ID: <4EC2A5FE.1040408@redhat.com> Date: Tue, 15 Nov 2011 19:48:46 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1321355644-1982-1-git-send-email-benoit.canet@gmail.com> <4EC258F0.5090303@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 00/14] Convert Sun devices to memory API. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QmVub8OudCBDYW5ldA==?= Cc: blauwirbel@gmail.com, qemu-devel@nongnu.org On 11/15/2011 05:22 PM, Beno=C3=AEt Canet wrote: > When converting lines like : > > - cpu_register_physical_memory_offset(0x1f800000, 0x1000, > - sh7750_io_memory, 0x1f800000); > - cpu_register_physical_memory_offset(0xff800000, 0x1000, > - sh7750_io_memory, 0x1f800000); > > I'm tempted to do : > > + memory_region_init_alias(&s->iomem_1f8, "memory-1f8", > + &s->iomem, 0x1f800000, 0x1000); > + memory_region_add_subregion(sysmem, 0x1f800000, &s->iomem_1f8); > + > + memory_region_init_alias(&s->iomem_ff8, "memory-ff8", > + &s->iomem, 0xff800000, 0x1000); > + memory_region_add_subregion(sysmem, 0xff800000, &s->iomem_ff8); > > but I'm affraid to loose some information contained in the offset > different from the base address (0xff800000 !=3D 0x1f800000). > I think the last lines need to be memory_region_init_alias(&s->iomem_ff8, "memory-ff8", &s->iomem, 0x1f800000, 0x1000); memory_region_add_subregion(sysmem, 0xff800000, &s->iomem_ff8); This redirects writes to 0xff800xxx in sysmem to 0x1f800xxx in iomem, which is what I think the original code intends. --=20 error compiling committee.c: too many arguments to function