From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjR6T-0007mn-KN for qemu-devel@nongnu.org; Sat, 07 Jan 2012 02:54:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RjR6S-0006Kt-KO for qemu-devel@nongnu.org; Sat, 07 Jan 2012 02:54:13 -0500 Received: from cantor2.suse.de ([195.135.220.15]:54348 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjR6S-0006Kn-Fp for qemu-devel@nongnu.org; Sat, 07 Jan 2012 02:54:12 -0500 Message-ID: <4F07F9C9.9010509@suse.de> Date: Sat, 07 Jan 2012 08:52:41 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1325522015-503-1-git-send-email-avi@redhat.com> <1325522015-503-2-git-send-email-avi@redhat.com> In-Reply-To: <1325522015-503-2-git-send-email-avi@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 01/16] memory: move endianness compensation to memory core List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org, Alexander Graf Am 02.01.2012 17:33, schrieb Avi Kivity: > Instead of doing device endianness compensation in cpu_register_io_memo= ry(), > do it in the memory core. >=20 > Signed-off-by: Avi Kivity > diff --git a/exec.c b/exec.c > index 28c057c..507d37c 100644 > --- a/exec.c > +++ b/exec.c > @@ -3666,30 +3565,14 @@ static int cpu_register_io_memory_fixed(int io_= index, > } > io_mem_opaque[io_index] =3D opaque; > =20 > - switch (endian) { > - case DEVICE_BIG_ENDIAN: > -#ifndef TARGET_WORDS_BIGENDIAN > - swapendian_init(io_index); > -#endif > - break; > - case DEVICE_LITTLE_ENDIAN: > -#ifdef TARGET_WORDS_BIGENDIAN > - swapendian_init(io_index); > -#endif > - break; > - case DEVICE_NATIVE_ENDIAN: > - default: > - break; > - } > - > return (io_index << IO_MEM_SHIFT); > } > diff --git a/memory.c b/memory.c > index 868ffd0..6f9fea1 100644 > --- a/memory.c > +++ b/memory.c > @@ -857,6 +857,15 @@ static void memory_region_destructor_rom_device(Me= moryRegion *mr) > cpu_unregister_io_memory(mr->ram_addr & ~(TARGET_PAGE_MASK | IO_ME= M_ROMD)); > } > =20 > +static bool memory_region_wrong_endianness(MemoryRegion *mr) > +{ > +#ifdef TARGET_BIG_ENDIAN This should've been TARGET_WORDS_BIGENDIAN. Patch coming up. Andreas > + return mr->ops->endianness =3D=3D DEVICE_LITTLE_ENDIAN; > +#else > + return mr->ops->endianness =3D=3D DEVICE_BIG_ENDIAN; > +#endif > +} --=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