aboutsummaryrefslogtreecommitdiff
path: root/hw/eccmemctl.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-10-24 14:14:39 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-10-24 14:14:39 +0000
commit0284dc541042dc7c056cf01c60dbb6d995f5d4f8 (patch)
treef1969cf8ac0763dd809737af400cb73573011ba2 /hw/eccmemctl.c
parent1c6a50e71c42200e8d46ba710be81e2a704fdfb0 (diff)
sparc32: convert eccmemctl to reset + vmsd
Also remove unused include directive. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/eccmemctl.c')
-rw-r--r--hw/eccmemctl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/eccmemctl.c b/hw/eccmemctl.c
index 12c386b058..64d4c5e746 100644
--- a/hw/eccmemctl.c
+++ b/hw/eccmemctl.c
@@ -22,7 +22,6 @@
* THE SOFTWARE.
*/
-#include "sun4m.h"
#include "sysbus.h"
//#define DEBUG_ECC
@@ -276,9 +275,9 @@ static const VMStateDescription vmstate_ecc = {
}
};
-static void ecc_reset(void *opaque)
+static void ecc_reset(DeviceState *d)
{
- ECCState *s = opaque;
+ ECCState *s = container_of(d, ECCState, busdev.qdev);
if (s->version == ECC_MCC)
s->regs[ECC_MER] &= ECC_MER_REU;
@@ -310,9 +309,8 @@ static int ecc_init1(SysBusDevice *dev)
ecc_diag_mem_write, s);
sysbus_init_mmio(dev, ECC_DIAG_SIZE, ecc_io_memory);
}
- vmstate_register(-1, &vmstate_ecc, s);
- qemu_register_reset(ecc_reset, s);
- ecc_reset(s);
+ ecc_reset(&s->busdev.qdev);
+
return 0;
}
@@ -320,6 +318,8 @@ static SysBusDeviceInfo ecc_info = {
.init = ecc_init1,
.qdev.name = "eccmemctl",
.qdev.size = sizeof(ECCState),
+ .qdev.vmsd = &vmstate_ecc,
+ .qdev.reset = ecc_reset,
.qdev.props = (Property[]) {
DEFINE_PROP_HEX32("version", ECCState, version, -1),
DEFINE_PROP_END_OF_LIST(),