linux-user/sparc: Handle tstate in sparc64_get/set_context()
commit7a5805a08f942325b373643099f784cdac65c9ea
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 6 Nov 2020 15:27:38 +0000 (6 15:27 +0000)
committerLaurent Vivier <laurent@vivier.eu>
Fri, 18 Dec 2020 10:23:29 +0000 (18 11:23 +0100)
tree2fc3e3537c8b428adeb457bc13f7170ec35d1e92
parent0ad20314f1e11acaeedcb14135b178a5711766f5
linux-user/sparc: Handle tstate in sparc64_get/set_context()

Correctly implement save/restore of the tstate field in
sparc64_get_context() and sparc64_set_context():
 * Don't use the CWP value from the guest in set_context
 * Construct and save a tstate value rather than leaving
   it as zero in get_context

To do this we factor out the "calculate TSTATE value from CPU state"
code from sparc_cpu_do_interrupt() into its own sparc64_tstate()
function; that in turn requires us to move some of the function
prototypes out from inside a CPU_NO_IO_DEFS ifdef guard.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20201106152738.26026-5-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/sparc/signal.c
target/sparc/cpu.h
target/sparc/int64_helper.c