DECLARE_HYPERCALL(domctl)
DECLARE_HYPERCALL(kexec_op)
DECLARE_HYPERCALL(tmem_op)
-DECLARE_HYPERCALL(xc_reserved_op)
+DECLARE_HYPERCALL(argo_op)
DECLARE_HYPERCALL(xenpmu_op)
DECLARE_HYPERCALL(arch_0)
* Inputs: %ebx, %ecx, %edx, %esi, %edi, %ebp (arguments 1-6)
*/
+#define _hypercall32_0(type, hcall) \
+ ({ \
+ long res; \
+ asm volatile ( \
+ "call hypercall_page + %c[offset]" \
+ : "=a" (res) \
+ : [offset] "i" (hcall * 32) \
+ : "memory" ); \
+ (type)res; \
+ })
+
#define _hypercall32_1(type, hcall, a1) \
({ \
long res, _a1 = (long)(a1); \
(type)res; \
})
+#define _hypercall32_5(type, hcall, a1, a2, a3, a4, a5) \
+ ({ \
+ long res, _a1 = (long)(a1), _a2 = (long)(a2), _a3 = (long)(a3), \
+ _a4 = (long)(a4), _a5 = (long)(a5); \
+ asm volatile ( \
+ "call hypercall_page + %c[offset]" \
+ : "=a" (res), "+b" (_a1), "+c" (_a2), "+d" (_a3), \
+ "+S" (_a4), "+D" (_a5) \
+ : [offset] "i" (hcall * 32) \
+ : "memory" ); \
+ (type)res; \
+ })
+
#endif /* XTF_X86_32_HYPERCALL_H */
/*
* Inputs: %rdi, %rsi, %rdx, %r10, %r8, %r9 (arguments 1-6)
*/
+#define _hypercall64_0(type, hcall) \
+ ({ \
+ long res; \
+ asm volatile ( \
+ "call hypercall_page + %c[offset]" \
+ : "=a" (res) \
+ : [offset] "i" (hcall * 32) \
+ : "memory" ); \
+ (type)res; \
+ })
+
#define _hypercall64_1(type, hcall, a1) \
({ \
long res, _a1 = (long)(a1); \
(type)res; \
})
+#define _hypercall64_5(type, hcall, a1, a2, a3, a4, a5) \
+ ({ \
+ long res, _a1 = (long)(a1), _a2 = (long)(a2), _a3 = (long)(a3); \
+ register long _a4 asm ("r10") = (long)(a4); \
+ register long _a5 asm ("r8") = (long)(a5); \
+ asm volatile ( \
+ "call hypercall_page + %c[offset]" \
+ : "=a" (res), "+D" (_a1), "+S" (_a2), "+d" (_a3), \
+ "+r" (_a4), "+r" (_a5) \
+ : [offset] "i" (hcall * 32) \
+ : "memory" ); \
+ (type)res; \
+ })
+
#endif /* XTF_X86_64_HYPERCALL_H */
/*
#define __HYPERVISOR_domctl 36
#define __HYPERVISOR_kexec_op 37
#define __HYPERVISOR_tmem_op 38
-#define __HYPERVISOR_xc_reserved_op 39 /* reserved for XenClient */
+#define __HYPERVISOR_argo_op 39
#define __HYPERVISOR_xenpmu_op 40
/* Architecture-specific hypercall definitions. */
#if defined(__x86_64__)
# include <arch/hypercall-x86_64.h>
+# define HYPERCALL0 _hypercall64_0
# define HYPERCALL1 _hypercall64_1
# define HYPERCALL2 _hypercall64_2
# define HYPERCALL3 _hypercall64_3
# define HYPERCALL4 _hypercall64_4
+# define HYPERCALL5 _hypercall64_5
#elif defined(__i386__)
# include <arch/hypercall-x86_32.h>
+# define HYPERCALL0 _hypercall32_0
# define HYPERCALL1 _hypercall32_1
# define HYPERCALL2 _hypercall32_2
# define HYPERCALL3 _hypercall32_3
# define HYPERCALL4 _hypercall32_4
+# define HYPERCALL5 _hypercall32_5
#else
# error Bad architecture for hypercalls
return HYPERCALL1(long, __HYPERVISOR_sysctl, arg);
}
+static inline long hypercall_argo_op(unsigned int cmd, void *arg1, void *arg2,
+ unsigned long arg3, unsigned long arg4)
+{
+ return HYPERCALL5(long, __HYPERVISOR_argo_op, cmd, arg1, arg2, arg3, arg4);
+}
+
/*
* Higher level hypercall helpers
*/