* [Qemu-devel] [patch] Arm/Thumb entry points
@ 2006-02-03 15:14 Paul Brook
0 siblings, 0 replies; only message in thread
From: Paul Brook @ 2006-02-03 15:14 UTC (permalink / raw)
To: qemu-devel
The patch fixes a bug in the arm usermode emulation. The CPU wasn't being
correctly initialized when the entry point is a Thumb function.
Paul
=== linux-user/elfload.c
==================================================================
--- linux-user/elfload.c (revision 1831)
+++ linux-user/elfload.c (local)
@@ -100,7 +100,9 @@
target_long *stack = (void *)infop->start_stack;
memset(regs, 0, sizeof(*regs));
regs->ARM_cpsr = 0x10;
- regs->ARM_pc = infop->entry;
+ if (infop->entry & 1)
+ regs->ARM_cpsr |= CPSR_T;
+ regs->ARM_pc = infop->entry & 0xfffffffe;
regs->ARM_sp = infop->start_stack;
regs->ARM_r2 = tswapl(stack[2]); /* envp */
regs->ARM_r1 = tswapl(stack[1]); /* argv */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-02-03 16:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-03 15:14 [Qemu-devel] [patch] Arm/Thumb entry points Paul Brook
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).