linux-user: ARM: Ignore immediate value for svc in thumb mode
authorAlexander Graf <agraf@suse.de>
Tue, 29 May 2012 05:30:26 +0000 (05:30 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 14 Aug 2012 19:26:56 +0000 (20:26 +0100)
When running in thumb mode, Linux doesn't evaluate the immediate value
of the svc instruction, but instead just always assumes the syscall number
to be in r7.

This fixes executing go_bootstrap while building go for me.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
linux-user/main.c

index 63c1249576d48b103fdaa5662554119a8a98ac1b..7dea084873e3c0d4e0c8560ac60c8d05cdb90c87 100644 (file)
@@ -822,8 +822,7 @@ void cpu_loop(CPUARMState *env)
                 } else if (n == ARM_NR_semihosting
                            || n == ARM_NR_thumb_semihosting) {
                     env->regs[0] = do_arm_semihosting (env);
-                } else if (n == 0 || n >= ARM_SYSCALL_BASE
-                           || (env->thumb && n == ARM_THUMB_SYSCALL)) {
+                } else if (n == 0 || n >= ARM_SYSCALL_BASE || env->thumb) {
                     /* linux syscall */
                     if (env->thumb || n == 0) {
                         n = env->regs[7];