From 7e0b680f00bb4bc93cd89f234bb7d5b71592372a Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Wed, 26 Dec 2007 15:51:34 -0200 Subject: [PATCH] Implement 64-bit version of HYPERVISOR_set_callbacks() (IFDEF?) HYPERVISOR_set_callbacks() interface is different on x86_64. (More #ifdef abuse). Signed-off-by: Eduardo Habkost --- arch/x86/xen/setup.c | 6 ++++++ include/asm-x86/xen/hypercall.h | 12 ++++++++++++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index 2216e44..99b7463 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -94,8 +94,14 @@ void __init xen_arch_setup(void) if (!xen_feature(XENFEAT_auto_translated_physmap)) HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_pae_extended_cr3); +#ifdef CONFIG_X86_32 HYPERVISOR_set_callbacks(__KERNEL_CS, (unsigned long)xen_hypervisor_callback, __KERNEL_CS, (unsigned long)xen_failsafe_callback); +#else + HYPERVISOR_set_callbacks((unsigned long)xen_hypervisor_callback, + (unsigned long)xen_failsafe_callback, + (unsigned long)system_call); +#endif set_iopl.iopl = 1; rc = HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl); diff --git a/include/asm-x86/xen/hypercall.h b/include/asm-x86/xen/hypercall.h index 605775e..0588d6d 100644 --- a/include/asm-x86/xen/hypercall.h +++ b/include/asm-x86/xen/hypercall.h @@ -226,6 +226,7 @@ HYPERVISOR_stack_switch(unsigned long ss, unsigned long esp) return _hypercall2(int, stack_switch, ss, esp); } +#ifdef CONFIG_X86_32 static inline int HYPERVISOR_set_callbacks(unsigned long event_selector, unsigned long event_address, @@ -236,6 +237,17 @@ HYPERVISOR_set_callbacks(unsigned long event_selector, event_selector, event_address, failsafe_selector, failsafe_address); } +#else /* CONFIG_X86_64 */ +static inline int +HYPERVISOR_set_callbacks(unsigned long event_address, + unsigned long failsafe_address, + unsigned long syscall_address) +{ + return _hypercall3(int, set_callbacks, + event_address, failsafe_address, + syscall_address); +} +#endif /* CONFIG_X86_{32,64} */ static inline int HYPERVISOR_fpu_taskswitch(int set) -- 1.5.4.1