diff options
Diffstat (limited to 'drivers/char/keyboard.c')
-rw-r--r-- | drivers/char/keyboard.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 6cb85dcbbc83..4bb3d2272604 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c | |||
@@ -151,6 +151,7 @@ unsigned char kbd_sysrq_xlate[KEY_MAX + 1] = | |||
151 | "230\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */ | 151 | "230\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */ |
152 | "\r\000/"; /* 0x60 - 0x6f */ | 152 | "\r\000/"; /* 0x60 - 0x6f */ |
153 | static int sysrq_down; | 153 | static int sysrq_down; |
154 | static int sysrq_alt_use; | ||
154 | #endif | 155 | #endif |
155 | static int sysrq_alt; | 156 | static int sysrq_alt; |
156 | 157 | ||
@@ -1145,7 +1146,7 @@ static void kbd_keycode(unsigned int keycode, int down, | |||
1145 | kbd = kbd_table + fg_console; | 1146 | kbd = kbd_table + fg_console; |
1146 | 1147 | ||
1147 | if (keycode == KEY_LEFTALT || keycode == KEY_RIGHTALT) | 1148 | if (keycode == KEY_LEFTALT || keycode == KEY_RIGHTALT) |
1148 | sysrq_alt = down; | 1149 | sysrq_alt = down ? keycode : 0; |
1149 | #ifdef CONFIG_SPARC | 1150 | #ifdef CONFIG_SPARC |
1150 | if (keycode == KEY_STOP) | 1151 | if (keycode == KEY_STOP) |
1151 | sparc_l1_a_state = down; | 1152 | sparc_l1_a_state = down; |
@@ -1165,9 +1166,14 @@ static void kbd_keycode(unsigned int keycode, int down, | |||
1165 | 1166 | ||
1166 | #ifdef CONFIG_MAGIC_SYSRQ /* Handle the SysRq Hack */ | 1167 | #ifdef CONFIG_MAGIC_SYSRQ /* Handle the SysRq Hack */ |
1167 | if (keycode == KEY_SYSRQ && (sysrq_down || (down == 1 && sysrq_alt))) { | 1168 | if (keycode == KEY_SYSRQ && (sysrq_down || (down == 1 && sysrq_alt))) { |
1168 | sysrq_down = down; | 1169 | if (!sysrq_down) { |
1170 | sysrq_down = down; | ||
1171 | sysrq_alt_use = sysrq_alt; | ||
1172 | } | ||
1169 | return; | 1173 | return; |
1170 | } | 1174 | } |
1175 | if (sysrq_down && !down && keycode == sysrq_alt_use) | ||
1176 | sysrq_down = 0; | ||
1171 | if (sysrq_down && down && !rep) { | 1177 | if (sysrq_down && down && !rep) { |
1172 | handle_sysrq(kbd_sysrq_xlate[keycode], regs, tty); | 1178 | handle_sysrq(kbd_sysrq_xlate[keycode], regs, tty); |
1173 | return; | 1179 | return; |