aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xg_save_restore.h
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-12-01 13:53:14 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-12-01 13:53:14 +0000
commit60999322eb87ccd91f5208bdd684f1762d664c2e (patch)
tree6b08eb3020ecc7c0fc4828cfff3229154ffaa9b8 /tools/libxc/xg_save_restore.h
parentd47a8e863a56c4e2db18198ebfe21100be086b77 (diff)
downloadxen-60999322eb87ccd91f5208bdd684f1762d664c2e.tar.gz
xen-60999322eb87ccd91f5208bdd684f1762d664c2e.tar.bz2
xen-60999322eb87ccd91f5208bdd684f1762d664c2e.zip
libxc: create a domain_info_context structure to store guest_width and p2m_size for macros.
Macro now refers to guest_width and p2m_size through a dinfo pointer. Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xg_save_restore.h')
-rw-r--r--tools/libxc/xg_save_restore.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/libxc/xg_save_restore.h b/tools/libxc/xg_save_restore.h
index 5d39982c00..9c2b67a7b8 100644
--- a/tools/libxc/xg_save_restore.h
+++ b/tools/libxc/xg_save_restore.h
@@ -112,34 +112,34 @@ static inline int get_platform_info(int xc_handle, uint32_t dom,
#define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL))
-#define GET_FIELD(_p, _f) ((guest_width==8) ? ((_p)->x64._f) : ((_p)->x32._f))
+#define GET_FIELD(_p, _f) ((dinfo->guest_width==8) ? ((_p)->x64._f) : ((_p)->x32._f))
#define SET_FIELD(_p, _f, _v) do { \
- if (guest_width == 8) \
+ if (dinfo->guest_width == 8) \
(_p)->x64._f = (_v); \
else \
(_p)->x32._f = (_v); \
} while (0)
#define UNFOLD_CR3(_c) \
- ((uint64_t)((guest_width == 8) \
+ ((uint64_t)((dinfo->guest_width == 8) \
? ((_c) >> 12) \
: (((uint32_t)(_c) >> 12) | ((uint32_t)(_c) << 20))))
#define FOLD_CR3(_c) \
- ((uint64_t)((guest_width == 8) \
+ ((uint64_t)((dinfo->guest_width == 8) \
? ((uint64_t)(_c)) << 12 \
: (((uint32_t)(_c) << 12) | ((uint32_t)(_c) >> 20))))
#define MEMCPY_FIELD(_d, _s, _f) do { \
- if (guest_width == 8) \
+ if (dinfo->guest_width == 8) \
memcpy(&(_d)->x64._f, &(_s)->x64._f,sizeof((_d)->x64._f)); \
else \
memcpy(&(_d)->x32._f, &(_s)->x32._f,sizeof((_d)->x32._f)); \
} while (0)
#define MEMSET_ARRAY_FIELD(_p, _f, _v) do { \
- if (guest_width == 8) \
+ if (dinfo->guest_width == 8) \
memset(&(_p)->x64._f[0], (_v), sizeof((_p)->x64._f)); \
else \
memset(&(_p)->x32._f[0], (_v), sizeof((_p)->x32._f)); \