diff -r c8962b24fb50 xen/include/public/xen.h --- a/xen/include/public/xen.h Fri Jan 30 11:12:57 2009 +0900 +++ b/xen/include/public/xen.h Thu Feb 05 13:58:35 2009 -0700 @@ -91,6 +91,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t); #define __HYPERVISOR_sysctl 35 #define __HYPERVISOR_domctl 36 #define __HYPERVISOR_kexec_op 37 +#define __HYPERVISOR_tmem_op 38 /* Architecture-specific hypercall definitions. */ #define __HYPERVISOR_arch_0 48 @@ -324,6 +325,73 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t); #define VMASST_TYPE_pae_extended_cr3 3 #define MAX_VMASST_TYPE 3 + +/* + * Commands to HYPERVISOR_tmem_op(). + */ +#define TMEM_CONTROL 0 +#define TMEM_NEW_POOL 1 +#define TMEM_DESTROY_POOL 2 +#define TMEM_NEW_PAGE 3 +#define TMEM_PUT_PAGE 4 +#define TMEM_GET_PAGE 5 +#define TMEM_FLUSH_PAGE 6 +#define TMEM_FLUSH_OBJECT 7 +#define TMEM_READ 8 +#define TMEM_WRITE 9 +#define TMEM_XCHG 10 + +#define TMEMC_THAW 0 +#define TMEMC_FREEZE 1 +#define TMEMC_DESTROY 2 +#define TMEMC_LIST 3 +#define TMEMC_SET_WEIGHT 4 +#define TMEMC_SET_CAP 5 +#define TMEMC_SET_COMPRESS 6 + +#define TMEM_POOL_PERSIST 1 +#define TMEM_POOL_SHARED 2 + +#define EFROZEN 1000 + +#define TMEM_POOL_PAGESIZE_SHIFT 4 +#define TMEM_POOL_PAGESIZE_MASK 0xf +#define TMEM_POOL_VERSION_SHIFT 24 +#define TMEM_POOL_VERSION_MASK 0xff + +#ifndef __ASSEMBLY__ +typedef XEN_GUEST_HANDLE(void) tmem_cli_mfn_t; +typedef XEN_GUEST_HANDLE(char) tmem_cli_va_t; +struct tmem_op { + uint32_t cmd; + int32_t pool_id; /* private > 0; shared < 0; 0 is invalid */ + union { + struct { /* for cmd == TMEM_NEW_POOL */ + uint64_t uuid[2]; + uint32_t flags; + }; + struct { /* for cmd == TMEM_CONTROL */ + uint32_t subop; + uint32_t cli_id; + uint32_t arg1; + uint32_t arg2; + tmem_cli_va_t buf; + }; + struct { + uint64_t object; + uint32_t index; + uint32_t tmem_offset; + uint32_t pfn_offset; + uint32_t len; + tmem_cli_mfn_t cmfn; /* client machine page frame */ + }; + }; +}; +typedef struct tmem_op tmem_op_t; +DEFINE_XEN_GUEST_HANDLE(tmem_op_t); +typedef XEN_GUEST_HANDLE(tmem_op_t) tmem_cli_op_t; + +#endif #ifndef __ASSEMBLY__