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

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

diff -u --recursive --new-file v2.1.74/linux/drivers/char/sysrq.c linux/drivers/char/sysrq.c
@@ -1,6 +1,6 @@
 /* -*- linux-c -*-
  *
- *	$Id: sysrq.c,v 1.4 1997/07/17 11:54:15 mj Exp $
+ *	$Id: sysrq.c,v 1.7 1997/11/06 15:57:09 mj Exp $
  *
  *	Linux Magic System Request Key Hacks
  *
@@ -31,10 +31,6 @@
 extern int console_loglevel;
 extern struct vfsmount *vfsmntlist;
 
-#ifdef __sparc__
-extern void halt_now(void);
-#endif
-
 /* Send a signal to all user processes */
 
 static void send_sig_all(int sig, int even_init)
@@ -60,6 +56,9 @@
 {
 	int orig_log_level = console_loglevel;
 
+	if (!key)
+		return;
+
 	console_loglevel = 7;
 	printk(KERN_INFO "SysRq: ");
 	switch (key) {
@@ -69,7 +68,7 @@
 			printk("Keyboard mode set to XLATE\n");
 		}
 		break;
-	case 'a':					    /* A -- SAK */
+	case 'k':					    /* K -- SAK */
 		printk("SAK\n");
 		if (tty)
 			do_SAK(tty);
@@ -79,12 +78,6 @@
 		printk("Resetting\n");
 		machine_restart(NULL);
 		break;
-#ifdef __sparc__
-	case 'h':					    /* H -- halt immediately */
-		printk("Halting\n");
-		halt_now();
-		break;
-#endif
 #ifdef CONFIG_APM
 	case 'o':					    /* O -- power off */
 		printk("Power off\n");
@@ -123,7 +116,7 @@
 		send_sig_all(SIGTERM, 0);
 		orig_log_level = 8;			    /* We probably have killed syslogd */
 		break;
-	case 'k':					    /* K -- kill all user processes */
+	case 'i':					    /* I -- kill all user processes */
 		printk("Kill All Tasks\n");
 		send_sig_all(SIGKILL, 0);
 		orig_log_level = 8;
@@ -134,14 +127,16 @@
 		orig_log_level = 8;
 		break;
 	default:					    /* Unknown: help */
-		printk("unRaw sAk Boot "
-#ifdef __sparc__
-		       "Halt "
-#endif
+		if (kbd)
+			printk("unRaw ");
+		if (tty)
+			printk("saK ");
+		printk("Boot "
 #ifdef CONFIG_APM
 		       "Off "
 #endif
-		       "Sync Unmount showPc showTasks showMem loglevel0-8 tErm Kill killalL\n");
+		       "Sync Unmount showPc showTasks showMem loglevel0-8 tErm kIll killalL\n");
+		/* Don't use 'A' as it's handled specially on the Sparc */
 	}
 
 	console_loglevel = orig_log_level;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov