Patchwork [4/6] savevm: Add VMSTATE_ helpers for target_phys_addr_t

login
register
mail settings
Submitter David Gibson
Date Sept. 26, 2012, 3:21 a.m.
Message ID <1348629678-13182-5-git-send-email-david@gibson.dropbear.id.au>
Download mbox | patch
Permalink /patch/186943/
State New
Headers show

Comments

David Gibson - Sept. 26, 2012, 3:21 a.m.
The savevm code contains VMSTATE_ helpers for a number of commonly used
types, but not for target_phys_addr_t.  This patch fixes that deficiency
implementing VMSTATE_TPA helpers in terms of VMSTATE_UINT32 or
VMSTATE_UINT64 helpers as appropriate.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 targphys.h |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Patch

diff --git a/targphys.h b/targphys.h
index bd4938f..39c1c63 100644
--- a/targphys.h
+++ b/targphys.h
@@ -21,6 +21,13 @@  typedef uint32_t target_phys_addr_t;
 #define TARGET_PRIuPHYS PRIu32
 #define TARGET_PRIxPHYS PRIx32
 #define TARGET_PRIXPHYS PRIX32
+
+#define VMSTATE_TPA_V(_f, _s, _v) \
+    VMSTATE_UINT32_V(_f, _s, _v)
+
+#define VMSTATE_TPA_EQUAL_V(_f, _s, _v) \
+    VMSTATE_UINT32_EQUAL_V(_f, _s, _v)
+
 #elif TARGET_PHYS_ADDR_BITS == 64
 typedef uint64_t target_phys_addr_t;
 #define TARGET_PHYS_ADDR_MAX UINT64_MAX
@@ -31,7 +38,19 @@  typedef uint64_t target_phys_addr_t;
 #define TARGET_PRIuPHYS PRIu64
 #define TARGET_PRIxPHYS PRIx64
 #define TARGET_PRIXPHYS PRIX64
+
+#define VMSTATE_TPA_V(_f, _s, _v) \
+    VMSTATE_UINT64_V(_f, _s, _v)
+
+#define VMSTATE_TPA_EQUAL_V(_f, _s, _v) \
+    VMSTATE_UINT64_EQUAL_V(_f, _s, _v)
+
 #endif
 #endif
 
+#define VMSTATE_TPA(_f, _s) \
+    VMSTATE_TPA_V(_f, _s, 0)
+#define VMSTATE_TPA_EQUAL(_f, _s) \
+    VMSTATE_TPA_EQUAL_V(_f, _s, 0)
+
 #endif