#ifdef __XEN__
# define DECLARE_HVM_SAVE_TYPE_COMPAT(_x, _code, _type, _ctype, _fix) \
- static inline int __HVM_SAVE_FIX_COMPAT_##_x(void *h) { return _fix(h); } \
- struct __HVM_SAVE_TYPE_##_x { _type t; char c[_code]; char cpt[2];}; \
+ static inline int __HVM_SAVE_FIX_COMPAT_##_x(void *h, uint32_t size) \
+ { return _fix(h, size); } \
+ struct __HVM_SAVE_TYPE_##_x { _type t; char c[_code]; char cpt[2];}; \
struct __HVM_SAVE_TYPE_COMPAT_##_x { _ctype t; }
# include <xen/lib.h> /* BUG() */
# define DECLARE_HVM_SAVE_TYPE(_x, _code, _type) \
- static inline int __HVM_SAVE_FIX_COMPAT_##_x(void *h) { BUG(); return -1; } \
+ static inline int __HVM_SAVE_FIX_COMPAT_##_x(void *h, uint32_t size) \
+ { BUG(); return -1; } \
struct __HVM_SAVE_TYPE_##_x { _type t; char c[_code]; char cpt[1];}; \
struct __HVM_SAVE_TYPE_COMPAT_##_x { _type t; }
#else
# define HVM_SAVE_LENGTH_COMPAT(_x) (sizeof (HVM_SAVE_TYPE_COMPAT(_x)))
# define HVM_SAVE_HAS_COMPAT(_x) (sizeof (((struct __HVM_SAVE_TYPE_##_x *)(0))->cpt)-1)
-# define HVM_SAVE_FIX_COMPAT(_x, _dst) __HVM_SAVE_FIX_COMPAT_##_x(_dst)
+# define HVM_SAVE_FIX_COMPAT(_x, _dst, _size) __HVM_SAVE_FIX_COMPAT_##_x(_dst, _size)
#endif
/*
*/
#define _hvm_load_entry(_x, _h, _dst, _strict) ({ \
int r; \
+ struct hvm_save_descriptor *desc \
+ = (struct hvm_save_descriptor *)&(_h)->data[(_h)->cur]; \
if ( (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x), \
HVM_SAVE_LENGTH(_x), (_strict))) == 0 ) \
_hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH(_x)); \
&& (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x), \
HVM_SAVE_LENGTH_COMPAT(_x), (_strict))) == 0 ) { \
_hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH_COMPAT(_x)); \
- r=HVM_SAVE_FIX_COMPAT(_x, (_dst)); \
+ r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length); \
} \
r; })