vmstate: port m48t59

Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
Juan Quintela 2010-12-02 00:16:33 +01:00 committed by Anthony Liguori
parent aefe212931
commit fd484ae494

View File

@ -585,28 +585,18 @@ static CPUReadMemoryFunc * const nvram_read[] = {
&nvram_readl, &nvram_readl,
}; };
static void m48t59_save(QEMUFile *f, void *opaque) static const VMStateDescription vmstate_m48t59 = {
{ .name = "m48t59",
M48t59State *s = opaque; .version_id = 1,
.minimum_version_id = 1,
qemu_put_8s(f, &s->lock); .minimum_version_id_old = 1,
qemu_put_be16s(f, &s->addr); .fields = (VMStateField[]) {
qemu_put_buffer(f, s->buffer, s->size); VMSTATE_UINT8(lock, M48t59State),
} VMSTATE_UINT16(addr, M48t59State),
VMSTATE_VBUFFER_UINT32(buffer, M48t59State, 0, NULL, 0, size),
static int m48t59_load(QEMUFile *f, void *opaque, int version_id) VMSTATE_END_OF_LIST()
{
M48t59State *s = opaque;
if (version_id != 1)
return -EINVAL;
qemu_get_8s(f, &s->lock);
qemu_get_be16s(f, &s->addr);
qemu_get_buffer(f, s->buffer, s->size);
return 0;
} }
};
static void m48t59_reset_common(M48t59State *NVRAM) static void m48t59_reset_common(M48t59State *NVRAM)
{ {
@ -696,7 +686,7 @@ static void m48t59_init_common(M48t59State *s)
} }
qemu_get_timedate(&s->alarm, 0); qemu_get_timedate(&s->alarm, 0);
register_savevm(NULL, "m48t59", -1, 1, m48t59_save, m48t59_load, s); vmstate_register(NULL, -1, &vmstate_m48t59, s);
} }
static int m48t59_init_isa1(ISADevice *dev) static int m48t59_init_isa1(ISADevice *dev)