From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BwMVi-0008D7-Uc for qemu-devel@nongnu.org; Sun, 15 Aug 2004 11:01:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BwMVg-0008Cv-Rx for qemu-devel@nongnu.org; Sun, 15 Aug 2004 11:01:26 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BwMVg-0008Cs-K7 for qemu-devel@nongnu.org; Sun, 15 Aug 2004 11:01:24 -0400 Received: from [129.104.30.34] (helo=a.mx.polytechnique.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BwMRP-0001Dk-1i for qemu-devel@nongnu.org; Sun, 15 Aug 2004 10:56:59 -0400 Received: from localhost (localhost [127.0.0.1]) by djali.m4x.org (Postfix) with ESMTP id 5BC483326B for ; Sun, 15 Aug 2004 16:56:58 +0200 (CEST) Received: from djali.m4x.org ([127.0.0.1]) by localhost (djali [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 13894-10 for ; Sun, 15 Aug 2004 16:56:58 +0200 (CEST) Received: from bellard.org (nas-cbv-9-213-228-47-200.dial.proxad.net [213.228.47.200]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTP id D84C1331D0 for ; Sun, 15 Aug 2004 16:56:56 +0200 (CEST) Message-ID: <411F79CA.8050600@bellard.org> Date: Sun, 15 Aug 2004 16:57:14 +0200 From: Fabrice Bellard MIME-Version: 1.0 Subject: Re: [Qemu-devel] [patch] Bugfix for 64-bit targets References: <200408110122.50589.paul@codesourcery.com> In-Reply-To: <200408110122.50589.paul@codesourcery.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 Hi, I am afraid to say that sizeof(int) = 4 is hardcoded in QEMU. QEMU assumes that sizeof(long) = sizeof(void *) = 4 or 8 bytes depending on the host. Fabrice. Paul Brook wrote: > 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 > > > ------------------------------------------------------------------------ > > 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; > > > ------------------------------------------------------------------------ > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/qemu-devel