[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 08/35] vmstate: introduce float32 arrays
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH 08/35] vmstate: introduce float32 arrays |
Date: |
Fri, 04 May 2012 14:00:35 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0 |
Am 04.05.2012 12:54, schrieb Juan Quintela:
> Signed-off-by: Juan Quintela <address@hidden>
> ---
> savevm.c | 25 +++++++++++++++++++++++++
> vmstate.h | 5 +++++
> 2 files changed, 30 insertions(+), 0 deletions(-)
>
> diff --git a/savevm.c b/savevm.c
> index 2d18bab..a22278e 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -1082,6 +1082,31 @@ const VMStateInfo vmstate_info_uint16_equal = {
> .put = put_uint16,
> };
>
> +/* 32 bit float */
> +
> +static int get_float32(QEMUFile *f, void *pv, size_t size)
> +{
> + float32 *v = pv;
> + uint32_t u;
> + qemu_get_be32s(f, &u);
> + *v = make_float32(u);
> + return 0;
> +}
> +
> +static void put_float32(QEMUFile *f, void *pv, size_t size)
> +{
> + float32 *v = pv;
> + uint32_t u;
> + u = float32_val(*v);
> + qemu_put_be32s(f, &u);
> +}
> +
> +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)
> diff --git a/vmstate.h b/vmstate.h
> index 1a4a60b..135c5aa 100644
> --- a/vmstate.h
> +++ b/vmstate.h
> @@ -130,6 +130,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_buffer;
> extern const VMStateInfo vmstate_info_unused_buffer;
> @@ -559,6 +561,9 @@ extern const VMStateDescription vmstate_cpu;
> #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)
Why isn't there a VMSTATE_FLOAT32_ARRAY_V for symmetry? Otherwise looks
fine.
/-F
> +
> #define VMSTATE_BUFFER_V(_f, _s, _v) \
> VMSTATE_STATIC_BUFFER(_f, _s, _v, NULL, 0, sizeof(typeof_field(_s, _f)))
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- Re: [Qemu-devel] [PATCH 01/35] vmstate: Simplify test for CPU_SAVE_VERSION, (continued)
[Qemu-devel] [PATCH 04/35] vmstate: use new cpu style for x86, Juan Quintela, 2012/05/04
[Qemu-devel] [PATCH 02/35] vmstate: make all architectures export a way to migrate cpu's, Juan Quintela, 2012/05/04
[Qemu-devel] [PATCH 11/35] vmstate: Introduce VMSTATE_STRUCT_VARRAY_INT32_TEST, Juan Quintela, 2012/05/04
[Qemu-devel] [PATCH 06/35] vmstate: make microblaze cpus not migrateable, Juan Quintela, 2012/05/04
[Qemu-devel] [PATCH 05/35] vmstate: use new style for lm32 cpus, Juan Quintela, 2012/05/04
[Qemu-devel] [PATCH 08/35] vmstate: introduce float32 arrays, Juan Quintela, 2012/05/04
- Re: [Qemu-devel] [PATCH 08/35] vmstate: introduce float32 arrays,
Andreas Färber <=
[Qemu-devel] [PATCH 10/35] vmstate: introduce CPU_DoubleU arrays, Juan Quintela, 2012/05/04
[Qemu-devel] [PATCH 13/35] vmstate: introduce VMSTATE_VARRAY_MULTIPLY, Juan Quintela, 2012/05/04
[Qemu-devel] [PATCH 07/35] vmstate: port cris cpu to vmstate, Juan Quintela, 2012/05/04
[Qemu-devel] [PATCH 14/35] vmstate: define vmstate_info_uinttls, Juan Quintela, 2012/05/04
[Qemu-devel] [PATCH 12/35] vmstate: port ppc cpu, Juan Quintela, 2012/05/04
[Qemu-devel] [PATCH 16/35] vmstate: make incompatible change for sparc, Juan Quintela, 2012/05/04
Re: [Qemu-devel] [PATCH 16/35] vmstate: make incompatible change for sparc, Blue Swirl, 2012/05/06