[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2 1/9] 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 <andrew.cooper3@xxxxxxxxxx> Acked-by: Jan Beulich <JBeulich@xxxxxxxx> --- xen/arch/x86/hvm/hvm.c | 19 +++++-------------- xen/include/asm-x86/hypercall.h | 14 +++++++++++++- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 58a40b6..9002e3c 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 945d58a..731f3a8 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 <xen/types.h> #include <public/physdev.h> +#include <public/event_channel.h> #include <public/arch-x86/xen-mca.h> /* for do_mca */ -#include <xen/types.h> + +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(): -- 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |