From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KVwKv-00024e-Dy for qemu-devel@nongnu.org; Wed, 20 Aug 2008 18:39:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KVwKu-00023O-40 for qemu-devel@nongnu.org; Wed, 20 Aug 2008 18:39:28 -0400 Received: from [199.232.76.173] (port=57181 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVwKt-000239-QR for qemu-devel@nongnu.org; Wed, 20 Aug 2008 18:39:27 -0400 Received: from savannah.gnu.org ([199.232.41.3]:40539 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KVwKt-0004mK-FI for qemu-devel@nongnu.org; Wed, 20 Aug 2008 18:39:27 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KVwKt-0006Sj-0M for qemu-devel@nongnu.org; Wed, 20 Aug 2008 22:39:27 +0000 Received: from malc by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KVwKs-0006Se-Rg for qemu-devel@nongnu.org; Wed, 20 Aug 2008 22:39:26 +0000 MIME-Version: 1.0 Errors-To: malc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: malc Message-Id: Date: Wed, 20 Aug 2008 22:39:26 +0000 Subject: [Qemu-devel] [5036] Fix tswap size 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 Revision: 5036 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5036 Author: malc Date: 2008-08-20 22:39:26 +0000 (Wed, 20 Aug 2008) Log Message: ----------- Fix tswap size p in this case is uint32_t * e1/e2 are unsigned ints initialized from arithmetics performed on unsigned longs The mistake was, probably, never noticed due to the absence of any big endian linux-user host. The types e1/e2 and p begs the quesiton why this function takes longs at all. Modified Paths: -------------- trunk/linux-user/main.c Modified: trunk/linux-user/main.c =================================================================== --- trunk/linux-user/main.c 2008-08-20 22:39:24 UTC (rev 5035) +++ trunk/linux-user/main.c 2008-08-20 22:39:26 UTC (rev 5036) @@ -278,8 +278,8 @@ e2 = ((addr >> 16) & 0xff) | (addr & 0xff000000) | (limit & 0x000f0000); e2 |= flags; p = ptr; - p[0] = tswapl(e1); - p[1] = tswapl(e2); + p[0] = tswap32(e1); + p[1] = tswap32(e2); } #if TARGET_X86_64