aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>2006-03-31 00:26:07 +0100
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>2006-03-31 00:26:07 +0100
commit62b8bcaf488e20340b836bbb3d64045a10a5f3f4 (patch)
tree2de36ee9446a1faeb816c4128e7c03c79fe3df80
parentf207095aac35b93267aaf09faee33cfe80f04f5e (diff)
parent13678d4465f496f1ad01e8cbf6ccbec64b5e35b5 (diff)
downloadxen-62b8bcaf488e20340b836bbb3d64045a10a5f3f4.tar.gz
xen-62b8bcaf488e20340b836bbb3d64045a10a5f3f4.tar.bz2
xen-62b8bcaf488e20340b836bbb3d64045a10a5f3f4.zip
Merged.
-rw-r--r--linux-2.6-xen-sparse/arch/i386/Makefile7
-rw-r--r--linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c2
-rw-r--r--linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c2
-rw-r--r--linux-2.6-xen-sparse/arch/ia64/Makefile6
-rw-r--r--linux-2.6-xen-sparse/arch/x86_64/Makefile6
-rw-r--r--linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c2
-rw-r--r--linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c2
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/Kconfig14
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/core/reboot.c4
-rw-r--r--linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h47
-rw-r--r--linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h61
-rw-r--r--linux-2.6-xen-sparse/include/asm-ia64/hypercall.h47
-rw-r--r--linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h60
-rw-r--r--linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/hypercall.h47
-rw-r--r--xen/include/public/xen-compat.h21
-rw-r--r--xen/include/public/xen.h6
16 files changed, 234 insertions, 100 deletions
diff --git a/linux-2.6-xen-sparse/arch/i386/Makefile b/linux-2.6-xen-sparse/arch/i386/Makefile
index 527707677e..54ee32ee57 100644
--- a/linux-2.6-xen-sparse/arch/i386/Makefile
+++ b/linux-2.6-xen-sparse/arch/i386/Makefile
@@ -45,6 +45,11 @@ CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-op
CFLAGS += $(cflags-y)
+cppflags-$(CONFIG_XEN) += \
+ -D__XEN_INTERFACE_VERSION__=$(CONFIG_XEN_INTERFACE_VERSION)
+
+CPPFLAGS += $(cppflags-y)
+
# Default subarch .c files
mcore-y := mach-default
@@ -107,7 +112,7 @@ boot := arch/i386/boot
zdisk bzdisk fdimage fdimage144 fdimage288 install
ifdef CONFIG_XEN
-CPPFLAGS := -D__KERNEL__ -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(LINUXINCLUDE)
+CPPFLAGS := -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(CPPFLAGS)
head-y := arch/i386/kernel/head-xen.o arch/i386/kernel/init_task-xen.o
boot := arch/i386/boot-xen
.PHONY: vmlinuz
diff --git a/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c b/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c
index 47cde961a3..02f2835f56 100644
--- a/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c
@@ -114,7 +114,7 @@ void xen_idle(void)
smp_mb__after_clear_bit();
stop_hz_timer();
/* Blocking includes an implicit local_irq_enable(). */
- HYPERVISOR_sched_op(SCHEDOP_block, 0);
+ HYPERVISOR_block();
start_hz_timer();
set_thread_flag(TIF_POLLING_NRFLAG);
}
diff --git a/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c b/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c
index 8a83da25e7..11d17a7a12 100644
--- a/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c
@@ -1877,7 +1877,7 @@ void __init setup_arch(char **cmdline_p)
static int
xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
{
- HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_crash);
+ HYPERVISOR_shutdown(SHUTDOWN_crash);
/* we're never actually going to get here... */
return NOTIFY_DONE;
}
diff --git a/linux-2.6-xen-sparse/arch/ia64/Makefile b/linux-2.6-xen-sparse/arch/ia64/Makefile
index 172b4cfd44..99487f4433 100644
--- a/linux-2.6-xen-sparse/arch/ia64/Makefile
+++ b/linux-2.6-xen-sparse/arch/ia64/Makefile
@@ -42,6 +42,12 @@ ifeq ($(call cc-version),0304)
endif
CFLAGS += $(cflags-y)
+
+cppflags-$(CONFIG_XEN) += \
+ -D__XEN_INTERFACE_VERSION__=$(CONFIG_XEN_INTERFACE_VERSION)
+
+CPPFLAGS += $(cppflags-y)
+
head-y := arch/ia64/kernel/head.o arch/ia64/kernel/init_task.o
libs-y += arch/ia64/lib/
diff --git a/linux-2.6-xen-sparse/arch/x86_64/Makefile b/linux-2.6-xen-sparse/arch/x86_64/Makefile
index 6ac38f51a8..9164bf30a0 100644
--- a/linux-2.6-xen-sparse/arch/x86_64/Makefile
+++ b/linux-2.6-xen-sparse/arch/x86_64/Makefile
@@ -31,6 +31,10 @@ cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
CFLAGS += $(cflags-y)
+cppflags-$(CONFIG_XEN) += \
+ -D__XEN_INTERFACE_VERSION__=$(CONFIG_XEN_INTERFACE_VERSION)
+CPPFLAGS += $(cppflags-y)
+
CFLAGS += -m64
CFLAGS += -mno-red-zone
CFLAGS += -mcmodel=kernel
@@ -71,7 +75,7 @@ boot := arch/x86_64/boot
fdimage fdimage144 fdimage288 archclean
ifdef CONFIG_XEN
-CPPFLAGS := -D__KERNEL__ -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(LINUXINCLUDE)
+CPPFLAGS := -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(CPPFLAGS)
head-y := arch/x86_64/kernel/head-xen.o arch/x86_64/kernel/head64-xen.o arch/x86_64/kernel/init_task.o
LDFLAGS_vmlinux := -e _start
boot := arch/i386/boot-xen
diff --git a/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c b/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c
index d983037572..7127fb57f3 100644
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c
@@ -131,7 +131,7 @@ void xen_idle(void)
smp_mb__after_clear_bit();
stop_hz_timer();
/* Blocking includes an implicit local_irq_enable(). */
- HYPERVISOR_sched_op(SCHEDOP_block, 0);
+ HYPERVISOR_block();
start_hz_timer();
set_thread_flag(TIF_POLLING_NRFLAG);
}
diff --git a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
index cfa9bbf17b..30f8b40513 100644
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
@@ -999,7 +999,7 @@ void __init setup_arch(char **cmdline_p)
static int
xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
{
- HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_crash);
+ HYPERVISOR_shutdown(SHUTDOWN_crash);
/* we're never actually going to get here... */
return NOTIFY_DONE;
}
diff --git a/linux-2.6-xen-sparse/drivers/xen/Kconfig b/linux-2.6-xen-sparse/drivers/xen/Kconfig
index f452b2f75d..6518ff821a 100644
--- a/linux-2.6-xen-sparse/drivers/xen/Kconfig
+++ b/linux-2.6-xen-sparse/drivers/xen/Kconfig
@@ -10,12 +10,11 @@ config XEN
help
This is the Linux Xen port.
-config NO_IDLE_HZ
- bool
- depends on XEN
- default y
-
if XEN
+config XEN_INTERFACE_VERSION
+ hex
+ default 0x00030101
+
menu "XEN"
config XEN_PRIVILEGED_GUEST
@@ -191,7 +190,6 @@ config XEN_DISABLE_SERIAL
config XEN_SYSFS
tristate "Export Xen attributes in sysfs"
- depends on XEN
depends on SYSFS
default y
help
@@ -207,4 +205,8 @@ config HAVE_ARCH_DEV_ALLOC_SKB
bool
default y
+config NO_IDLE_HZ
+ bool
+ default y
+
endif
diff --git a/linux-2.6-xen-sparse/drivers/xen/core/reboot.c b/linux-2.6-xen-sparse/drivers/xen/core/reboot.c
index 828d287f3e..990dc35cee 100644
--- a/linux-2.6-xen-sparse/drivers/xen/core/reboot.c
+++ b/linux-2.6-xen-sparse/drivers/xen/core/reboot.c
@@ -42,7 +42,7 @@ void machine_emergency_restart(void)
{
/* We really want to get pending console data out before we die. */
xencons_force_flush();
- HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_reboot);
+ HYPERVISOR_shutdown(SHUTDOWN_reboot);
}
void machine_restart(char * __unused)
@@ -59,7 +59,7 @@ void machine_power_off(void)
{
/* We really want to get pending console data out before we die. */
xencons_force_flush();
- HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_poweroff);
+ HYPERVISOR_shutdown(SHUTDOWN_poweroff);
}
int reboot_thru_bios = 0; /* for dmi_scan.c */
diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h
index a7832cad1a..20977d0b80 100644
--- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h
+++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypercall.h
@@ -33,10 +33,9 @@
#ifndef __HYPERCALL_H__
#define __HYPERCALL_H__
-#include <xen/interface/xen.h>
-#include <xen/interface/sched.h>
-#include <xen/interface/nmi.h>
-#include <linux/errno.h>
+#ifndef __HYPERVISOR_H__
+# error "please don't include this file directly"
+#endif
#define __STR(x) #x
#define STR(x) __STR(x)
@@ -167,35 +166,17 @@ HYPERVISOR_fpu_taskswitch(
}
static inline int
-HYPERVISOR_sched_op(
+HYPERVISOR_sched_op_compat(
int cmd, unsigned long arg)
{
- return _hypercall2(int, sched_op, cmd, arg);
+ return _hypercall2(int, sched_op_compat, cmd, arg);
}
static inline int
-HYPERVISOR_sched_op_new(
+HYPERVISOR_sched_op(
int cmd, void *arg)
{
- return _hypercall2(int, sched_op_new, cmd, arg);
-}
-
-static inline int
-HYPERVISOR_poll(
- evtchn_port_t *ports, unsigned int nr_ports, u64 timeout)
-{
- struct sched_poll sched_poll = {
- .ports = ports,
- .nr_ports = nr_ports,
- .timeout = jiffies_to_st(timeout)
- };
-
- int rc = HYPERVISOR_sched_op_new(SCHEDOP_poll, &sched_poll);
-
- if (rc == -ENOSYS)
- rc = HYPERVISOR_sched_op(SCHEDOP_yield, 0);
-
- return rc;
+ return _hypercall2(int, sched_op, cmd, arg);
}
static inline long
@@ -327,8 +308,18 @@ static inline int
HYPERVISOR_suspend(
unsigned long srec)
{
- return _hypercall3(int, sched_op, SCHEDOP_shutdown,
- SHUTDOWN_suspend, srec);
+ struct sched_shutdown sched_shutdown = {
+ .reason = SHUTDOWN_suspend
+ };
+
+ int rc = _hypercall3(int, sched_op, SCHEDOP_shutdown,
+ &sched_shutdown, srec);
+
+ if (rc == -ENOSYS)
+ rc = _hypercall3(int, sched_op_compat, SCHEDOP_shutdown,
+ SHUTDOWN_suspend, srec);
+
+ return rc;
}
static inline int
diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h
index 2bc97ae342..325a6c8a5b 100644
--- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h
+++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h
@@ -37,8 +37,11 @@
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/version.h>
+#include <linux/errno.h>
#include <xen/interface/xen.h>
#include <xen/interface/dom0_ops.h>
+#include <xen/interface/sched.h>
+#include <xen/interface/nmi.h>
#include <asm/ptrace.h>
#include <asm/page.h>
#if defined(__i386__)
@@ -115,6 +118,64 @@ u64 jiffies_to_st(unsigned long jiffies);
#define xen_init() (0)
+static inline int
+HYPERVISOR_yield(
+ void)
+{
+ int rc = HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
+
+ if (rc == -ENOSYS)
+ rc = HYPERVISOR_sched_op_compat(SCHEDOP_yield, 0);
+
+ return rc;
+}
+
+static inline int
+HYPERVISOR_block(
+ void)
+{
+ int rc = HYPERVISOR_sched_op(SCHEDOP_block, NULL);
+
+ if (rc == -ENOSYS)
+ rc = HYPERVISOR_sched_op_compat(SCHEDOP_block, 0);
+
+ return rc;
+}
+
+static inline int
+HYPERVISOR_shutdown(
+ unsigned int reason)
+{
+ struct sched_shutdown sched_shutdown = {
+ .reason = reason
+ };
+
+ int rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
+
+ if (rc == -ENOSYS)
+ rc = HYPERVISOR_sched_op_compat(SCHEDOP_shutdown, reason);
+
+ return rc;
+}
+
+static inline int
+HYPERVISOR_poll(
+ evtchn_port_t *ports, unsigned int nr_ports, u64 timeout)
+{
+ struct sched_poll sched_poll = {
+ .ports = ports,
+ .nr_ports = nr_ports,
+ .timeout = jiffies_to_st(timeout)
+ };
+
+ int rc = HYPERVISOR_sched_op(SCHEDOP_poll, &sched_poll);
+
+ if (rc == -ENOSYS)
+ rc = HYPERVISOR_sched_op_compat(SCHEDOP_yield, 0);
+
+ return rc;
+}
+
static inline void
MULTI_update_va_mapping(
multicall_entry_t *mcl, unsigned long va,
diff --git a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h
index b260c56e76..d255cf41cf 100644
--- a/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h
+++ b/linux-2.6-xen-sparse/include/asm-ia64/hypercall.h
@@ -33,10 +33,9 @@
#ifndef __HYPERCALL_H__
#define __HYPERCALL_H__
-#include <xen/interface/xen.h>
-#include <xen/interface/sched.h>
-#include <xen/interface/dom0_ops.h>
-#include <linux/errno.h>
+#ifndef __HYPERVISOR_H__
+# error "please don't include this file directly"
+#endif
/* FIXME: temp place to hold these page related macros */
#include <asm/page.h>
@@ -164,35 +163,17 @@
})
static inline int
-HYPERVISOR_sched_op(
+HYPERVISOR_sched_op_compat(
int cmd, unsigned long arg)
{
- return _hypercall2(int, sched_op, cmd, arg);
+ return _hypercall2(int, sched_op_compat, cmd, arg);
}
static inline int
-HYPERVISOR_sched_op_new(
+HYPERVISOR_sched_op(
int cmd, void *arg)
{
- return _hypercall2(int, sched_op_new, cmd, arg);
-}
-
-static inline int
-HYPERVISOR_poll(
- evtchn_port_t *ports, unsigned int nr_ports, unsigned long timeout)
-{
- struct sched_poll sched_poll = {
- .ports = ports,
- .nr_ports = nr_ports,
- .timeout = jiffies_to_st(timeout)
- };
-
- int rc = HYPERVISOR_sched_op_new(SCHEDOP_poll, &sched_poll);
-
- if (rc == -ENOSYS)
- rc = HYPERVISOR_sched_op(SCHEDOP_yield, 0);
-
- return rc;
+ return _hypercall2(int, sched_op, cmd, arg);
}
static inline long
@@ -272,8 +253,18 @@ static inline int
HYPERVISOR_suspend(
unsigned long srec)
{
- return _hypercall3(int, sched_op, SCHEDOP_shutdown,
- SHUTDOWN_suspend, srec);
+ struct sched_shutdown sched_shutdown = {
+ .reason = SHUTDOWN_suspend
+ };
+
+ int rc = _hypercall3(int, sched_op, SCHEDOP_shutdown,
+ &sched_shutdown, srec);
+
+ if (rc == -ENOSYS)
+ rc = _hypercall3(int, sched_op_compat, SCHEDOP_shutdown,
+ SHUTDOWN_suspend, srec);
+
+ return rc;
}
extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
diff --git a/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h b/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h
index 4a5f424417..ecd51adcc0 100644
--- a/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h
+++ b/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h
@@ -37,8 +37,10 @@
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/version.h>
+#include <linux/errno.h>
#include <xen/interface/xen.h>
#include <xen/interface/dom0_ops.h>
+#include <xen/interface/sched.h>
#include <asm/ptrace.h>
#include <asm/page.h>
@@ -54,6 +56,64 @@ int xen_init(void);
#include <asm/hypercall.h>
+static inline int
+HYPERVISOR_yield(
+ void)
+{
+ int rc = HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
+
+ if (rc == -ENOSYS)
+ rc = HYPERVISOR_sched_op_compat(SCHEDOP_yield, 0);
+
+ return rc;
+}
+
+static inline int
+HYPERVISOR_block(
+ void)
+{
+ int rc = HYPERVISOR_sched_op(SCHEDOP_block, NULL);
+
+ if (rc == -ENOSYS)
+ rc = HYPERVISOR_sched_op_compat(SCHEDOP_block, 0);
+
+ return rc;
+}
+
+static inline int
+HYPERVISOR_shutdown(
+ unsigned int reason)
+{
+ struct sched_shutdown sched_shutdown = {
+ .reason = reason
+ };
+
+ int rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
+
+ if (rc == -ENOSYS)
+ rc = HYPERVISOR_sched_op_compat(SCHEDOP_shutdown, reason);
+
+ return rc;
+}
+
+static inline int
+HYPERVISOR_poll(
+ evtchn_port_t *ports, unsigned int nr_ports, u64 timeout)
+{
+ struct sched_poll sched_poll = {
+ .ports = ports,
+ .nr_ports = nr_ports,
+ .timeout = jiffies_to_st(timeout)
+ };
+
+ int rc = HYPERVISOR_sched_op(SCHEDOP_poll, &sched_poll);
+
+ if (rc == -ENOSYS)
+ rc = HYPERVISOR_sched_op_compat(SCHEDOP_yield, 0);
+
+ return rc;
+}
+
// for drivers/xen/privcmd/privcmd.c
#define direct_remap_pfn_range(a,b,c,d,e,f) remap_pfn_range(a,b,c,d,e)
#define pfn_to_mfn(x) (x)
diff --git a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/hypercall.h b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/hypercall.h
index 4071a1d6fd..6b7411f4c5 100644
--- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/hypercall.h
+++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/hypercall.h
@@ -37,10 +37,9 @@
#ifndef __HYPERCALL_H__
#define __HYPERCALL_H__
-#include <xen/interface/xen.h>
-#include <xen/interface/sched.h>
-#include <xen/interface/nmi.h>
-#include <linux/errno.h>
+#ifndef __HYPERVISOR_H__
+# error "please don't include this file directly"
+#endif
#define __STR(x) #x
#define STR(x) __STR(x)
@@ -172,35 +171,17 @@ HYPERVISOR_fpu_taskswitch(
}
static inline int
-HYPERVISOR_sched_op(
+HYPERVISOR_sched_op_compat(
int cmd, unsigned long arg)
{
- return _hypercall2(int, sched_op, cmd, arg);
+ return _hypercall2(int, sched_op_compat, cmd, arg);
}
static inline int
-HYPERVISOR_sched_op_new(
+HYPERVISOR_sched_op(
int cmd, void *arg)
{
- return _hypercall2(int, sched_op_new, cmd, arg);
-}
-
-static inline int
-HYPERVISOR_poll(
- evtchn_port_t *ports, unsigned int nr_ports, u64 timeout)
-{
- struct sched_poll sched_poll = {
- .ports = ports,
- .nr_ports = nr_ports,
- .timeout = jiffies_to_st(timeout)
- };
-
- int rc = HYPERVISOR_sched_op_new(SCHEDOP_poll, &sched_poll);
-
- if (rc == -ENOSYS)
- rc = HYPERVISOR_sched_op(SCHEDOP_yield, 0);
-
- return rc;
+ return _hypercall2(int, sched_op, cmd, arg);
}
static inline long
@@ -328,8 +309,18 @@ static inline int
HYPERVISOR_suspend(
unsigned long srec)
{
- return _hypercall3(int, sched_op, SCHEDOP_shutdown,
- SHUTDOWN_suspend, srec);
+ struct sched_shutdown sched_shutdown = {
+ .reason = SHUTDOWN_suspend
+ };
+
+ int rc = _hypercall3(int, sched_op, SCHEDOP_shutdown,
+ &sched_shutdown, srec);
+
+ if (rc == -ENOSYS)
+ rc = _hypercall3(int, sched_op_compat, SCHEDOP_shutdown,
+ SHUTDOWN_suspend, srec);
+
+ return rc;
}
static inline int
diff --git a/xen/include/public/xen-compat.h b/xen/include/public/xen-compat.h
new file mode 100644
index 0000000000..67af72b344
--- /dev/null
+++ b/xen/include/public/xen-compat.h
@@ -0,0 +1,21 @@
+/******************************************************************************
+ * xen-compat.h
+ *
+ * Guest OS interface to Xen. Compatibility layer.
+ *
+ * Copyright (c) 2006, Christian Limpach
+ */
+
+#ifndef __XEN_PUBLIC_XEN_COMPAT_H__
+#define __XEN_PUBLIC_XEN_COMPAT_H__
+
+#ifndef __XEN_INTERFACE_VERSION__
+#define __XEN_INTERFACE_VERSION__ 0x00000000
+#endif
+
+#if __XEN_INTERFACE_VERSION__ < 0x00030101
+#undef __HYPERVISOR_sched_op
+#define __HYPERVISOR_sched_op __HYPERVISOR_sched_op_compat
+#endif
+
+#endif /* __XEN_PUBLIC_XEN_COMPAT_H__ */
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index 5d88c9c8af..2921a140cd 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -37,7 +37,7 @@
#define __HYPERVISOR_stack_switch 3
#define __HYPERVISOR_set_callbacks 4
#define __HYPERVISOR_fpu_taskswitch 5
-#define __HYPERVISOR_sched_op 6
+#define __HYPERVISOR_sched_op_compat 6 /* compat as of 0x00030101 */
#define __HYPERVISOR_dom0_op 7
#define __HYPERVISOR_set_debugreg 8
#define __HYPERVISOR_get_debugreg 9
@@ -59,7 +59,7 @@
#define __HYPERVISOR_mmuext_op 26
#define __HYPERVISOR_acm_op 27
#define __HYPERVISOR_nmi_op 28
-#define __HYPERVISOR_sched_op_new 29
+#define __HYPERVISOR_sched_op 29
/*
* VIRTUAL INTERRUPTS
@@ -436,6 +436,8 @@ typedef uint8_t xen_domain_handle_t[16];
#endif /* !__ASSEMBLY__ */
+#include "xen-compat.h"
+
#endif /* __XEN_PUBLIC_XEN_H__ */
/*