ia64/xen-unstable

changeset 9547:8a8361994904

Merged.
author emellor@leeni.uk.xensource.com
date Fri Mar 31 00:26:07 2006 +0100 (2006-03-31)
parents 24aa3bd826ff 9316fe0c9c4f
children 4943372c14f6
files
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/Makefile	Fri Mar 31 00:24:54 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/Makefile	Fri Mar 31 00:26:07 2006 +0100
     1.3 @@ -45,6 +45,11 @@ CFLAGS				+= $(shell if [ $(call cc-vers
     1.4  
     1.5  CFLAGS += $(cflags-y)
     1.6  
     1.7 +cppflags-$(CONFIG_XEN) += \
     1.8 +	-D__XEN_INTERFACE_VERSION__=$(CONFIG_XEN_INTERFACE_VERSION)
     1.9 +
    1.10 +CPPFLAGS += $(cppflags-y)
    1.11 +
    1.12  # Default subarch .c files
    1.13  mcore-y  := mach-default
    1.14  
    1.15 @@ -107,7 +112,7 @@ boot := arch/i386/boot
    1.16  	zdisk bzdisk fdimage fdimage144 fdimage288 install
    1.17  
    1.18  ifdef CONFIG_XEN
    1.19 -CPPFLAGS        := -D__KERNEL__ -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(LINUXINCLUDE)
    1.20 +CPPFLAGS := -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(CPPFLAGS)
    1.21  head-y := arch/i386/kernel/head-xen.o arch/i386/kernel/init_task-xen.o
    1.22  boot := arch/i386/boot-xen
    1.23  .PHONY: vmlinuz
     2.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c	Fri Mar 31 00:24:54 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c	Fri Mar 31 00:26:07 2006 +0100
     2.3 @@ -114,7 +114,7 @@ void xen_idle(void)
     2.4  		smp_mb__after_clear_bit();
     2.5  		stop_hz_timer();
     2.6  		/* Blocking includes an implicit local_irq_enable(). */
     2.7 -		HYPERVISOR_sched_op(SCHEDOP_block, 0);
     2.8 +		HYPERVISOR_block();
     2.9  		start_hz_timer();
    2.10  		set_thread_flag(TIF_POLLING_NRFLAG);
    2.11  	}
     3.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c	Fri Mar 31 00:24:54 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c	Fri Mar 31 00:26:07 2006 +0100
     3.3 @@ -1877,7 +1877,7 @@ void __init setup_arch(char **cmdline_p)
     3.4  static int
     3.5  xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
     3.6  {
     3.7 -	HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_crash);
     3.8 +	HYPERVISOR_shutdown(SHUTDOWN_crash);
     3.9  	/* we're never actually going to get here... */
    3.10  	return NOTIFY_DONE;
    3.11  }
     4.1 --- a/linux-2.6-xen-sparse/arch/ia64/Makefile	Fri Mar 31 00:24:54 2006 +0100
     4.2 +++ b/linux-2.6-xen-sparse/arch/ia64/Makefile	Fri Mar 31 00:26:07 2006 +0100
     4.3 @@ -42,6 +42,12 @@ ifeq ($(call cc-version),0304)
     4.4  endif
     4.5  
     4.6  CFLAGS += $(cflags-y)
     4.7 +
     4.8 +cppflags-$(CONFIG_XEN) += \
     4.9 +	-D__XEN_INTERFACE_VERSION__=$(CONFIG_XEN_INTERFACE_VERSION)
    4.10 +
    4.11 +CPPFLAGS += $(cppflags-y)
    4.12 +
    4.13  head-y := arch/ia64/kernel/head.o arch/ia64/kernel/init_task.o
    4.14  
    4.15  libs-y				+= arch/ia64/lib/
     5.1 --- a/linux-2.6-xen-sparse/arch/x86_64/Makefile	Fri Mar 31 00:24:54 2006 +0100
     5.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/Makefile	Fri Mar 31 00:26:07 2006 +0100
     5.3 @@ -31,6 +31,10 @@ cflags-$(CONFIG_MK8) += $(call cc-option
     5.4  cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
     5.5  CFLAGS += $(cflags-y)
     5.6  
     5.7 +cppflags-$(CONFIG_XEN) += \
     5.8 +	-D__XEN_INTERFACE_VERSION__=$(CONFIG_XEN_INTERFACE_VERSION)
     5.9 +CPPFLAGS += $(cppflags-y)
    5.10 +
    5.11  CFLAGS += -m64
    5.12  CFLAGS += -mno-red-zone
    5.13  CFLAGS += -mcmodel=kernel
    5.14 @@ -71,7 +75,7 @@ boot := arch/x86_64/boot
    5.15  	fdimage fdimage144 fdimage288 archclean
    5.16  
    5.17  ifdef CONFIG_XEN
    5.18 -CPPFLAGS := -D__KERNEL__ -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(LINUXINCLUDE)
    5.19 +CPPFLAGS := -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(CPPFLAGS)
    5.20  head-y := arch/x86_64/kernel/head-xen.o arch/x86_64/kernel/head64-xen.o arch/x86_64/kernel/init_task.o
    5.21  LDFLAGS_vmlinux := -e _start
    5.22  boot := arch/i386/boot-xen
     6.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c	Fri Mar 31 00:24:54 2006 +0100
     6.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c	Fri Mar 31 00:26:07 2006 +0100
     6.3 @@ -131,7 +131,7 @@ void xen_idle(void)
     6.4  		smp_mb__after_clear_bit();
     6.5  		stop_hz_timer();
     6.6  		/* Blocking includes an implicit local_irq_enable(). */
     6.7 -		HYPERVISOR_sched_op(SCHEDOP_block, 0);
     6.8 +		HYPERVISOR_block();
     6.9  		start_hz_timer();
    6.10  		set_thread_flag(TIF_POLLING_NRFLAG);
    6.11  	}
     7.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c	Fri Mar 31 00:24:54 2006 +0100
     7.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c	Fri Mar 31 00:26:07 2006 +0100
     7.3 @@ -999,7 +999,7 @@ void __init setup_arch(char **cmdline_p)
     7.4  static int
     7.5  xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
     7.6  {
     7.7 -	HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_crash);
     7.8 +	HYPERVISOR_shutdown(SHUTDOWN_crash);
     7.9  	/* we're never actually going to get here... */
    7.10  	return NOTIFY_DONE;
    7.11  }
     8.1 --- a/linux-2.6-xen-sparse/drivers/xen/Kconfig	Fri Mar 31 00:24:54 2006 +0100
     8.2 +++ b/linux-2.6-xen-sparse/drivers/xen/Kconfig	Fri Mar 31 00:26:07 2006 +0100
     8.3 @@ -10,12 +10,11 @@ config XEN
     8.4  	help
     8.5  	  This is the Linux Xen port.
     8.6  
     8.7 -config NO_IDLE_HZ
     8.8 -	bool
     8.9 -	depends on XEN
    8.10 -	default y
    8.11 +if XEN
    8.12 +config XEN_INTERFACE_VERSION
    8.13 +	hex
    8.14 +	default 0x00030101
    8.15  
    8.16 -if XEN
    8.17  menu "XEN"
    8.18  
    8.19  config XEN_PRIVILEGED_GUEST
    8.20 @@ -191,7 +190,6 @@ config XEN_DISABLE_SERIAL
    8.21  
    8.22  config XEN_SYSFS
    8.23  	tristate "Export Xen attributes in sysfs"
    8.24 -	depends on XEN
    8.25  	depends on SYSFS
    8.26  	default y
    8.27  	help
    8.28 @@ -207,4 +205,8 @@ config HAVE_ARCH_DEV_ALLOC_SKB
    8.29  	bool
    8.30  	default y
    8.31  
    8.32 +config NO_IDLE_HZ
    8.33 +	bool
    8.34 +	default y
    8.35 +
    8.36  endif
     9.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/reboot.c	Fri Mar 31 00:24:54 2006 +0100
     9.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/reboot.c	Fri Mar 31 00:26:07 2006 +0100
     9.3 @@ -42,7 +42,7 @@ void machine_emergency_restart(void)
     9.4  {
     9.5  	/* We really want to get pending console data out before we die. */
     9.6  	xencons_force_flush();
     9.7 -	HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_reboot);
     9.8 +	HYPERVISOR_shutdown(SHUTDOWN_reboot);
     9.9  }
    9.10  
    9.11  void machine_restart(char * __unused)
    9.12 @@ -59,7 +59,7 @@ void machine_power_off(void)
    9.13  {
    9.14  	/* We really want to get pending console data out before we die. */
    9.15  	xencons_force_flush();
    9.16 -	HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_poweroff);
    9.17 +	HYPERVISOR_shutdown(SHUTDOWN_poweroff);
    9.18  }
    9.19  
    9.20  int reboot_thru_bios = 0;	/* for dmi_scan.c */
    10.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h	Fri Mar 31 00:24:54 2006 +0100
    10.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h	Fri Mar 31 00:26:07 2006 +0100
    10.3 @@ -33,10 +33,9 @@
    10.4  #ifndef __HYPERCALL_H__
    10.5  #define __HYPERCALL_H__
    10.6  
    10.7 -#include <xen/interface/xen.h>
    10.8 -#include <xen/interface/sched.h>
    10.9 -#include <xen/interface/nmi.h>
   10.10 -#include <linux/errno.h>
   10.11 +#ifndef __HYPERVISOR_H__
   10.12 +# error "please don't include this file directly"
   10.13 +#endif
   10.14  
   10.15  #define __STR(x) #x
   10.16  #define STR(x) __STR(x)
   10.17 @@ -167,35 +166,17 @@ HYPERVISOR_fpu_taskswitch(
   10.18  }
   10.19  
   10.20  static inline int
   10.21 -HYPERVISOR_sched_op(
   10.22 +HYPERVISOR_sched_op_compat(
   10.23  	int cmd, unsigned long arg)
   10.24  {
   10.25 -	return _hypercall2(int, sched_op, cmd, arg);
   10.26 -}
   10.27 -
   10.28 -static inline int
   10.29 -HYPERVISOR_sched_op_new(
   10.30 -	int cmd, void *arg)
   10.31 -{
   10.32 -	return _hypercall2(int, sched_op_new, cmd, arg);
   10.33 +	return _hypercall2(int, sched_op_compat, cmd, arg);
   10.34  }
   10.35  
   10.36  static inline int
   10.37 -HYPERVISOR_poll(
   10.38 -	evtchn_port_t *ports, unsigned int nr_ports, u64 timeout)
   10.39 +HYPERVISOR_sched_op(
   10.40 +	int cmd, void *arg)
   10.41  {
   10.42 -	struct sched_poll sched_poll = {
   10.43 -		.ports = ports,
   10.44 -		.nr_ports = nr_ports,
   10.45 -		.timeout = jiffies_to_st(timeout)
   10.46 -	};
   10.47 -
   10.48 -	int rc = HYPERVISOR_sched_op_new(SCHEDOP_poll, &sched_poll);
   10.49 -
   10.50 -	if (rc == -ENOSYS)
   10.51 -		rc = HYPERVISOR_sched_op(SCHEDOP_yield, 0);
   10.52 -
   10.53 -	return rc;
   10.54 +	return _hypercall2(int, sched_op, cmd, arg);
   10.55  }
   10.56  
   10.57  static inline long
   10.58 @@ -327,8 +308,18 @@ static inline int
   10.59  HYPERVISOR_suspend(
   10.60  	unsigned long srec)
   10.61  {
   10.62 -	return _hypercall3(int, sched_op, SCHEDOP_shutdown,
   10.63 -			   SHUTDOWN_suspend, srec);
   10.64 +	struct sched_shutdown sched_shutdown = {
   10.65 +		.reason = SHUTDOWN_suspend
   10.66 +	};
   10.67 +
   10.68 +	int rc = _hypercall3(int, sched_op, SCHEDOP_shutdown,
   10.69 +			     &sched_shutdown, srec);
   10.70 +
   10.71 +	if (rc == -ENOSYS)
   10.72 +		rc = _hypercall3(int, sched_op_compat, SCHEDOP_shutdown,
   10.73 +				 SHUTDOWN_suspend, srec);
   10.74 +
   10.75 +	return rc;
   10.76  }
   10.77  
   10.78  static inline int
    11.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h	Fri Mar 31 00:24:54 2006 +0100
    11.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h	Fri Mar 31 00:26:07 2006 +0100
    11.3 @@ -37,8 +37,11 @@
    11.4  #include <linux/types.h>
    11.5  #include <linux/kernel.h>
    11.6  #include <linux/version.h>
    11.7 +#include <linux/errno.h>
    11.8  #include <xen/interface/xen.h>
    11.9  #include <xen/interface/dom0_ops.h>
   11.10 +#include <xen/interface/sched.h>
   11.11 +#include <xen/interface/nmi.h>
   11.12  #include <asm/ptrace.h>
   11.13  #include <asm/page.h>
   11.14  #if defined(__i386__)
   11.15 @@ -115,6 +118,64 @@ u64 jiffies_to_st(unsigned long jiffies)
   11.16  
   11.17  #define xen_init()	(0)
   11.18  
   11.19 +static inline int
   11.20 +HYPERVISOR_yield(
   11.21 +	void)
   11.22 +{
   11.23 +	int rc = HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
   11.24 +
   11.25 +	if (rc == -ENOSYS)
   11.26 +		rc = HYPERVISOR_sched_op_compat(SCHEDOP_yield, 0);
   11.27 +
   11.28 +	return rc;
   11.29 +}
   11.30 +
   11.31 +static inline int
   11.32 +HYPERVISOR_block(
   11.33 +	void)
   11.34 +{
   11.35 +	int rc = HYPERVISOR_sched_op(SCHEDOP_block, NULL);
   11.36 +
   11.37 +	if (rc == -ENOSYS)
   11.38 +		rc = HYPERVISOR_sched_op_compat(SCHEDOP_block, 0);
   11.39 +
   11.40 +	return rc;
   11.41 +}
   11.42 +
   11.43 +static inline int
   11.44 +HYPERVISOR_shutdown(
   11.45 +	unsigned int reason)
   11.46 +{
   11.47 +	struct sched_shutdown sched_shutdown = {
   11.48 +		.reason = reason
   11.49 +	};
   11.50 +
   11.51 +	int rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
   11.52 +
   11.53 +	if (rc == -ENOSYS)
   11.54 +		rc = HYPERVISOR_sched_op_compat(SCHEDOP_shutdown, reason);
   11.55 +
   11.56 +	return rc;
   11.57 +}
   11.58 +
   11.59 +static inline int
   11.60 +HYPERVISOR_poll(
   11.61 +	evtchn_port_t *ports, unsigned int nr_ports, u64 timeout)
   11.62 +{
   11.63 +	struct sched_poll sched_poll = {
   11.64 +		.ports = ports,
   11.65 +		.nr_ports = nr_ports,
   11.66 +		.timeout = jiffies_to_st(timeout)
   11.67 +	};
   11.68 +
   11.69 +	int rc = HYPERVISOR_sched_op(SCHEDOP_poll, &sched_poll);
   11.70 +
   11.71 +	if (rc == -ENOSYS)
   11.72 +		rc = HYPERVISOR_sched_op_compat(SCHEDOP_yield, 0);
   11.73 +
   11.74 +	return rc;
   11.75 +}
   11.76 +
   11.77  static inline void
   11.78  MULTI_update_va_mapping(
   11.79      multicall_entry_t *mcl, unsigned long va,
    12.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h	Fri Mar 31 00:24:54 2006 +0100
    12.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h	Fri Mar 31 00:26:07 2006 +0100
    12.3 @@ -33,10 +33,9 @@
    12.4  #ifndef __HYPERCALL_H__
    12.5  #define __HYPERCALL_H__
    12.6  
    12.7 -#include <xen/interface/xen.h>
    12.8 -#include <xen/interface/sched.h>
    12.9 -#include <xen/interface/dom0_ops.h>
   12.10 -#include <linux/errno.h>
   12.11 +#ifndef __HYPERVISOR_H__
   12.12 +# error "please don't include this file directly"
   12.13 +#endif
   12.14  
   12.15  /* FIXME: temp place to hold these page related macros */
   12.16  #include <asm/page.h>
   12.17 @@ -164,35 +163,17 @@
   12.18  })
   12.19  
   12.20  static inline int
   12.21 -HYPERVISOR_sched_op(
   12.22 +HYPERVISOR_sched_op_compat(
   12.23      int cmd, unsigned long arg)
   12.24  {
   12.25 -	return _hypercall2(int, sched_op, cmd, arg);
   12.26 -}
   12.27 -
   12.28 -static inline int
   12.29 -HYPERVISOR_sched_op_new(
   12.30 -	int cmd, void *arg)
   12.31 -{
   12.32 -	return _hypercall2(int, sched_op_new, cmd, arg);
   12.33 +	return _hypercall2(int, sched_op_compat, cmd, arg);
   12.34  }
   12.35  
   12.36  static inline int
   12.37 -HYPERVISOR_poll(
   12.38 -	evtchn_port_t *ports, unsigned int nr_ports, unsigned long timeout)
   12.39 +HYPERVISOR_sched_op(
   12.40 +	int cmd, void *arg)
   12.41  {
   12.42 -	struct sched_poll sched_poll = {
   12.43 -		.ports = ports,
   12.44 -		.nr_ports = nr_ports,
   12.45 -		.timeout = jiffies_to_st(timeout)
   12.46 -	};
   12.47 -
   12.48 -	int rc = HYPERVISOR_sched_op_new(SCHEDOP_poll, &sched_poll);
   12.49 -
   12.50 -	if (rc == -ENOSYS)
   12.51 -		rc = HYPERVISOR_sched_op(SCHEDOP_yield, 0);
   12.52 -
   12.53 -	return rc;
   12.54 +	return _hypercall2(int, sched_op, cmd, arg);
   12.55  }
   12.56  
   12.57  static inline long
   12.58 @@ -272,8 +253,18 @@ static inline int
   12.59  HYPERVISOR_suspend(
   12.60  	unsigned long srec)
   12.61  {
   12.62 -    return _hypercall3(int, sched_op, SCHEDOP_shutdown,
   12.63 -			SHUTDOWN_suspend, srec);
   12.64 +	struct sched_shutdown sched_shutdown = {
   12.65 +		.reason = SHUTDOWN_suspend
   12.66 +	};
   12.67 +
   12.68 +	int rc = _hypercall3(int, sched_op, SCHEDOP_shutdown,
   12.69 +			     &sched_shutdown, srec);
   12.70 +
   12.71 +	if (rc == -ENOSYS)
   12.72 +		rc = _hypercall3(int, sched_op_compat, SCHEDOP_shutdown,
   12.73 +				 SHUTDOWN_suspend, srec);
   12.74 +
   12.75 +	return rc;
   12.76  }
   12.77  
   12.78  extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
    13.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h	Fri Mar 31 00:24:54 2006 +0100
    13.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h	Fri Mar 31 00:26:07 2006 +0100
    13.3 @@ -37,8 +37,10 @@
    13.4  #include <linux/types.h>
    13.5  #include <linux/kernel.h>
    13.6  #include <linux/version.h>
    13.7 +#include <linux/errno.h>
    13.8  #include <xen/interface/xen.h>
    13.9  #include <xen/interface/dom0_ops.h>
   13.10 +#include <xen/interface/sched.h>
   13.11  #include <asm/ptrace.h>
   13.12  #include <asm/page.h>
   13.13  
   13.14 @@ -54,6 +56,64 @@ int xen_init(void);
   13.15  
   13.16  #include <asm/hypercall.h>
   13.17  
   13.18 +static inline int
   13.19 +HYPERVISOR_yield(
   13.20 +	void)
   13.21 +{
   13.22 +	int rc = HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
   13.23 +
   13.24 +	if (rc == -ENOSYS)
   13.25 +		rc = HYPERVISOR_sched_op_compat(SCHEDOP_yield, 0);
   13.26 +
   13.27 +	return rc;
   13.28 +}
   13.29 +
   13.30 +static inline int
   13.31 +HYPERVISOR_block(
   13.32 +	void)
   13.33 +{
   13.34 +	int rc = HYPERVISOR_sched_op(SCHEDOP_block, NULL);
   13.35 +
   13.36 +	if (rc == -ENOSYS)
   13.37 +		rc = HYPERVISOR_sched_op_compat(SCHEDOP_block, 0);
   13.38 +
   13.39 +	return rc;
   13.40 +}
   13.41 +
   13.42 +static inline int
   13.43 +HYPERVISOR_shutdown(
   13.44 +	unsigned int reason)
   13.45 +{
   13.46 +	struct sched_shutdown sched_shutdown = {
   13.47 +		.reason = reason
   13.48 +	};
   13.49 +
   13.50 +	int rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
   13.51 +
   13.52 +	if (rc == -ENOSYS)
   13.53 +		rc = HYPERVISOR_sched_op_compat(SCHEDOP_shutdown, reason);
   13.54 +
   13.55 +	return rc;
   13.56 +}
   13.57 +
   13.58 +static inline int
   13.59 +HYPERVISOR_poll(
   13.60 +	evtchn_port_t *ports, unsigned int nr_ports, u64 timeout)
   13.61 +{
   13.62 +	struct sched_poll sched_poll = {
   13.63 +		.ports = ports,
   13.64 +		.nr_ports = nr_ports,
   13.65 +		.timeout = jiffies_to_st(timeout)
   13.66 +	};
   13.67 +
   13.68 +	int rc = HYPERVISOR_sched_op(SCHEDOP_poll, &sched_poll);
   13.69 +
   13.70 +	if (rc == -ENOSYS)
   13.71 +		rc = HYPERVISOR_sched_op_compat(SCHEDOP_yield, 0);
   13.72 +
   13.73 +	return rc;
   13.74 +}
   13.75 +
   13.76  // for drivers/xen/privcmd/privcmd.c
   13.77  #define direct_remap_pfn_range(a,b,c,d,e,f) remap_pfn_range(a,b,c,d,e)
   13.78  #define	pfn_to_mfn(x)	(x)
    14.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/hypercall.h	Fri Mar 31 00:24:54 2006 +0100
    14.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/hypercall.h	Fri Mar 31 00:26:07 2006 +0100
    14.3 @@ -37,10 +37,9 @@
    14.4  #ifndef __HYPERCALL_H__
    14.5  #define __HYPERCALL_H__
    14.6  
    14.7 -#include <xen/interface/xen.h>
    14.8 -#include <xen/interface/sched.h>
    14.9 -#include <xen/interface/nmi.h>
   14.10 -#include <linux/errno.h>
   14.11 +#ifndef __HYPERVISOR_H__
   14.12 +# error "please don't include this file directly"
   14.13 +#endif
   14.14  
   14.15  #define __STR(x) #x
   14.16  #define STR(x) __STR(x)
   14.17 @@ -172,35 +171,17 @@ HYPERVISOR_fpu_taskswitch(
   14.18  }
   14.19  
   14.20  static inline int
   14.21 -HYPERVISOR_sched_op(
   14.22 +HYPERVISOR_sched_op_compat(
   14.23  	int cmd, unsigned long arg)
   14.24  {
   14.25 -	return _hypercall2(int, sched_op, cmd, arg);
   14.26 -}
   14.27 -
   14.28 -static inline int
   14.29 -HYPERVISOR_sched_op_new(
   14.30 -	int cmd, void *arg)
   14.31 -{
   14.32 -	return _hypercall2(int, sched_op_new, cmd, arg);
   14.33 +	return _hypercall2(int, sched_op_compat, cmd, arg);
   14.34  }
   14.35  
   14.36  static inline int
   14.37 -HYPERVISOR_poll(
   14.38 -	evtchn_port_t *ports, unsigned int nr_ports, u64 timeout)
   14.39 +HYPERVISOR_sched_op(
   14.40 +	int cmd, void *arg)
   14.41  {
   14.42 -	struct sched_poll sched_poll = {
   14.43 -		.ports = ports,
   14.44 -		.nr_ports = nr_ports,
   14.45 -		.timeout = jiffies_to_st(timeout)
   14.46 -	};
   14.47 -
   14.48 -	int rc = HYPERVISOR_sched_op_new(SCHEDOP_poll, &sched_poll);
   14.49 -
   14.50 -	if (rc == -ENOSYS)
   14.51 -		rc = HYPERVISOR_sched_op(SCHEDOP_yield, 0);
   14.52 -
   14.53 -	return rc;
   14.54 +	return _hypercall2(int, sched_op, cmd, arg);
   14.55  }
   14.56  
   14.57  static inline long
   14.58 @@ -328,8 +309,18 @@ static inline int
   14.59  HYPERVISOR_suspend(
   14.60  	unsigned long srec)
   14.61  {
   14.62 -	return _hypercall3(int, sched_op, SCHEDOP_shutdown,
   14.63 -			   SHUTDOWN_suspend, srec);
   14.64 +	struct sched_shutdown sched_shutdown = {
   14.65 +		.reason = SHUTDOWN_suspend
   14.66 +	};
   14.67 +
   14.68 +	int rc = _hypercall3(int, sched_op, SCHEDOP_shutdown,
   14.69 +			     &sched_shutdown, srec);
   14.70 +
   14.71 +	if (rc == -ENOSYS)
   14.72 +		rc = _hypercall3(int, sched_op_compat, SCHEDOP_shutdown,
   14.73 +				 SHUTDOWN_suspend, srec);
   14.74 +
   14.75 +	return rc;
   14.76  }
   14.77  
   14.78  static inline int
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/xen/include/public/xen-compat.h	Fri Mar 31 00:26:07 2006 +0100
    15.3 @@ -0,0 +1,21 @@
    15.4 +/******************************************************************************
    15.5 + * xen-compat.h
    15.6 + * 
    15.7 + * Guest OS interface to Xen.  Compatibility layer.
    15.8 + * 
    15.9 + * Copyright (c) 2006, Christian Limpach
   15.10 + */
   15.11 +
   15.12 +#ifndef __XEN_PUBLIC_XEN_COMPAT_H__
   15.13 +#define __XEN_PUBLIC_XEN_COMPAT_H__
   15.14 +
   15.15 +#ifndef __XEN_INTERFACE_VERSION__
   15.16 +#define __XEN_INTERFACE_VERSION__ 0x00000000
   15.17 +#endif
   15.18 +
   15.19 +#if __XEN_INTERFACE_VERSION__ < 0x00030101
   15.20 +#undef __HYPERVISOR_sched_op
   15.21 +#define __HYPERVISOR_sched_op __HYPERVISOR_sched_op_compat
   15.22 +#endif
   15.23 +
   15.24 +#endif /* __XEN_PUBLIC_XEN_COMPAT_H__ */
    16.1 --- a/xen/include/public/xen.h	Fri Mar 31 00:24:54 2006 +0100
    16.2 +++ b/xen/include/public/xen.h	Fri Mar 31 00:26:07 2006 +0100
    16.3 @@ -37,7 +37,7 @@
    16.4  #define __HYPERVISOR_stack_switch          3
    16.5  #define __HYPERVISOR_set_callbacks         4
    16.6  #define __HYPERVISOR_fpu_taskswitch        5
    16.7 -#define __HYPERVISOR_sched_op              6
    16.8 +#define __HYPERVISOR_sched_op_compat       6 /* compat as of 0x00030101 */
    16.9  #define __HYPERVISOR_dom0_op               7
   16.10  #define __HYPERVISOR_set_debugreg          8
   16.11  #define __HYPERVISOR_get_debugreg          9
   16.12 @@ -59,7 +59,7 @@
   16.13  #define __HYPERVISOR_mmuext_op            26
   16.14  #define __HYPERVISOR_acm_op               27
   16.15  #define __HYPERVISOR_nmi_op               28
   16.16 -#define __HYPERVISOR_sched_op_new         29
   16.17 +#define __HYPERVISOR_sched_op             29
   16.18  
   16.19  /* 
   16.20   * VIRTUAL INTERRUPTS
   16.21 @@ -436,6 +436,8 @@ typedef uint8_t xen_domain_handle_t[16];
   16.22  
   16.23  #endif /* !__ASSEMBLY__ */
   16.24  
   16.25 +#include "xen-compat.h"
   16.26 +
   16.27  #endif /* __XEN_PUBLIC_XEN_H__ */
   16.28  
   16.29  /*