From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9lXG-00032d-LM for qemu-devel@nongnu.org; Mon, 19 Mar 2012 18:58:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S9lWv-0000tZ-GU for qemu-devel@nongnu.org; Mon, 19 Mar 2012 18:58:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24742) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9lWv-0000tC-8F for qemu-devel@nongnu.org; Mon, 19 Mar 2012 18:58:21 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2JMwJGU006509 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 19 Mar 2012 18:58:19 -0400 From: Juan Quintela Date: Mon, 19 Mar 2012 23:57:39 +0100 Message-Id: <13a12e41e391a9e50a2590a7c4f30c603f07fcc3.1332197811.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: Subject: [Qemu-devel] [PATCH 11/36] vmstate: introduce CPU_DoubleU arrays List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Juan Quintela --- savevm.c | 24 ++++++++++++++++++++++++ vmstate.h | 4 ++++ 2 files changed, 28 insertions(+), 0 deletions(-) diff --git a/savevm.c b/savevm.c index 822f078..4c42076 100644 --- a/savevm.c +++ b/savevm.c @@ -1142,6 +1142,30 @@ const VMStateInfo vmstate_info_float64 = { .put = put_float64, }; +/* 64 bit CPUDouble */ + +static int get_cpudouble(QEMUFile *f, void *pv, size_t size) +{ + CPU_DoubleU *v = pv; + + qemu_get_be32s(f, &v->l.upper); + qemu_get_be32s(f, &v->l.lower); + return 0; +} + +static void put_cpudouble(QEMUFile *f, void *pv, size_t size) +{ + CPU_DoubleU *v = pv; + qemu_put_be32s(f, &v->l.upper); + qemu_put_be32s(f, &v->l.lower); +} + +const VMStateInfo vmstate_info_cpudouble = { + .name = "CPU_Double_U", + .get = get_cpudouble, + .put = put_cpudouble, +}; + /* timers */ static int get_timer(QEMUFile *f, void *pv, size_t size) diff --git a/vmstate.h b/vmstate.h index d3fb88c..5c56f25 100644 --- a/vmstate.h +++ b/vmstate.h @@ -132,6 +132,7 @@ extern const VMStateInfo vmstate_info_uint64; extern const VMStateInfo vmstate_info_float32; extern const VMStateInfo vmstate_info_float64; +extern const VMStateInfo vmstate_info_cpudouble; extern const VMStateInfo vmstate_info_timer; extern const VMStateInfo vmstate_info_buffer; @@ -568,6 +569,9 @@ extern const VMStateDescription vmstate_cpu; #define VMSTATE_FLOAT64_ARRAY(_f, _s, _n) \ VMSTATE_ARRAY(_f, _s, _n, 0, vmstate_info_float64, float64) +#define VMSTATE_CPUDOUBLE_ARRAY(_f, _s, _n) \ + VMSTATE_ARRAY(_f, _s, _n, 0, vmstate_info_cpudouble, CPU_DoubleU) + #define VMSTATE_BUFFER_V(_f, _s, _v) \ VMSTATE_STATIC_BUFFER(_f, _s, _v, NULL, 0, sizeof(typeof_field(_s, _f))) -- 1.7.7.6