aboutsummaryrefslogtreecommitdiff
path: root/ecc.h
diff options
context:
space:
mode:
Diffstat (limited to 'ecc.h')
-rw-r--r--ecc.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/ecc.h b/ecc.h
index 11e6d01..e8e3942 100644
--- a/ecc.h
+++ b/ecc.h
@@ -75,3 +75,20 @@ static inline void ecc_reset(struct ecc_state_s *s)
s->cp = 0x00;
s->count = 0;
}
+
+/* Save/restore */
+static inline void ecc_put(QEMUFile *f, struct ecc_state_s *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);
+}
+
+static inline void ecc_get(QEMUFile *f, struct ecc_state_s *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);
+}