diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2019-09-16 15:15:34 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-10-15 18:09:03 +0100 |
commit | 6ed6845532ef023ab9953e22f3aada6aa59657b9 (patch) | |
tree | b89846758c69eb739f29641c48b340ee5bedcdab /target/arm/internals.h | |
parent | 35e9a0a8ce4be12a86e5cedd1268ff22eeacdc9e (diff) | |
download | qemu-6ed6845532ef023ab9953e22f3aada6aa59657b9.zip |
target/arm/arm-semi: Restrict use of TaskState*
The semihosting code needs accuss to the linux-user only
TaskState pointer so it can set the semihosting errno per-thread
for linux-user mode. At the moment we do this by having some
ifdefs so that we define a 'ts' local in do_arm_semihosting()
which is either a real TaskState * or just a CPUARMState *,
depending on which mode we're compiling for.
This is awkward if we want to refactor do_arm_semihosting()
into other functions which might need to be passed the TaskState.
Restrict usage of the TaskState local by:
* making set_swi_errno() always take the CPUARMState pointer
and (for the linux-user version) get TaskState from that
* creating a new get_swi_errno() which reads the errno
* having the two semihosting calls which need the TaskState
for other purposes (SYS_GET_CMDLINE and SYS_HEAPINFO)
define a variable with scope restricted to just that code
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190916141544.17540-6-peter.maydell@linaro.org
Diffstat (limited to 'target/arm/internals.h')
0 files changed, 0 insertions, 0 deletions