]> Git Repo - qemu.git/blobdiff - hw/sun4c_intctl.c
usb: uhci: remote wakeup support.
[qemu.git] / hw / sun4c_intctl.c
index e4174f0de855ed3639e4caf5cba057cd9241486f..5c7fdeffb432a68d44c1ba9d9884e1e13a1c02e6 100644 (file)
@@ -60,7 +60,7 @@ typedef struct Sun4c_INTCTLState {
 
 static void sun4c_check_interrupts(void *opaque);
 
-static uint32_t sun4c_intctl_mem_readb(void *opaque, a_target_phys_addr addr)
+static uint32_t sun4c_intctl_mem_readb(void *opaque, target_phys_addr_t addr)
 {
     Sun4c_INTCTLState *s = opaque;
     uint32_t ret;
@@ -71,7 +71,7 @@ static uint32_t sun4c_intctl_mem_readb(void *opaque, a_target_phys_addr addr)
     return ret;
 }
 
-static void sun4c_intctl_mem_writeb(void *opaque, a_target_phys_addr addr,
+static void sun4c_intctl_mem_writeb(void *opaque, target_phys_addr_t addr,
                                     uint32_t val)
 {
     Sun4c_INTCTLState *s = opaque;
@@ -181,9 +181,9 @@ static const VMStateDescription vmstate_sun4c_intctl = {
     }
 };
 
-static void sun4c_intctl_reset(void *opaque)
+static void sun4c_intctl_reset(DeviceState *d)
 {
-    Sun4c_INTCTLState *s = opaque;
+    Sun4c_INTCTLState *s = container_of(d, Sun4c_INTCTLState, busdev.qdev);
 
     s->reg = 1;
     s->pending = 0;
@@ -196,16 +196,15 @@ static int sun4c_intctl_init1(SysBusDevice *dev)
     unsigned int i;
 
     io_memory = cpu_register_io_memory(sun4c_intctl_mem_read,
-                                       sun4c_intctl_mem_write, s);
+                                       sun4c_intctl_mem_write, s,
+                                       DEVICE_NATIVE_ENDIAN);
     sysbus_init_mmio(dev, INTCTL_SIZE, io_memory);
     qdev_init_gpio_in(&dev->qdev, sun4c_set_irq, 8);
 
     for (i = 0; i < MAX_PILS; i++) {
         sysbus_init_irq(dev, &s->cpu_irqs[i]);
     }
-    vmstate_register(-1, &vmstate_sun4c_intctl, s);
-    qemu_register_reset(sun4c_intctl_reset, s);
-    sun4c_intctl_reset(s);
+
     return 0;
 }
 
@@ -213,6 +212,8 @@ static SysBusDeviceInfo sun4c_intctl_info = {
     .init = sun4c_intctl_init1,
     .qdev.name  = "sun4c_intctl",
     .qdev.size  = sizeof(Sun4c_INTCTLState),
+    .qdev.vmsd  = &vmstate_sun4c_intctl,
+    .qdev.reset = sun4c_intctl_reset,
 };
 
 static void sun4c_intctl_register_devices(void)
This page took 0.027403 seconds and 4 git commands to generate.