ia64/xen-unstable

changeset 9812:93cffd2ea6a9

Use set_callbacks hypercall if callback_op is not available.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian.Campbell@xensource.com
date Fri Apr 21 17:18:53 2006 +0100 (2006-04-21)
parents 65894fff3649
children 3bac94fc4075
files linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h	Fri Apr 21 14:03:07 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h	Fri Apr 21 17:18:53 2006 +0100
     1.3 @@ -24,6 +24,7 @@ extern void nmi(void);
     1.4  
     1.5  static void __init machine_specific_arch_setup(void)
     1.6  {
     1.7 +	int ret;
     1.8  	struct xen_platform_parameters pp;
     1.9  	struct callback_register event = {
    1.10  		.type = CALLBACKTYPE_event,
    1.11 @@ -42,8 +43,14 @@ static void __init machine_specific_arch
    1.12  		memset(empty_zero_page, 0, sizeof(empty_zero_page));
    1.13  	}
    1.14  
    1.15 -	HYPERVISOR_callback_op(CALLBACKOP_register, &event);
    1.16 -	HYPERVISOR_callback_op(CALLBACKOP_register, &failsafe);
    1.17 +	ret = HYPERVISOR_callback_op(CALLBACKOP_register, &event);
    1.18 +	if (ret == 0)
    1.19 +		ret = HYPERVISOR_callback_op(CALLBACKOP_register, &failsafe);
    1.20 +	if (ret == -ENOSYS)
    1.21 +		ret = HYPERVISOR_set_callbacks(
    1.22 +			event.address.cs, event.address.eip,
    1.23 +			failsafe.address.cs, failsafe.address.eip);
    1.24 +	BUG_ON(ret);
    1.25  
    1.26  	cb.handler_address = (unsigned long)&nmi;
    1.27  	HYPERVISOR_nmi_op(XENNMI_register_callback, &cb);
     2.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h	Fri Apr 21 14:03:07 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h	Fri Apr 21 17:18:53 2006 +0100
     2.3 @@ -14,6 +14,7 @@ extern void nmi(void);
     2.4  
     2.5  static void __init machine_specific_arch_setup(void)
     2.6  {
     2.7 +	int ret;
     2.8  	struct callback_register event = {
     2.9  		.type = CALLBACKTYPE_event,
    2.10  		.address = (unsigned long) hypervisor_callback,
    2.11 @@ -30,9 +31,17 @@ static void __init machine_specific_arch
    2.12  	struct xennmi_callback cb;
    2.13  #endif
    2.14  
    2.15 -	HYPERVISOR_callback_op(CALLBACKOP_register, &event);
    2.16 -	HYPERVISOR_callback_op(CALLBACKOP_register, &failsafe);
    2.17 -	HYPERVISOR_callback_op(CALLBACKOP_register, &syscall);
    2.18 +	ret = HYPERVISOR_callback_op(CALLBACKOP_register, &event);
    2.19 +	if (ret == 0)
    2.20 +		ret = HYPERVISOR_callback_op(CALLBACKOP_register, &failsafe);
    2.21 +	if (ret == 0)
    2.22 +		ret = HYPERVISOR_callback_op(CALLBACKOP_register, &syscall);
    2.23 +	if (ret == -ENOSYS)
    2.24 +		ret = HYPERVISOR_set_callbacks(
    2.25 +			event.address,
    2.26 +			failsafe.address,
    2.27 +			syscall.address);
    2.28 +	BUG_ON(ret);
    2.29  
    2.30  #ifdef CONFIG_X86_LOCAL_APIC
    2.31  	cb.handler_address = (unsigned long)&nmi;