1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
#
# Patch managed by http://www.holgerschurig.de/patcher.html
#
--- linux_n1/drivers/char/spitz_keyb.c~enable-sysrq
+++ linux_n1/drivers/char/spitz_keyb.c
@@ -28,6 +28,7 @@
#include <linux/poll.h>
#include <linux/wait.h>
#include <asm/arch/keyboard.h>
+#include <asm/keyboard.h>
#include <asm/uaccess.h>
#include <linux/tqueue.h>
#include <linux/kbd_ll.h>
@@ -51,6 +52,18 @@
#endif
/*
+ * This is the KeyCode [not ScanCode!] to ASCII Code mapping table
+ */
+
+#ifdef CONFIG_MAGIC_SYSRQ
+static unsigned char spitz_sysrq_xlate[128] =
+ "\000abcdefghijklmno" /* 00-0f */
+ "pqrstuvwxyz\000\000\000\000\000" /* 10-1f */
+ " \000\000\000\000\000\000\000\0001234567" /* 20-2f */
+ "890\000\000\000\000\000\000\000\000\000\000\000\000\000"; /* 30-3f */
+#endif
+
+/*
* common logical driver definition
*/
extern void sharppda_kbd_press(int keycode);
@@ -337,7 +350,13 @@
spitz_kbd_pm_dev = pm_register(PM_SYS_DEV, 0, spitz_kbd_pm_callback);
#endif
- printk("keyboard initilaized.\n");
+ printk("keyboard initialized.\n");
+#ifdef CONFIG_MAGIC_SYSRQ
+ k_sysrq_key = 0x28; // KEY_HOME
+ k_sysrq_xlate = spitz_sysrq_xlate;
+ printk("magic_sysrq initialized.\n");
+#endif
+
}
int spitz_kbd_translate(unsigned char scancode, unsigned char *keycode_p)
--- linux_n1/drivers/char/keyboard.c~enable-sysrq
+++ linux_n1/drivers/char/keyboard.c
@@ -291,7 +291,7 @@
#ifdef CONFIG_MAGIC_SYSRQ /* Handle the SysRq Hack */
if (keycode == SYSRQ_KEY) {
sysrq_pressed = !up_flag;
- goto out;
+ // goto out;
} else if (sysrq_pressed) {
if (!up_flag) {
handle_sysrq(kbd_sysrq_xlate[keycode], kbd_pt_regs, kbd, tty);
|