From 3ba4fd12c6ff5269a2e727c5f84aa7a18b8fa4a3 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Thu, 6 Mar 2008 11:10:59 +0000 Subject: [PATCH] xen x86_64: Add 64 bit version of privcmd_hypercall() Signed-off-by: Mark McLoughlin --- include/asm-x86/xen/hypercall.h | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/include/asm-x86/xen/hypercall.h b/include/asm-x86/xen/hypercall.h index cd554ca..b0c518c 100644 --- a/include/asm-x86/xen/hypercall.h +++ b/include/asm-x86/xen/hypercall.h @@ -412,6 +412,7 @@ MULTI_stack_switch(struct multicall_entry *mcl, #include +#ifdef CONFIG_X86_32 static inline int privcmd_hypercall(privcmd_hypercall_t *hypercall) { int ret; @@ -437,5 +438,32 @@ static inline int privcmd_hypercall(privcmd_hypercall_t *hypercall) return ret; } +#else /* CONFIG_X86_32 */ +static inline int privcmd_hypercall(privcmd_hypercall_t *hypercall) +{ + int ret; + long ign1, ign2, ign3; + + if (hypercall->op >= (PAGE_SIZE >> 5)) + return -EINVAL; + + __asm__ __volatile__ ( + "movq %8,%%r10; movq %9,%%r8;" + "shll $5,%%eax ;" + "addq $hypercall_page,%%rax ;" + "call *%%rax" + : "=a" (ret), "=D" (ign1), + "=S" (ign2), "=d" (ign3) + : "0" ((unsigned int)hypercall->op), + "1" (hypercall->arg[0]), + "2" (hypercall->arg[1]), + "3" (hypercall->arg[2]), + "g" (hypercall->arg[3]), + "g" (hypercall->arg[4]) + : "r8", "r10", "memory" ); + + return ret; +} +#endif /* CONFIG_X86_32 */ #endif /* __HYPERCALL_H__ */ -- 1.5.4.1