sak-2.1.131.diff

Ragnar Hojland Espinosa (ragnar@redestb.es)
Mon, 14 Dec 1998 01:24:40 +0100 (CET)


Here's a patch to add a separate SAK key .. the good part of microsoft
keyboards is that they have 3 extra keys to do have fun with ;)

-- 
____/|  Ragnar Hojland  (ragnar@lightside.ddns.org)      Fingerprint  94C4B
\ o.O|                                                   2F0D27DE025BE2302C
 =(_)=  "Thou shalt not follow the NULL pointer for      104B78C56 B72F0822
   U     chaos and madness await thee at its end."       hkp://keys.pgp.com

--- linux-2.1.131/include/asm-i386/keyboard.h.O Mon Dec 14 00:51:27 1998 +++ linux-2.1.131/include/asm-i386/keyboard.h Mon Dec 14 00:20:40 1998 @@ -36,7 +36,7 @@ extern unsigned char pckbd_sysrq_xlate[1 #define kbd_sysrq_xlate pckbd_sysrq_xlate #define SYSRQ_KEY 0x54 - +#define SAK_KEY 0x54 #endif /* __KERNEL__ */ #endif /* __ASMi386_KEYBOARD_H */ --- linux-2.1.131/include/asm-mips/keyboard.h.O Mon Dec 14 00:54:14 1998 +++ linux-2.1.131/include/asm-mips/keyboard.h Mon Dec 14 00:54:30 1998 @@ -37,6 +37,7 @@ extern unsigned char pckbd_sysrq_xlate[1 #define kbd_sysrq_xlate pckbd_sysrq_xlate #define SYSRQ_KEY 0x54 +#define SAK_KEY 0x54 /* Some stoneage hardware needs delays after some operations. */ #define kbd_pause() do { } while(0) --- linux-2.1.131/include/asm-alpha/keyboard.h.O Mon Dec 14 00:49:58 1998 +++ linux-2.1.131/include/asm-alpha/keyboard.h Mon Dec 14 00:50:08 1998 @@ -38,6 +38,7 @@ extern unsigned char pckbd_sysrq_xlate[1 #define INIT_KBD #define SYSRQ_KEY 0x54 +#define SAK_KEY 0x54 #endif /* __KERNEL__ */ --- linux-2.1.131/include/asm-m68k/keyboard.h.O Mon Dec 14 00:52:29 1998 +++ linux-2.1.131/include/asm-m68k/keyboard.h Mon Dec 14 00:52:22 1998 @@ -55,6 +55,10 @@ static __inline__ void kbd_leds(unsigned (up_flag || \ (shift_state & mach_sysrq_shift_mask) == \ mach_sysrq_shift_state)) +#define kbd_is_sak(keycode) ((keycode) == mach_sysrq_key && \ + (up_flag || \ + (shift_state & mach_sysrq_shift_mask) == \ + mach_sysrq_shift_state)) #define kbd_sysrq_xlate mach_sysrq_xlate #endif --- linux-2.1.131/include/asm-sparc/keyboard.h.O Mon Dec 14 00:55:30 1998 +++ linux-2.1.131/include/asm-sparc/keyboard.h Mon Dec 14 00:55:24 1998 @@ -46,6 +46,7 @@ extern unsigned char pcikbd_sysrq_xlate[ /* #define SYSRQ_KEY 0x54 */ /* sparc64 */ #define SYSRQ_KEY 0x63 /* sparc */ +#define SAK_KEY 0x63 /* sparc */ #endif /* __KERNEL__ */ --- linux-2.1.131/include/asm-sparc64/keyboard.h.O Mon Dec 14 00:55:40 1998 +++ linux-2.1.131/include/asm-sparc64/keyboard.h Mon Dec 14 00:55:47 1998 @@ -45,6 +45,7 @@ extern unsigned char pcikbd_sysrq_xlate[ #define register_leds pci_register_leds #define SYSRQ_KEY 0x54 +#define SAK_KEY 0x54 #endif /* __KERNEL__ */ --- linux-2.1.131/include/asm-arm/keyboard.h.O Mon Dec 14 00:50:21 1998 +++ linux-2.1.131/include/asm-arm/keyboard.h Mon Dec 14 00:51:06 1998 @@ -20,6 +20,7 @@ #include <asm/arch/keyboard.h> #define SYSRQ_KEY 13 +#define SAK_KEY 13 #endif /* __KERNEL__ */ --- linux-2.1.131/drivers/char/Config.in.O Sun Dec 13 23:56:15 1998 +++ linux-2.1.131/drivers/char/Config.in Mon Dec 14 00:32:44 1998 @@ -7,6 +7,7 @@ comment 'Character devices' bool 'Virtual terminal' CONFIG_VT if [ "$CONFIG_VT" = "y" ]; then bool 'Support for console on virtual terminal' CONFIG_VT_CONSOLE + bool 'Support for SAK' CONFIG_MAGIC_SAK fi tristate 'Standard/generic (dumb) serial support' CONFIG_SERIAL if [ "$CONFIG_SERIAL" = "y" ]; then --- linux-2.1.131/drivers/char/keyboard.c.O Mon Dec 14 00:23:18 1998 +++ linux-2.1.131/drivers/char/keyboard.c Mon Dec 14 00:45:39 1998 @@ -21,6 +21,7 @@ * * 27-05-97: Added support for the Magic SysRq Key (Martin Mares) * 30-07-98: Dead keys redone, aeb@cwi.nl. + * 14-12-98: Added support for CONFIG_MAGIC_SAK (Ragnar Hojland Espinosa) */ #include <linux/config.h> @@ -248,8 +249,15 @@ void handle_scancode(unsigned char scanc handle_sysrq(kbd_sysrq_xlate[keycode], kbd_pt_regs, kbd, tty); return; } +#endif +#ifdef CONFIG_MAGIC_SAK +#if !defined(CONFIG_MAGIC_SYSRQ) || SYSRQ_KEY != SAK_KEY + if (keycode == SAK_KEY && up_flag) { + SAK(); + return; + } +#endif #endif - if (kbd->kbdmode == VC_MEDIUMRAW) { /* soon keycodes will require more than one byte */ put_queue(keycode + up_flag); --- linux-2.1.131/Documentation/Configure.help.O Mon Dec 14 01:08:21 1998 +++ linux-2.1.131/Documentation/Configure.help Mon Dec 14 01:08:13 1998 @@ -9073,6 +9073,15 @@ CONFIG_MAGIC_SYSRQ keys are documented in Documentation/sysrq.txt. Don't say Y unless you really know what this hack does. +Magic System Attention Key support +CONFIG_MAGIC_SAK + If you say Y here, you will have a support for SAK. Pressing the SAK + will kill all processes on the current virtual console and start a + trusted login, as documented in Documentation/sysrq.txt. The default + key is bounded to SysRq (Alt+PrintScreen), so you will have to change + the key for Magic SysRq or for Magic SAK if you want to have support + for both at the same time. If unsure, say Y. + ISDN subsystem CONFIG_ISDN ISDN ("Integrated Services Digital Networks", called RNIS in France)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/