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

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

diff -u --recursive --new-file v2.3.25/linux/drivers/char/sysrq.c linux/drivers/char/sysrq.c
@@ -24,15 +24,14 @@
 
 #include <asm/ptrace.h>
 
-#ifdef CONFIG_APM
-#include <linux/apm_bios.h>
-#endif
-
 extern void wakeup_bdflush(int);
 extern void reset_vc(unsigned int);
 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)
@@ -82,12 +81,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;
@@ -137,11 +136,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)