Hello,
the Newlib crt0.S
file for ARM starts off by initializing the stack pointers for the different ARM
modes (FIQ, IRQ, supervisor, etc.) with the help of r3.
e.g., this is the
disassembly as produced by GDB:
Dump of assembler code for function
start:
0x00008224 <start+0>: ldr r3, [pc, #208] ; 0x82fc <$d+4>
0x00008228 <start+4>: cmp r3, #0 ; 0x0
0x0000822c <start+8>: ldreq r3, [pc, #196] ; 0x82f8 <$d>
0x00008230 <start+12>: msr CPSR_c, #209 ; 0xd1
0x00008234 <start+16>: mov sp, r3
0x00008238 <start+20>: sub r10, sp, #4096 ; 0x1000
0x0000823c <start+24>: mov r3, r10
0x00008240 <start+28>: msr CPSR_c, #215 ; 0xd7
0x00008244 <start+32>: mov sp, r3
...
0x00008224 <start+0>: ldr r3, [pc, #208] ; 0x82fc <$d+4>
0x00008228 <start+4>: cmp r3, #0 ; 0x0
0x0000822c <start+8>: ldreq r3, [pc, #196] ; 0x82f8 <$d>
0x00008230 <start+12>: msr CPSR_c, #209 ; 0xd1
0x00008234 <start+16>: mov sp, r3
0x00008238 <start+20>: sub r10, sp, #4096 ; 0x1000
0x0000823c <start+24>: mov r3, r10
0x00008240 <start+28>: msr CPSR_c, #215 ; 0xd7
0x00008244 <start+32>: mov sp, r3
...
Basically, r3 is initialized by <start+8> (to
0x80000, in my case). The next instruction (at <start+12>) switches
the mode to FIQ. After single steping over this in QEMU (via GDB si),
r3 no longer contains what it had before (0x80000), instead, it is set to 0.
If I manually fix this (via set $r3=0x80000), then at the next mode switch (at
<start+28>) r3 is changed incorrectly to zero again.
Is this
my fault or what is happening?
I am
invoking qemu as
arm-softmmu/qemu-system-arm -S -s -M
altera_excalibur -m 64 -net none -nographic -kernel
../projekte/L6/node-arm/libsys/test-io/libsys_test_uart -monitor null -parallel
null -serial null
(where
altera_excalibur is a machine that I have added and would like to
debug).
Regards,
Konrad
Schwarz
BEGIN:VCARD VERSION:2.1 N:Schwarz;Konrad FN:Konrad Schwarz ORG:Siemens AG;CT SE 2 TITLE:Principal Engineer TEL;WORK;VOICE:+49 (89) 636-53579 TEL;WORK;FAX:+49 (89) 636-45450 ADR;WORK;ENCODING=QUOTED-PRINTABLE:;53 518;Siemens AG=0D=0ACT SE 2;M=FCnchen;;81730;Germany LABEL;WORK;ENCODING=QUOTED-PRINTABLE:53 518=0D=0ASiemens AG=0D=0ACT SE 2=0D=0AM=FCnchen 81730=0D=0AGermany ADR;POSTAL;ENCODING=QUOTED-PRINTABLE:;;Siemens AG=0D=0ACT SE 2;M=FCnchen;;81730;Germany LABEL;POSTAL;ENCODING=QUOTED-PRINTABLE:Siemens AG=0D=0ACT SE 2=0D=0AM=FCnchen 81730=0D=0AGermany EMAIL;PREF;INTERNET:[EMAIL PROTECTED] REV:20060130T101011Z END:VCARD
_______________________________________________ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel