aboutsummaryrefslogtreecommitdiff
path: root/target-lm32/machine.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-02-02 13:45:29 +0100
committerAndreas Färber <afaerber@suse.de>2013-03-12 10:35:55 +0100
commit0ad6773f1151c9e172b0b714aada78655dda4cf4 (patch)
tree66c68bddfc79af0f1d695d0ef62155b15326091a /target-lm32/machine.c
parente6f010cc27177c97596455b2e2b589bd19b2a486 (diff)
target-lm32: Update VMStateDescription to LM32CPU
Add a vmstate_lm32_cpu referencing the previous VMStateDescription as a sub-struct and hook it up to CPUClass::vmsd. Drop cpu_{save,load}(). Acked-by: Michael Walle <michael@walle.cc> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-lm32/machine.c')
-rw-r--r--target-lm32/machine.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/target-lm32/machine.c b/target-lm32/machine.c
index 6802e818f8..9e0919c254 100644
--- a/target-lm32/machine.c
+++ b/target-lm32/machine.c
@@ -1,9 +1,9 @@
#include "hw/hw.h"
#include "hw/boards.h"
-static const VMStateDescription vmstate_cpu = {
- .name = "cpu",
- .version_id = CPU_SAVE_VERSION,
+static const VMStateDescription vmstate_env = {
+ .name = "env",
+ .version_id = 1,
.minimum_version_id = 1,
.minimum_version_id_old = 1,
.fields = (VMStateField[]) {
@@ -22,12 +22,13 @@ static const VMStateDescription vmstate_cpu = {
}
};
-void cpu_save(QEMUFile *f, void *opaque)
-{
- vmstate_save_state(f, &vmstate_cpu, opaque);
-}
-
-int cpu_load(QEMUFile *f, void *opaque, int version_id)
-{
- return vmstate_load_state(f, &vmstate_cpu, opaque, version_id);
-}
+const VMStateDescription vmstate_lm32_cpu = {
+ .name = "cpu",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .minimum_version_id_old = 1,
+ .fields = (VMStateField[]) {
+ VMSTATE_STRUCT(env, LM32CPU, 1, vmstate_env, CPULM32State),
+ VMSTATE_END_OF_LIST()
+ }
+};