mirror of
https://github.com/qemu/qemu.git
synced 2025-08-08 17:04:34 +00:00
ib700: Introduce IB700State
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
048eabcb0b
commit
f309270bee
@ -35,6 +35,10 @@
|
|||||||
#define ib700_debug(fs,...)
|
#define ib700_debug(fs,...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef struct IB700state {
|
||||||
|
ISADevice dev;
|
||||||
|
} IB700State;
|
||||||
|
|
||||||
/* This is the timer. We use a global here because the watchdog
|
/* This is the timer. We use a global here because the watchdog
|
||||||
* code ensures there is only one watchdog (it is located at a fixed,
|
* code ensures there is only one watchdog (it is located at a fixed,
|
||||||
* unchangable IO port, so there could only ever be one anyway).
|
* unchangable IO port, so there could only ever be one anyway).
|
||||||
@ -90,10 +94,12 @@ static int ib700_load(QEMUFile *f, void *vp, int version)
|
|||||||
|
|
||||||
static int wdt_ib700_init(ISADevice *dev)
|
static int wdt_ib700_init(ISADevice *dev)
|
||||||
{
|
{
|
||||||
timer = qemu_new_timer(vm_clock, ib700_timer_expired, NULL);
|
IB700State *s = DO_UPCAST(IB700State, dev, dev);
|
||||||
register_savevm("ib700_wdt", -1, 0, ib700_save, ib700_load, NULL);
|
|
||||||
register_ioport_write(0x441, 2, 1, ib700_write_disable_reg, NULL);
|
timer = qemu_new_timer(vm_clock, ib700_timer_expired, s);
|
||||||
register_ioport_write(0x443, 2, 1, ib700_write_enable_reg, NULL);
|
register_savevm("ib700_wdt", -1, 0, ib700_save, ib700_load, s);
|
||||||
|
register_ioport_write(0x441, 2, 1, ib700_write_disable_reg, s);
|
||||||
|
register_ioport_write(0x443, 2, 1, ib700_write_enable_reg, s);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -105,7 +111,7 @@ static WatchdogTimerModel model = {
|
|||||||
|
|
||||||
static ISADeviceInfo wdt_ib700_info = {
|
static ISADeviceInfo wdt_ib700_info = {
|
||||||
.qdev.name = "ib700",
|
.qdev.name = "ib700",
|
||||||
.qdev.size = sizeof(ISADevice),
|
.qdev.size = sizeof(IB700State),
|
||||||
.init = wdt_ib700_init,
|
.init = wdt_ib700_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user