aboutsummaryrefslogtreecommitdiff
path: root/hw/ecc.c
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2011-01-21 13:12:11 +0300
committerAndrzej Zaborowski <balrog@zabor.org>2011-01-29 13:25:22 +0100
commit34f9f0b5802a6ff9ec0be00810f7910d3935df3e (patch)
tree560fbc89cc793ba8b0a83bad4e9403ea41472a12 /hw/ecc.c
parent43842120f482564ea2059a78ae6b8a93bb18c91d (diff)
downloadqemu-34f9f0b5802a6ff9ec0be00810f7910d3935df3e.zip
qemu-34f9f0b5802a6ff9ec0be00810f7910d3935df3e.tar.gz
qemu-34f9f0b5802a6ff9ec0be00810f7910d3935df3e.tar.bz2
spitz: make sl-nand emulation use qdev infrastructure
Switch sl-nand emulation to use qdev and vmstate. Also drop ecc_get/_put functions as sl-nand was the only user of that code. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Diffstat (limited to 'hw/ecc.c')
-rw-r--r--hw/ecc.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/hw/ecc.c b/hw/ecc.c
index 2fbf167..a75408b 100644
--- a/hw/ecc.c
+++ b/hw/ecc.c
@@ -74,18 +74,15 @@ void ecc_reset(ECCState *s)
}
/* Save/restore */
-void ecc_put(QEMUFile *f, ECCState *s)
-{
- qemu_put_8s(f, &s->cp);
- qemu_put_be16s(f, &s->lp[0]);
- qemu_put_be16s(f, &s->lp[1]);
- qemu_put_be16s(f, &s->count);
-}
-
-void ecc_get(QEMUFile *f, ECCState *s)
-{
- qemu_get_8s(f, &s->cp);
- qemu_get_be16s(f, &s->lp[0]);
- qemu_get_be16s(f, &s->lp[1]);
- qemu_get_be16s(f, &s->count);
-}
+VMStateDescription vmstate_ecc_state = {
+ .name = "ecc-state",
+ .version_id = 0,
+ .minimum_version_id = 0,
+ .minimum_version_id_old = 0,
+ .fields = (VMStateField []) {
+ VMSTATE_UINT8(cp, ECCState),
+ VMSTATE_UINT16_ARRAY(lp, ECCState, 2),
+ VMSTATE_UINT16(count, ECCState),
+ VMSTATE_END_OF_LIST(),
+ },
+};