aboutsummaryrefslogtreecommitdiff
path: root/hw/hw.h
diff options
context:
space:
mode:
authorGlauber Costa <glommer@redhat.com>2009-10-16 15:27:37 -0400
committerMarcelo Tosatti <mtosatti@redhat.com>2009-10-19 17:44:14 -0200
commite4d6d49061b45e7134437cdd5bae2d443eedc3bc (patch)
tree437aabda6ec50dadae4cc632b2c2bf0d1c233dcd /hw/hw.h
parentfix monitor.c build breakage (diff)
downloadqemu-kvm-e4d6d49061b45e7134437cdd5bae2d443eedc3bc.tar.gz
qemu-kvm-e4d6d49061b45e7134437cdd5bae2d443eedc3bc.tar.bz2
qemu-kvm-e4d6d49061b45e7134437cdd5bae2d443eedc3bc.zip
introduce VMSTATE_U64
This is a patch actually written by Juan, which, according to him, he plans on posting to qemu.git. Problem is that linux defines u64 in a way that is type-uncompatible with uint64_t. I am including it here, because it is a dependency to my patch series that follows. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'hw/hw.h')
-rw-r--r--hw/hw.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/hw.h b/hw/hw.h
index 8c223f846..348bf1d0a 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -330,6 +330,10 @@ extern const VMStateInfo vmstate_info_uint16;
extern const VMStateInfo vmstate_info_uint32;
extern const VMStateInfo vmstate_info_uint64;
+#ifdef __linux__
+extern const VMStateInfo vmstate_info_u64;
+#endif
+
extern const VMStateInfo vmstate_info_timer;
extern const VMStateInfo vmstate_info_ptimer;
extern const VMStateInfo vmstate_info_buffer;
@@ -538,6 +542,15 @@ extern const VMStateDescription vmstate_i2c_slave;
#define VMSTATE_UINT64(_f, _s) \
VMSTATE_UINT64_V(_f, _s, 0)
+/* This is needed because on linux __u64 is unsigned long long
+ and on glibc uint64_t is unsigned long on 64 bits */
+#ifdef __linux__
+#define VMSTATE_U64_V(_f, _s, _v) \
+ VMSTATE_SINGLE(_f, _s, _v, vmstate_info_u64, __u64)
+#define VMSTATE_U64(_f, _s) \
+ VMSTATE_U64_V(_f, _s, 0)
+#endif
+
#define VMSTATE_UINT8_EQUAL(_f, _s) \
VMSTATE_SINGLE(_f, _s, 0, vmstate_info_uint8_equal, uint8_t)