Skip to content

Commit

Permalink
linux-user: ARM: Ignore immediate value for svc in thumb mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
agraf authored and pm215 committed Aug 14, 2012
1 parent 806d102 commit 3a1363a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions linux-user/main.c
Expand Up @@ -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];
Expand Down

0 comments on commit 3a1363a

Please sign in to comment.