From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37328 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJubw-0005l1-GD for qemu-devel@nongnu.org; Wed, 02 Jun 2010 16:32:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJubu-0005av-CJ for qemu-devel@nongnu.org; Wed, 02 Jun 2010 16:32:24 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:53202) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJubu-0005ae-5u for qemu-devel@nongnu.org; Wed, 02 Jun 2010 16:32:22 -0400 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by e35.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id o52KPbjv027576 for ; Wed, 2 Jun 2010 14:25:37 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o52KWETG059930 for ; Wed, 2 Jun 2010 14:32:17 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o52KWDBc009274 for ; Wed, 2 Jun 2010 14:32:14 -0600 Message-ID: <4C06BFCC.6050303@linux.vnet.ibm.com> Date: Wed, 02 Jun 2010 15:32:12 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Fix console_write_ch on 64-bit big-endian hosts References: <1275505133-3734-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: andrzej zaborowski Cc: qemu-devel@nongnu.org On 06/02/2010 02:31 PM, andrzej zaborowski wrote: > Hi, > > On 2 June 2010 20:58, Anthony Liguori wrote: > >> Currently, console_ch_t is defined as an unsigned long. However, immediately >> after it's definition, we treat it as a uint32_t *. This will work on a little >> endian system because of the way bits are layed out but will fail miserably >> on big endian hosts. >> > It seems that what this really tries to do is like *dest = > leul_to_cpu(v) from bswap.h? (Or cpu_to_leul.. quite difficult to wrap > my head around it..) > Yeah, I think it possibly should be a leul_to_cpu with the function signature changed to take an unsigned long. But one thing I'm very confused about is why console_ch_t is an unsigned long vs. a uint32.. Regards, Anthony Liguori > Cheers >