Revision 9d472d51 hw/wdt_i6300esb.c
b/hw/wdt_i6300esb.c | ||
---|---|---|
25 | 25 |
#include "qemu-timer.h" |
26 | 26 |
#include "watchdog.h" |
27 | 27 |
#include "hw.h" |
28 |
#include "isa.h" |
|
29 | 28 |
#include "pc.h" |
30 | 29 |
#include "pci.h" |
31 | 30 |
|
... | ... | |
71 | 70 |
|
72 | 71 |
/* Device state. */ |
73 | 72 |
struct I6300State { |
74 |
PCIDevice dev; /* PCI device state, must be first field. */
|
|
73 |
PCIDevice dev; |
|
75 | 74 |
|
76 | 75 |
int reboot_enabled; /* "Reboot" on timer expiry. The real action |
77 | 76 |
* performed depends on the -watchdog-action |
... | ... | |
199 | 198 |
static void i6300esb_config_write(PCIDevice *dev, uint32_t addr, |
200 | 199 |
uint32_t data, int len) |
201 | 200 |
{ |
202 |
I6300State *d = (I6300State *) dev;
|
|
201 |
I6300State *d = container_of(dev, I6300State, dev);
|
|
203 | 202 |
int old; |
204 | 203 |
|
205 | 204 |
i6300esb_debug("addr = %x, data = %x, len = %d\n", addr, data, len); |
... | ... | |
227 | 226 |
|
228 | 227 |
static uint32_t i6300esb_config_read(PCIDevice *dev, uint32_t addr, int len) |
229 | 228 |
{ |
230 |
I6300State *d = (I6300State *) dev;
|
|
229 |
I6300State *d = container_of(dev, I6300State, dev);
|
|
231 | 230 |
uint32_t data; |
232 | 231 |
|
233 | 232 |
i6300esb_debug ("addr = %x, len = %d\n", addr, len); |
... | ... | |
361 | 360 |
i6300esb_mem_writew, |
362 | 361 |
i6300esb_mem_writel, |
363 | 362 |
}; |
364 |
I6300State *d = (I6300State *) dev;
|
|
363 |
I6300State *d = container_of(dev, I6300State, dev);
|
|
365 | 364 |
int io_mem; |
366 | 365 |
|
367 | 366 |
i6300esb_debug("addr = %x, size = %x, type = %d\n", addr, size, type); |
Also available in: Unified diff