summary refs log tree commit diff stats
path: root/include/exec
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-09-07 10:39:27 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-09-07 10:39:27 +0100
commitbb19cbc95ada89ce5e02c132bc6f3268b1a1bfa3 (patch)
treee957b29bf0d4353ad86c46496791d57a40d12ad0 /include/exec
parent19239b39e7501dedec8d92f0eca79c187685bcce (diff)
downloadfocaccia-qemu-bb19cbc95ada89ce5e02c132bc6f3268b1a1bfa3.tar.gz
focaccia-qemu-bb19cbc95ada89ce5e02c132bc6f3268b1a1bfa3.zip
target-arm/arm-semi.c: Factor out repeated 'return env->regs[0]'
Factor out a repeated pattern in the semihosting code:

    gdb_do_syscall(arm_semi_cb, "system,%s", arg0, (int)arg1+1);
    /* arm_semi_cb sets env->regs[0] to the syscall return value */
    return env->regs[0];

For A64 the return value will go in a different register; pull
the sequence out into its own function that passes the return
value in a static variable rather than overloading regs[0]
for the purpose, so the code will work on both A32/T32 and A64.

Note that the lack-of-synchronization bug noted in the FIXME
comment is not introduced by this commit, but was already present.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Christopher Covington <christopher.covington@linaro.org>
Tested-by: Christopher Covington <cov@codeaurora.org>
Message-id: 1439483745-28752-5-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'include/exec')
0 files changed, 0 insertions, 0 deletions