From a465772eea8fef59bef9a9fe424b1af4866991f5 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 26 Aug 2019 15:10:10 -0700 Subject: target/openrisc: Implement move to/from FPCSR Reviewed-by: Stafford Horne Signed-off-by: Richard Henderson --- target/openrisc/machine.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'target/openrisc/machine.c') diff --git a/target/openrisc/machine.c b/target/openrisc/machine.c index 0a96404..b92985d 100644 --- a/target/openrisc/machine.c +++ b/target/openrisc/machine.c @@ -121,10 +121,21 @@ static const VMStateDescription vmstate_env = { } }; +static int cpu_post_load(void *opaque, int version_id) +{ + OpenRISCCPU *cpu = opaque; + CPUOpenRISCState *env = &cpu->env; + + /* Update env->fp_status to match env->fpcsr. */ + cpu_set_fpcsr(env, env->fpcsr); + return 0; +} + const VMStateDescription vmstate_openrisc_cpu = { .name = "cpu", .version_id = 1, .minimum_version_id = 1, + .post_load = cpu_post_load, .fields = (VMStateField[]) { VMSTATE_CPU(), VMSTATE_STRUCT(env, OpenRISCCPU, 1, vmstate_env, CPUOpenRISCState), -- cgit v1.1