patch-2.2.15 linux/drivers/char/sysrq.c

Next file: linux/drivers/char/tty_io.c
Previous file: linux/drivers/char/synclink.c
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from ../../exclude v2.2.14/drivers/char/sysrq.c linux/drivers/char/sysrq.c
@@ -24,10 +24,6 @@
 
 #include <asm/ptrace.h>
 
-#ifdef CONFIG_APM
-#include <linux/apm_bios.h>
-#endif
-
 #ifdef CONFIG_MAGIC_SYSRQ
 int sysrq_enabled = 1;
 #endif
@@ -37,6 +33,9 @@
 extern int console_loglevel;
 extern struct vfsmount *vfsmntlist;
 
+/* Machine specific power off function */
+void (*sysrq_power_off)(void) = NULL;
+
 /* Send a signal to all user processes */
 
 static void send_sig_all(int sig, int even_init)
@@ -86,12 +85,12 @@
 		printk("Resetting\n");
 		machine_restart(NULL);
 		break;
-#ifdef CONFIG_APM
 	case 'o':					    /* O -- power off */
-		printk("Power off\n");
-		apm_power_off();
+		if (sysrq_power_off) {
+			printk("Power off\n");
+			sysrq_power_off();
+		}
 		break;
-#endif
 	case 's':					    /* S -- emergency sync */
 		printk("Emergency Sync\n");
 		emergency_sync_scheduled = EMERG_SYNC;
@@ -141,11 +140,10 @@
 		if (tty)
 			printk("saK ");
 #endif
-		printk("Boot "
-#ifdef CONFIG_APM
-		       "Off "
-#endif
-		       "Sync Unmount showPc showTasks showMem loglevel0-8 tErm kIll killalL\n");
+		printk("Boot ");
+		if (sysrq_power_off)
+			printk("Off ");
+		printk("Sync Unmount showPc showTasks showMem loglevel0-8 tErm kIll killalL\n");
 		/* Don't use 'A' as it's handled specially on the Sparc */
 	}
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)