aboutsummaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2013-03-12 14:06:02 +1100
committerJuan Quintela <quintela@redhat.com>2013-03-26 13:30:49 +0100
commit213945e4d753b5f214468ff746d65fa76e21dbd1 (patch)
tree6cdae9e0527d5a8c6dbe8171166e3ddae40034b4 /savevm.c
parentd58f5598342ffebe6c6278d8b90792060fca4792 (diff)
downloadqemu-213945e4d753b5f214468ff746d65fa76e21dbd1.zip
qemu-213945e4d753b5f214468ff746d65fa76e21dbd1.tar.gz
qemu-213945e4d753b5f214468ff746d65fa76e21dbd1.tar.bz2
savevm: Add VMSTATE_FLOAT64 helpers
The current savevm code includes VMSTATE helpers for a number of commonly used data types, but not for the float64 type used by the internal floating point emulation code. This patch fixes the deficiency. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/savevm.c b/savevm.c
index cd98b0d..8f1344a 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1133,6 +1133,29 @@ const VMStateInfo vmstate_info_uint16_equal = {
.put = put_uint16,
};
+/* floating point */
+
+static int get_float64(QEMUFile *f, void *pv, size_t size)
+{
+ float64 *v = pv;
+
+ *v = make_float64(qemu_get_be64(f));
+ return 0;
+}
+
+static void put_float64(QEMUFile *f, void *pv, size_t size)
+{
+ uint64_t *v = pv;
+
+ qemu_put_be64(f, float64_val(*v));
+}
+
+const VMStateInfo vmstate_info_float64 = {
+ .name = "float64",
+ .get = get_float64,
+ .put = put_float64,
+};
+
/* timers */
static int get_timer(QEMUFile *f, void *pv, size_t size)