mirror of https://github.com/xemu-project/xemu.git
vmstate: port heathrow_pic
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
075790c2c2
commit
4acd38cef0
|
@ -159,42 +159,31 @@ static void heathrow_pic_set_irq(void *opaque, int num, int level)
|
||||||
heathrow_pic_update(s);
|
heathrow_pic_update(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void heathrow_pic_save_one(QEMUFile *f, HeathrowPIC *s)
|
static const VMStateDescription vmstate_heathrow_pic_one = {
|
||||||
{
|
.name = "heathrow_pic_one",
|
||||||
qemu_put_be32s(f, &s->events);
|
.version_id = 0,
|
||||||
qemu_put_be32s(f, &s->mask);
|
.minimum_version_id = 0,
|
||||||
qemu_put_be32s(f, &s->levels);
|
.minimum_version_id_old = 0,
|
||||||
qemu_put_be32s(f, &s->level_triggered);
|
.fields = (VMStateField[]) {
|
||||||
}
|
VMSTATE_UINT32(events, HeathrowPIC),
|
||||||
|
VMSTATE_UINT32(mask, HeathrowPIC),
|
||||||
|
VMSTATE_UINT32(levels, HeathrowPIC),
|
||||||
|
VMSTATE_UINT32(level_triggered, HeathrowPIC),
|
||||||
|
VMSTATE_END_OF_LIST()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
static void heathrow_pic_save(QEMUFile *f, void *opaque)
|
static const VMStateDescription vmstate_heathrow_pic = {
|
||||||
{
|
.name = "heathrow_pic",
|
||||||
HeathrowPICS *s = (HeathrowPICS *)opaque;
|
.version_id = 1,
|
||||||
|
.minimum_version_id = 1,
|
||||||
heathrow_pic_save_one(f, &s->pics[0]);
|
.minimum_version_id_old = 1,
|
||||||
heathrow_pic_save_one(f, &s->pics[1]);
|
.fields = (VMStateField[]) {
|
||||||
}
|
VMSTATE_STRUCT_ARRAY(pics, HeathrowPICS, 2, 1,
|
||||||
|
vmstate_heathrow_pic_one, HeathrowPIC),
|
||||||
static void heathrow_pic_load_one(QEMUFile *f, HeathrowPIC *s)
|
VMSTATE_END_OF_LIST()
|
||||||
{
|
}
|
||||||
qemu_get_be32s(f, &s->events);
|
};
|
||||||
qemu_get_be32s(f, &s->mask);
|
|
||||||
qemu_get_be32s(f, &s->levels);
|
|
||||||
qemu_get_be32s(f, &s->level_triggered);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int heathrow_pic_load(QEMUFile *f, void *opaque, int version_id)
|
|
||||||
{
|
|
||||||
HeathrowPICS *s = (HeathrowPICS *)opaque;
|
|
||||||
|
|
||||||
if (version_id != 1)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
heathrow_pic_load_one(f, &s->pics[0]);
|
|
||||||
heathrow_pic_load_one(f, &s->pics[1]);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void heathrow_pic_reset_one(HeathrowPIC *s)
|
static void heathrow_pic_reset_one(HeathrowPIC *s)
|
||||||
{
|
{
|
||||||
|
@ -223,8 +212,7 @@ qemu_irq *heathrow_pic_init(int *pmem_index,
|
||||||
*pmem_index = cpu_register_io_memory(pic_read, pic_write, s,
|
*pmem_index = cpu_register_io_memory(pic_read, pic_write, s,
|
||||||
DEVICE_LITTLE_ENDIAN);
|
DEVICE_LITTLE_ENDIAN);
|
||||||
|
|
||||||
register_savevm(NULL, "heathrow_pic", -1, 1, heathrow_pic_save,
|
vmstate_register(NULL, -1, &vmstate_heathrow_pic, s);
|
||||||
heathrow_pic_load, s);
|
|
||||||
qemu_register_reset(heathrow_pic_reset, s);
|
qemu_register_reset(heathrow_pic_reset, s);
|
||||||
return qemu_allocate_irqs(heathrow_pic_set_irq, s, 64);
|
return qemu_allocate_irqs(heathrow_pic_set_irq, s, 64);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue