Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JTuf6-000237-Bu for qemu-devel@nongnu.org; Tue, 26 Feb 2008 02:55:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JTuf4-00020Z-Mo for qemu-devel@nongnu.org; Tue, 26 Feb 2008 02:55:40 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTuf4-00020K-Ia for qemu-devel@nongnu.org; Tue, 26 Feb 2008 02:55:38 -0500 Received: from smtp22.orange.fr ([80.12.242.28]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JTuf3-0007KM-Q6 for qemu-devel@nongnu.org; Tue, 26 Feb 2008 02:55:38 -0500 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2202.orange.fr (SMTP Server) with ESMTP id 5B49D1C00099 for ; Tue, 26 Feb 2008 08:55:35 +0100 (CET) Received: from wwinf2231 (wwinf2231 [172.22.131.105]) by mwinf2202.orange.fr (SMTP Server) with ESMTP id 58A351C00095 for ; Tue, 26 Feb 2008 08:55:35 +0100 (CET) From: claude vittoria Message-ID: <29936457.619721204012535292.JavaMail.www@wwinf2231> Subject: Re: [Qemu-devel] [ARM] add with PC in argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 26 Feb 2008 08:55:35 +0100 (CET) Reply-To: claude vittoria , 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 >On 2/24/08, claude vittoria wrote: >> So in qemu I don't get the same comportement. The add of lr =3D pc + 4 >> gives lr =3D pc + 8 into qemu. >> I think that s->pc +=3D 4 at start of disas_arm_insn alters the result. >> Could you confirm ? >> >> 0x7c add lr, pc, #4 >> 0x80 ldr pc, =3DSystemInterrupt >> >> 0x84 ldr r3, [sp, #PSR_OFF] <=3D never executed in Qemu >> 0x88 msr spsr_cxsf, r3 @ put cpsr in SPSR >> 0x8c ldmia sp, {r0-r15}^ @ restore Context >The add lr,pc, #4 will put 0x88 into lr. As Daniel wrote, in ARM >mode, when an instruction which address is addr reads the >PC, it will read addr + 8. >Given the mutekh link you provide has no source code for ARM >(at least I couldn't find it), we can't guess where the ldr pc >jumps to. Thanks for answer. You are right : cited of ARM Architecture Reference Manual "Reading the program counter When an instruction reads the PC, the value read depends on which instructi= on set it comes from: =E2=80=A2 For an ARM instruction, the value read is the address of the inst= ruction plus 8 bytes. Bits [1:0] of this value are always zero, because ARM instructions are always word-aligned." Yes MutekH is the new release, I didn't take care of the release. To find t= he version that I m testing (porting), http://www-asim.lip6.fr/recherche/di= sydent/, take disydent source and you find a directory oes where are the ke= rnel source. I taken a short way, I was starting of http://www.ens-lyon.fr/LIP/Pub/Rappo= rts/RR/RR2006/RR2006-12.pdf, source http://perso.ens-lyon.fr/nicolas.fourne= l/projects/ARM/mutek.html. The port has been tested with skyeyes, it seems that a bug in source or in = skyeyes, I should have read the RM before to post... as often :o) Thanks a lot again, Claude