X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_checkpoint.h;h=17beb5811247b9521d357aa72c4649eb5f2610a2;hb=06ad2088c1bf59d4d6d11986d4de2195e64baaac;hp=d62d98fbe8589dbd00c0523a9214a1fc839be6fe;hpb=a9a6c3664c8fdbdb9841a55d1a2fca7f4fa8f5de;p=palacios.git diff --git a/palacios/include/palacios/vmm_checkpoint.h b/palacios/include/palacios/vmm_checkpoint.h index d62d98f..17beb58 100644 --- a/palacios/include/palacios/vmm_checkpoint.h +++ b/palacios/include/palacios/vmm_checkpoint.h @@ -23,7 +23,7 @@ #ifdef __V3VEE__ #include -#include + struct v3_chkpt; @@ -34,12 +34,43 @@ struct v3_chkpt_ctx { void * store_ctx; }; +/* Temporary */ +#define V3_CHKPT_STD_SAVE(ctx,x) v3_chkpt_save(ctx,#x,sizeof(x),&(x)) +#define V3_CHKPT_STD_LOAD(ctx,x) v3_chkpt_load(ctx,#x,sizeof(x),&(x)) int v3_chkpt_save(struct v3_chkpt_ctx * ctx, char * tag, uint64_t len, void * buf); int v3_chkpt_load(struct v3_chkpt_ctx * ctx, char * tag, uint64_t len, void * buf); +static inline int v3_chkpt_save_64(struct v3_chkpt_ctx * ctx, char * tag, void * buf) { + return v3_chkpt_save(ctx, tag, 8, buf); +} +static inline int v3_chkpt_save_32(struct v3_chkpt_ctx * ctx, char * tag, void * buf) { + return v3_chkpt_save(ctx, tag, 4, buf); +} +static inline int v3_chkpt_save_16(struct v3_chkpt_ctx * ctx, char * tag, void * buf) { + return v3_chkpt_save(ctx, tag, 2, buf); +} +static inline int v3_chkpt_save_8(struct v3_chkpt_ctx * ctx, char * tag, void * buf) { + return v3_chkpt_save(ctx, tag, 1, buf); +} + +static inline int v3_chkpt_load_64(struct v3_chkpt_ctx * ctx, char * tag, void * buf) { + return v3_chkpt_load(ctx, tag, 8, buf); +} +static inline int v3_chkpt_load_32(struct v3_chkpt_ctx * ctx, char * tag, void * buf) { + return v3_chkpt_load(ctx, tag, 4, buf); +} +static inline int v3_chkpt_load_16(struct v3_chkpt_ctx * ctx, char * tag, void * buf) { + return v3_chkpt_load(ctx, tag, 2, buf); +} +static inline int v3_chkpt_load_8(struct v3_chkpt_ctx * ctx, char * tag, void * buf) { + return v3_chkpt_load(ctx, tag, 1, buf); +} + + + int v3_chkpt_close_ctx(struct v3_chkpt_ctx * ctx); struct v3_chkpt_ctx * v3_chkpt_open_ctx(struct v3_chkpt * chkpt, struct v3_chkpt_ctx * parent, char * name);