aboutsummaryrefslogtreecommitdiff
path: root/target/openrisc/machine.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2019-08-26 15:10:10 -0700
committerRichard Henderson <richard.henderson@linaro.org>2019-09-04 12:58:55 -0700
commita465772eea8fef59bef9a9fe424b1af4866991f5 (patch)
tree67872aa23218d239cfbd37c28b538d3ae063ea1f /target/openrisc/machine.c
parent2b13b4b93dc924a139d7a9350cd13c2c9479d03b (diff)
downloadqemu-a465772eea8fef59bef9a9fe424b1af4866991f5.zip
qemu-a465772eea8fef59bef9a9fe424b1af4866991f5.tar.gz
qemu-a465772eea8fef59bef9a9fe424b1af4866991f5.tar.bz2
target/openrisc: Implement move to/from FPCSR
Reviewed-by: Stafford Horne <shorne@gmail.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/openrisc/machine.c')
-rw-r--r--target/openrisc/machine.c11
1 files changed, 11 insertions, 0 deletions
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),