# HG changeset patch # User hahn@xxxxxxxxxxxxxxxx # Date 1161855519 -7200 # Node ID 117bcc7e0d162bf08f75a2765d82bfba98387831 # Parent abee5c6b930daae7b97ca2837591b737e939ddf4 Switched to new interfaces HYPERVISOR_sched_op() and HYPERVISOR_sched_op_compat() used in kernel.c. Signed-off-by: Dietmar Hahn diff -r abee5c6b930d -r 117bcc7e0d16 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h --- a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h Wed Oct 25 15:29:36 2006 +0100 +++ b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h Thu Oct 26 11:38:39 2006 +0200 @@ -166,8 +166,15 @@ HYPERVISOR_fpu_taskswitch( } static inline int +HYPERVISOR_sched_op_compat( + int cmd, unsigned long arg) +{ + return _hypercall2(int, sched_op_compat, cmd, arg); +} + +static inline int HYPERVISOR_sched_op( - int cmd, unsigned long arg) + int cmd, void *arg) { return _hypercall2(int, sched_op, cmd, arg); } diff -r abee5c6b930d -r 117bcc7e0d16 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h --- a/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h Wed Oct 25 15:29:36 2006 +0100 +++ b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h Thu Oct 26 11:38:39 2006 +0200 @@ -170,8 +170,15 @@ HYPERVISOR_fpu_taskswitch( } static inline int +HYPERVISOR_sched_op_compat( + int cmd, unsigned long arg) +{ + return _hypercall2(int, sched_op_compat, cmd, arg); +} + +static inline int HYPERVISOR_sched_op( - int cmd, unsigned long arg) + int cmd, void *arg) { return _hypercall2(int, sched_op, cmd, arg); } diff -r abee5c6b930d -r 117bcc7e0d16 extras/mini-os/kernel.c --- a/extras/mini-os/kernel.c Wed Oct 25 15:29:36 2006 +0100 +++ b/extras/mini-os/kernel.c Thu Oct 26 11:38:39 2006 +0200 @@ -27,6 +27,7 @@ */ #include +#include #include #include #include @@ -145,5 +146,13 @@ void do_exit(void) void do_exit(void) { printk("Do_exit called!\n"); - for ( ;; ) HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_crash); + for ( ;; ) + { + struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_crash }; + int rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown); + if(rc == -ENOSYS) + { + HYPERVISOR_sched_op_compat(SCHEDOP_shutdown, SHUTDOWN_crash); + } + } }