qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [ARM] add with PC in argument


From: claude vittoria
Subject: Re: [Qemu-devel] [ARM] add with PC in argument
Date: Tue, 26 Feb 2008 08:55:35 +0100 (CET)

>On 2/24/08, claude vittoria <address@hidden> wrote:
>>  So in qemu I don't get the same comportement. The add of lr = pc + 4
>>  gives lr = pc + 8 into qemu.
>>  I think that s->pc += 4 at start of disas_arm_insn alters the result.
>>  Could you confirm ?
>>
>>  0x7c    add    lr, pc, #4
>>  0x80    ldr    pc, =SystemInterrupt
>>
>>  0x84    ldr    r3, [sp, #PSR_OFF]  <= 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 instruction 
set it comes from:
• For an ARM instruction, the value read is the address of the instruction 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 the 
version that I m testing (porting), 
http://www-asim.lip6.fr/recherche/disydent/, take disydent source and you find 
a directory oes where are the kernel source.

I taken a short way, I was starting of 
http://www.ens-lyon.fr/LIP/Pub/Rapports/RR/RR2006/RR2006-12.pdf, source 
http://perso.ens-lyon.fr/nicolas.fournel/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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]