Sparc32: port sun4c interrupt controller to VMState design

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2009-08-31 19:30:21 +00:00
parent f4b19cd021
commit 9902571dcd
1 changed files with 12 additions and 22 deletions

View File

@ -169,26 +169,17 @@ static void sun4c_set_irq(void *opaque, int irq, int level)
} }
} }
static void sun4c_intctl_save(QEMUFile *f, void *opaque) static const VMStateDescription vmstate_sun4c_intctl = {
{ .name ="sun4c_intctl",
Sun4c_INTCTLState *s = opaque; .version_id = 1,
.minimum_version_id = 1,
qemu_put_8s(f, &s->reg); .minimum_version_id_old = 1,
qemu_put_8s(f, &s->pending); .fields = (VMStateField []) {
} VMSTATE_UINT8(reg, Sun4c_INTCTLState),
VMSTATE_UINT8(pending, Sun4c_INTCTLState),
static int sun4c_intctl_load(QEMUFile *f, void *opaque, int version_id) VMSTATE_END_OF_LIST()
{ }
Sun4c_INTCTLState *s = opaque; };
if (version_id != 1)
return -EINVAL;
qemu_get_8s(f, &s->reg);
qemu_get_8s(f, &s->pending);
return 0;
}
static void sun4c_intctl_reset(void *opaque) static void sun4c_intctl_reset(void *opaque)
{ {
@ -212,8 +203,7 @@ static int sun4c_intctl_init1(SysBusDevice *dev)
for (i = 0; i < MAX_PILS; i++) { for (i = 0; i < MAX_PILS; i++) {
sysbus_init_irq(dev, &s->cpu_irqs[i]); sysbus_init_irq(dev, &s->cpu_irqs[i]);
} }
register_savevm("sun4c_intctl", -1, 1, sun4c_intctl_save, vmstate_register(-1, &vmstate_sun4c_intctl, s);
sun4c_intctl_load, s);
qemu_register_reset(sun4c_intctl_reset, s); qemu_register_reset(sun4c_intctl_reset, s);
sun4c_intctl_reset(s); sun4c_intctl_reset(s);
return 0; return 0;