mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
target-alpha: Register VMStateDescription for AlphaCPU
Commit b758aca1f6
(target-alpha: Enable
the alpha-softmmu target.) introduced cpu_{save,load}() functions but
didn't define CPU_SAVE_VERSION, so they were never registered.
Drop cpu_{save,load}() and register the VMStateDescription via DeviceClass.
This operates on the AlphaCPU object instead of CPUAlphaState.
Reviewed-by: Juan Quintela <quintela@redhat.com>
Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
1a1562f5ea
commit
fe31e73742
3 changed files with 22 additions and 12 deletions
|
@ -20,7 +20,7 @@ static const VMStateInfo vmstate_fpcr = {
|
|||
.put = put_fpcr,
|
||||
};
|
||||
|
||||
static VMStateField vmstate_cpu_fields[] = {
|
||||
static VMStateField vmstate_env_fields[] = {
|
||||
VMSTATE_UINTTL_ARRAY(ir, CPUAlphaState, 31),
|
||||
VMSTATE_UINTTL_ARRAY(fir, CPUAlphaState, 31),
|
||||
/* Save the architecture value of the fpcr, not the internally
|
||||
|
@ -68,20 +68,24 @@ static VMStateField vmstate_cpu_fields[] = {
|
|||
VMSTATE_END_OF_LIST()
|
||||
};
|
||||
|
||||
static const VMStateDescription vmstate_cpu = {
|
||||
static const VMStateDescription vmstate_env = {
|
||||
.name = "env",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.minimum_version_id_old = 1,
|
||||
.fields = vmstate_env_fields,
|
||||
};
|
||||
|
||||
static VMStateField vmstate_cpu_fields[] = {
|
||||
VMSTATE_CPU(),
|
||||
VMSTATE_STRUCT(env, AlphaCPU, 1, vmstate_env, CPUAlphaState),
|
||||
VMSTATE_END_OF_LIST()
|
||||
};
|
||||
|
||||
const VMStateDescription vmstate_alpha_cpu = {
|
||||
.name = "cpu",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.minimum_version_id_old = 1,
|
||||
.fields = vmstate_cpu_fields,
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue