[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/28] vmstate: introduce float32 arrays
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 10/28] vmstate: introduce float32 arrays |
Date: |
Wed, 26 Oct 2011 22:16:24 +0200 |
Signed-off-by: Juan Quintela <address@hidden>
---
hw/hw.h | 5 +++++
savevm.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/hw/hw.h b/hw/hw.h
index 0f0200a..014cdc1 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -354,6 +354,8 @@ extern const VMStateInfo vmstate_info_uint16;
extern const VMStateInfo vmstate_info_uint32;
extern const VMStateInfo vmstate_info_uint64;
+extern const VMStateInfo vmstate_info_float32;
+
extern const VMStateInfo vmstate_info_timer;
extern const VMStateInfo vmstate_info_ptimer;
extern const VMStateInfo vmstate_info_buffer;
@@ -875,6 +877,9 @@ extern const VMStateDescription vmstate_hid_ptr_device;
#define VMSTATE_INT64_ARRAY(_f, _s, _n) \
VMSTATE_INT64_ARRAY_V(_f, _s, _n, 0)
+#define VMSTATE_FLOAT32_ARRAY(_f, _s, _n) \
+ VMSTATE_ARRAY(_f, _s, _n, 0, vmstate_info_float32, float32)
+
#define VMSTATE_BUFFER_V(_f, _s, _v) \
VMSTATE_STATIC_BUFFER(_f, _s, _v, NULL, 0, sizeof(typeof_field(_s, _f)))
diff --git a/savevm.c b/savevm.c
index 557eba4..cd0178c 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1027,6 +1027,36 @@ const VMStateInfo vmstate_info_uint16_equal = {
.put = put_uint16,
};
+/* 32 bit float */
+
+typedef union {
+ float32 f;
+ uint32_t i;
+} VMStateFloat32;
+
+static int get_float32(QEMUFile *f, void *pv, size_t size)
+{
+ float32 *v = pv;
+ VMStateFloat32 u;
+ qemu_get_be32s(f, &u.i);
+ *v = u.f;
+ return 0;
+}
+
+static void put_float32(QEMUFile *f, void *pv, size_t size)
+{
+ float32 *v = pv;
+ VMStateFloat32 u;
+ u.f = *v;
+ qemu_put_be32s(f, &u.i);
+}
+
+const VMStateInfo vmstate_info_float32 = {
+ .name = "float32",
+ .get = get_float32,
+ .put = put_float32,
+};
+
/* timers */
static int get_timer(QEMUFile *f, void *pv, size_t size)
--
1.7.6.4
- [Qemu-devel] [PATCH v2 00/28] VMState port of all cpus, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 01/28] vmstate: Fix VMSTATE_VARRAY_UINT32, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 02/28] vmstate: Simplify test for CPU_SAVE_VERSION, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 03/28] vmstate: make all architectures export a way to migrate cpu's, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 04/28] vmstate: unicore32 don't support cpu migration, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 05/28] vmstate: use new cpu style for x86, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 06/28] vmstate: use new style for lm32 cpus, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 07/28] vmstate: make microblaze cpus not migrateable, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 08/28] vmstate: port cris cpu to vmstate, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 09/28] vmstate: machine.c is only compiled for !CONFIG_USER_ONLY, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 10/28] vmstate: introduce float32 arrays,
Juan Quintela <=
- [Qemu-devel] [PATCH 11/28] vmstate: introduce float64 arrays, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 12/28] vmstate: Introduce VMSTATE_STRUCT_VARRAY_INT32_TEST, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 13/28] vmstate: port ppc cpu, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 14/28] vmstate: introduce VMSTATE_VARRAY_MULTIPLY, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 15/28] vmstate: define vmstate_info_uinttls, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 16/28] vmstate: port sparc cpu, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 18/28] mips_fulong2e: cpu vmstate already registered in cpu_exec_init, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 19/28] mips: make mvp an embedded struct instead of pointer, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 20/28] mips: make tlb an embedded struct instead of a pointer, Juan Quintela, 2011/10/26
- [Qemu-devel] [PATCH 21/28] mips: bump migration version to 4, Juan Quintela, 2011/10/26