--- sysrq.c.zal	Mon Apr  2 17:04:38 2001
+++ sysrq.c	Wed Apr  4 15:36:39 2001
@@ -23,6 +23,7 @@
 #include <linux/quotaops.h>
 #include <linux/smp_lock.h>
 #include <linux/module.h>
+#include <linux/irq.h>
 
 #include <asm/ptrace.h>
 
@@ -33,6 +34,8 @@
 /* Whether we react on sysrq keys or just ignore them */
 int sysrq_enabled = 1;
 
+EXPORT_SYMBOL(sysrq_enabled);
+
 /* Machine specific power off function */
 void (*sysrq_power_off)(void);
 
@@ -57,7 +60,6 @@
  * This function is called by the keyboard handler when SysRq is pressed
  * and any other keycode arrives.
  */
-
 void handle_sysrq(int key, struct pt_regs *pt_regs,
 		  struct kbd_struct *kbd, struct tty_struct *tty)
 {
@@ -152,8 +154,20 @@
 		/* Don't use 'A' as it's handled specially on the Sparc */
 	}
 
+	/*
+	 * There's a race here.  keyboard.c:handle_scancode() has done a
+	 * schedule_task(console_callback).  On another CPU, console_callback()
+	 * will acquire the console_sem.  So the above printk()'s _could_ end up
+	 * getting buffered in log_buf, and will be printed by keventd in console_callback()'s
+	 * release_console_sem().  But by the time that happens, this CPU has changed
+	 * console_loglevel, so the output won't be shown on the console.  The workaround 
+	 * was to move the console poking to the end of handle_scancode().
+	 */
 	console_loglevel = orig_log_level;
 }
+
+
+EXPORT_SYMBOL(handle_sysrq);
 
 /* Aux routines for the syncer */
 
