Revision 9958068d hw/wdt_ib700.c

b/hw/wdt_ib700.c
82 82
    qemu_del_timer(s->timer);
83 83
}
84 84

  
85
static void ib700_save(QEMUFile *f, void *vp)
86
{
87
    IB700State *s = vp;
88

  
89
    qemu_put_timer(f, s->timer);
90
}
91

  
92
static int ib700_load(QEMUFile *f, void *vp, int version)
93
{
94
    IB700State *s = vp;
95

  
96
    if (version != 0)
97
        return -EINVAL;
98

  
99
    qemu_get_timer(f, s->timer);
100

  
101
    return 0;
102
}
85
static const VMStateDescription vmstate_ib700 = {
86
    .name = "ib700_wdt",
87
    .version_id = 0,
88
    .minimum_version_id = 0,
89
    .minimum_version_id_old = 0,
90
    .fields      = (VMStateField []) {
91
        VMSTATE_TIMER(timer, IB700State),
92
        VMSTATE_END_OF_LIST()
93
    }
94
};
103 95

  
104 96
static int wdt_ib700_init(ISADevice *dev)
105 97
{
106 98
    IB700State *s = DO_UPCAST(IB700State, dev, dev);
107 99

  
108 100
    s->timer = qemu_new_timer(vm_clock, ib700_timer_expired, s);
109
    register_savevm("ib700_wdt", -1, 0, ib700_save, ib700_load, s);
101
    vmstate_register(-1, &vmstate_ib700, s);
110 102
    register_ioport_write(0x441, 2, 1, ib700_write_disable_reg, s);
111 103
    register_ioport_write(0x443, 2, 1, ib700_write_enable_reg, s);
112 104

  

Also available in: Unified diff