From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BugxD-0008TR-Nv for qemu-devel@nongnu.org; Tue, 10 Aug 2004 20:26:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BugxC-0008TF-4U for qemu-devel@nongnu.org; Tue, 10 Aug 2004 20:26:55 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BugxC-0008TC-1j for qemu-devel@nongnu.org; Tue, 10 Aug 2004 20:26:54 -0400 Received: from [62.241.160.9] (helo=shockwave.systems.pipex.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BugtJ-00011q-Jr for qemu-devel@nongnu.org; Tue, 10 Aug 2004 20:22:53 -0400 Received: from nowt.org (81-178-207-113.dsl.pipex.com [81.178.207.113]) by shockwave.systems.pipex.net (Postfix) with ESMTP id 6AEFE1C00146 for ; Wed, 11 Aug 2004 01:22:51 +0100 (BST) Received: from wren.home (wren.home [192.168.1.7]) by nowt.org (Postfix) with ESMTP id E656AAC95 for ; Wed, 11 Aug 2004 01:22:50 +0100 (BST) From: Paul Brook Date: Wed, 11 Aug 2004 01:22:50 +0100 MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_abWGBcCB2n+zPDR" Message-Id: <200408110122.50589.paul@codesourcery.com> Subject: [Qemu-devel] [patch] Bugfix for 64-bit targets 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 --Boundary-00=_abWGBcCB2n+zPDR Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline The attached patch fixes a bug in arm target emulation on hosts where sizeof(int) > 4. On these targets the offset wouldn't be properly sign extended. Paul --Boundary-00=_abWGBcCB2n+zPDR Content-Type: text/x-diff; charset="us-ascii"; name="patch.qemu_bl64" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch.qemu_bl64" Index: translate.c =================================================================== RCS file: /cvsroot/qemu/qemu/target-arm/translate.c,v retrieving revision 1.10 diff -u -p -r1.10 translate.c --- translate.c 22 Jun 2004 10:55:49 -0000 1.10 +++ translate.c 11 Aug 2004 00:17:59 -0000 @@ -690,15 +867,15 @@ static void disas_arm_insn(DisasContext case 0xa: case 0xb: { - int offset; + int32_t offset; /* branch (and link) */ - val = (int)s->pc; + val = (int32_t)s->pc; if (insn & (1 << 24)) { gen_op_movl_T0_im(val); gen_op_movl_reg_TN[0][14](); } - offset = (((int)insn << 8) >> 8); + offset = (((int32_t)insn << 8) >> 8); val += (offset << 2) + 4; gen_op_jmp((long)s->tb, val); s->is_jmp = DISAS_TB_JUMP; --Boundary-00=_abWGBcCB2n+zPDR--