From: Andrew Cooper Date: Mon, 26 Jan 2015 11:10:02 +0000 (+0000) Subject: x86/hypercall: Move some of the hvm hypercall infrastructure into hypercall.h X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~461 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=939ba61bd376955ae3a519c09364346aed2be070;p=xen.git x86/hypercall: Move some of the hvm hypercall infrastructure into hypercall.h It will be reused for PV hypercalls in subsequent changes. * Rename hvm_hypercall_t to hypercall_fn_t * Introduce hypercall_table_t Finally, rework the #includes for hypercall.h so it may be included in isolation. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 58a40b6416..9002e3c977 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -4117,17 +4117,13 @@ static long hvm_physdev_op_compat32( } } -typedef unsigned long hvm_hypercall_t( - unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, - unsigned long); - #define HYPERCALL(x) \ - [ __HYPERVISOR_ ## x ] = { (hvm_hypercall_t *) do_ ## x, \ - (hvm_hypercall_t *) do_ ## x } + [ __HYPERVISOR_ ## x ] = { (hypercall_fn_t *) do_ ## x, \ + (hypercall_fn_t *) do_ ## x } #define COMPAT_CALL(x) \ - [ __HYPERVISOR_ ## x ] = { (hvm_hypercall_t *) do_ ## x, \ - (hvm_hypercall_t *) compat_ ## x } + [ __HYPERVISOR_ ## x ] = { (hypercall_fn_t *) do_ ## x, \ + (hypercall_fn_t *) compat_ ## x } #define do_memory_op hvm_memory_op #define compat_memory_op hvm_memory_op_compat32 @@ -4137,10 +4133,7 @@ typedef unsigned long hvm_hypercall_t( #define compat_grant_table_op hvm_grant_table_op_compat32 #define do_arch_1 paging_domctl_continuation -static const struct { - hvm_hypercall_t *native; - hvm_hypercall_t *compat; -} hvm_hypercall_table[NR_hypercalls] = { +static const hypercall_table_t hvm_hypercall_table[NR_hypercalls] = { COMPAT_CALL(memory_op), COMPAT_CALL(grant_table_op), COMPAT_CALL(vcpu_op), @@ -4172,8 +4165,6 @@ static const struct { #undef HYPERCALL #undef COMPAT_CALL -extern const uint8_t hypercall_args_table[], compat_hypercall_args_table[]; - int hvm_do_hypercall(struct cpu_user_regs *regs) { struct vcpu *curr = current; diff --git a/xen/include/asm-x86/hypercall.h b/xen/include/asm-x86/hypercall.h index 945d58ad47..731f3a8156 100644 --- a/xen/include/asm-x86/hypercall.h +++ b/xen/include/asm-x86/hypercall.h @@ -5,9 +5,21 @@ #ifndef __ASM_X86_HYPERCALL_H__ #define __ASM_X86_HYPERCALL_H__ +#include #include +#include #include /* for do_mca */ -#include + +typedef unsigned long hypercall_fn_t( + unsigned long, unsigned long, unsigned long, + unsigned long, unsigned long, unsigned long); + +typedef struct { + hypercall_fn_t *native, *compat; +} hypercall_table_t; + +extern const uint8_t hypercall_args_table[NR_hypercalls], + compat_hypercall_args_table[NR_hypercalls]; /* * Both do_mmuext_op() and do_mmu_update():