Skip to content

Commit

Permalink
target-moxie: Fix VMState registration
Browse files Browse the repository at this point in the history
Register the CPU VMState in the correct way, via cpu_class_set_vmsd(),
rather than doing it in two different wrong ways (once by providing
cpu_save and cpu_load functions, and once by setting the vmsd field in
DeviceClass).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
pm215 authored and stefanhaRH committed Apr 12, 2013
1 parent 93b48c2 commit 183543c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion target-moxie/cpu.c
Expand Up @@ -97,7 +97,7 @@ static void moxie_cpu_class_init(ObjectClass *oc, void *data)

cc->class_by_name = moxie_cpu_class_by_name;

dc->vmsd = &vmstate_moxie_cpu;
cpu_class_set_vmsd(cc, &vmstate_moxie_cpu);
cc->do_interrupt = moxie_cpu_do_interrupt;
}

Expand Down
2 changes: 0 additions & 2 deletions target-moxie/cpu.h
Expand Up @@ -28,8 +28,6 @@

#define TARGET_HAS_ICE 1

#define CPU_SAVE_VERSION 1

#define ELF_MACHINE 0xFEED /* EM_MOXIE */

#define MOXIE_EX_DIV0 0
Expand Down
12 changes: 1 addition & 11 deletions target-moxie/machine.c
Expand Up @@ -3,7 +3,7 @@

const VMStateDescription vmstate_moxie_cpu = {
.name = "cpu",
.version_id = CPU_SAVE_VERSION,
.version_id = 1,
.minimum_version_id = 1,
.minimum_version_id_old = 1,
.fields = (VMStateField[]) {
Expand All @@ -16,13 +16,3 @@ const VMStateDescription vmstate_moxie_cpu = {
VMSTATE_END_OF_LIST()
}
};

void cpu_save(QEMUFile *f, void *opaque)
{
vmstate_save_state(f, &vmstate_moxie_cpu, opaque);
}

int cpu_load(QEMUFile *f, void *opaque, int version_id)
{
return vmstate_load_state(f, &vmstate_moxie_cpu, opaque, version_id);
}

0 comments on commit 183543c

Please sign in to comment.