From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EKV3t-0002LQ-8F for qemu-devel@nongnu.org; Wed, 28 Sep 2005 02:05:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EKV3l-0002JI-7h for qemu-devel@nongnu.org; Wed, 28 Sep 2005 02:04:59 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EKV3i-0002CV-Ql for qemu-devel@nongnu.org; Wed, 28 Sep 2005 02:04:51 -0400 Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1EKV0M-00009p-R6 for qemu-devel@nongnu.org; Wed, 28 Sep 2005 02:01:23 -0400 Message-ID: <433A314B.8000703@gmx.com> Date: Wed, 28 Sep 2005 07:59:39 +0200 From: Martin Bochnig MIME-Version: 1.0 Subject: Re: [Qemu-devel] SPARC patch for OS X (big endian machines) References: <8c2b58c5dbd7bef1e6dd8fa31c9f2d41@soe.ucsc.edu> In-Reply-To: <8c2b58c5dbd7bef1e6dd8fa31c9f2d41@soe.ucsc.edu> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Reply-To: mb1x@gmx.com, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: renau@soe.ucsc.edu Jose Renau wrote: > > Without the following patch, I was unable to "start" the Linux boot > process > on OS X (powerPC bigendian). I tried on ia64 (Linux) and works fine too. Pretty cool. I can confirm this for SPARC hosts , too (also MSB). Hey, be aware that the SPARConSPARC case finally works with your patch :) Even in SDL/gui mode, not just with "-nographic". Thank you! > > --- target-sparc/op_helper.c 23 Jul 2005 14:27:54 -0000 1.15 > +++ target-sparc/op_helper.c 27 Sep 2005 23:54:52 -0000 > @@ -225,4 +225,5 @@ > void helper_ld_asi(int asi, int size, int sign) > { > + > uint32_t ret = 0; > > @@ -258,8 +259,12 @@ > case 0x20 ... 0x2f: /* MMU passthrough */ > cpu_physical_memory_read(T0, (void *) &ret, size); > - if (size == 4) > - tswap32s(&ret); > - else if (size == 2) > - tswap16s((uint16_t *)&ret); > + > + tswap32s(&ret); > + if (size == 2) { > + ret = ret >> 16; > + }else if (size == 1) { > + ret = ret >> 24; > + } > + > break; > default: