From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EKPW2-0007fS-1h for qemu-devel@nongnu.org; Tue, 27 Sep 2005 20:09:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EKPVw-0007cS-2M for qemu-devel@nongnu.org; Tue, 27 Sep 2005 20:09:37 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EKPVv-0007Tz-Lx for qemu-devel@nongnu.org; Tue, 27 Sep 2005 20:09:35 -0400 Received: from [128.114.48.10] (helo=services.cse.ucsc.edu) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EKPKs-0003aV-9g for qemu-devel@nongnu.org; Tue, 27 Sep 2005 19:58:10 -0400 Received: from [128.114.59.146] (dhcp-59-146.cse.ucsc.edu [128.114.59.146]) (authenticated bits=0) by services.cse.ucsc.edu (8.13.1/8.13.1) with ESMTP id j8RNw7Y8016990 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO) for ; Tue, 27 Sep 2005 16:58:07 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v622) Content-Transfer-Encoding: 7bit Message-Id: <8c2b58c5dbd7bef1e6dd8fa31c9f2d41@soe.ucsc.edu> Content-Type: text/plain; charset=US-ASCII; format=flowed From: Jose Renau Date: Tue, 27 Sep 2005 16:58:06 -0700 Subject: [Qemu-devel] SPARC patch for OS X (big endian machines) Reply-To: 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 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. --- 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: