diff options
Diffstat (limited to 'linux-user/elfload.c')
-rw-r--r-- | linux-user/elfload.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index e47caff7ae..f807baf389 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2,7 +2,6 @@ #include "qemu/osdep.h" #include <sys/param.h> -#include <sys/mman.h> #include <sys/resource.h> #include "qemu.h" @@ -274,19 +273,20 @@ static inline void init_thread(struct target_pt_regs *regs, abi_long stack = infop->start_stack; memset(regs, 0, sizeof(*regs)); - regs->ARM_cpsr = 0x10; - if (infop->entry & 1) - regs->ARM_cpsr |= CPSR_T; - regs->ARM_pc = infop->entry & 0xfffffffe; - regs->ARM_sp = infop->start_stack; + regs->uregs[16] = ARM_CPU_MODE_USR; + if (infop->entry & 1) { + regs->uregs[16] |= CPSR_T; + } + regs->uregs[15] = infop->entry & 0xfffffffe; + regs->uregs[13] = infop->start_stack; /* FIXME - what to for failure of get_user()? */ - get_user_ual(regs->ARM_r2, stack + 8); /* envp */ - get_user_ual(regs->ARM_r1, stack + 4); /* envp */ + get_user_ual(regs->uregs[2], stack + 8); /* envp */ + get_user_ual(regs->uregs[1], stack + 4); /* envp */ /* XXX: it seems that r0 is zeroed after ! */ - regs->ARM_r0 = 0; + regs->uregs[0] = 0; /* For uClinux PIC binaries. */ /* XXX: Linux does this only on ARM with no MMU (do we care ?) */ - regs->ARM_r10 = infop->start_data; + regs->uregs[10] = infop->start_data; } #define ELF_NREG 18 |