timeout <<= 5;
/* Get the timeout in units of ticks_per_sec. */
- timeout = ticks_per_sec * timeout / 33000000;
+ timeout = get_ticks_per_sec() * timeout / 33000000;
i6300esb_debug("stage %d, timeout %" PRIi64 "\n", d->stage, timeout);
static void i6300esb_config_write(PCIDevice *dev, uint32_t addr,
uint32_t data, int len)
{
- I6300State *d = container_of(dev, I6300State, dev);
+ I6300State *d = DO_UPCAST(I6300State, dev, dev);
int old;
i6300esb_debug("addr = %x, data = %x, len = %d\n", addr, data, len);
static uint32_t i6300esb_config_read(PCIDevice *dev, uint32_t addr, int len)
{
- I6300State *d = container_of(dev, I6300State, dev);
+ I6300State *d = DO_UPCAST(I6300State, dev, dev);
uint32_t data;
i6300esb_debug ("addr = %x, len = %d\n", addr, len);
i6300esb_mem_writew,
i6300esb_mem_writel,
};
- I6300State *d = container_of(dev, I6300State, dev);
+ I6300State *d = DO_UPCAST(I6300State, dev, dev);
int io_mem;
i6300esb_debug("addr = %x, size = %x, type = %d\n", addr, size, type);
return 0;
}
-static void i6300esb_init(PCIDevice *dev)
+static int i6300esb_init(PCIDevice *dev)
{
- I6300State *d = container_of(dev, I6300State, dev);
+ I6300State *d = DO_UPCAST(I6300State, dev, dev);
uint8_t *pci_conf;
d->reboot_enabled = 1;
register_savevm("i6300esb_wdt", -1, sizeof(I6300State),
i6300esb_save, i6300esb_load, d);
+
+ return 0;
}
static WatchdogTimerModel model = {