diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-03-22 01:31:26 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-04-14 02:26:02 -0400 |
commit | 97f5f0cd8cd0a05449cbb77d1e6f02e026875802 (patch) | |
tree | e101f38dfd7bf4e759e96617f69ceedd497608e3 /include/linux/sysrq.h | |
parent | b91c4be730668e801aa6a2ea95f467cd9a1e0983 (diff) |
Input: implement SysRq as a separate input handler
Instead of keeping SysRq support inside of legacy keyboard driver split
it out into a separate input handler (filter). This stops most SysRq input
events from leaking into evdev clients (some events, such as first SysRq
scancode - not keycode - event, are still leaked into both legacy keyboard
and evdev).
[martinez.javier@gmail.com: fix compile error when CONFIG_MAGIC_SYSRQ is
not defined]
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'include/linux/sysrq.h')
-rw-r--r-- | include/linux/sysrq.h | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h index 99adcdc0d3ca..4496322e28dd 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h | |||
@@ -39,41 +39,34 @@ struct sysrq_key_op { | |||
39 | 39 | ||
40 | #ifdef CONFIG_MAGIC_SYSRQ | 40 | #ifdef CONFIG_MAGIC_SYSRQ |
41 | 41 | ||
42 | extern int sysrq_on(void); | ||
43 | |||
44 | /* | ||
45 | * Do not use this one directly: | ||
46 | */ | ||
47 | extern int __sysrq_enabled; | ||
48 | |||
49 | /* Generic SysRq interface -- you may call it from any device driver, supplying | 42 | /* Generic SysRq interface -- you may call it from any device driver, supplying |
50 | * ASCII code of the key, pointer to registers and kbd/tty structs (if they | 43 | * ASCII code of the key, pointer to registers and kbd/tty structs (if they |
51 | * are available -- else NULL's). | 44 | * are available -- else NULL's). |
52 | */ | 45 | */ |
53 | 46 | ||
54 | void handle_sysrq(int key, struct tty_struct *tty); | 47 | void handle_sysrq(int key, struct tty_struct *tty); |
55 | void __handle_sysrq(int key, struct tty_struct *tty, int check_mask); | ||
56 | int register_sysrq_key(int key, struct sysrq_key_op *op); | 48 | int register_sysrq_key(int key, struct sysrq_key_op *op); |
57 | int unregister_sysrq_key(int key, struct sysrq_key_op *op); | 49 | int unregister_sysrq_key(int key, struct sysrq_key_op *op); |
58 | struct sysrq_key_op *__sysrq_get_key_op(int key); | 50 | struct sysrq_key_op *__sysrq_get_key_op(int key); |
59 | 51 | ||
52 | int sysrq_toggle_support(int enable_mask); | ||
53 | |||
60 | #else | 54 | #else |
61 | 55 | ||
62 | static inline int sysrq_on(void) | 56 | static inline void handle_sysrq(int key, struct tty_struct *tty) |
63 | { | 57 | { |
64 | return 0; | ||
65 | } | 58 | } |
66 | static inline int __reterr(void) | 59 | |
60 | static inline int register_sysrq_key(int key, struct sysrq_key_op *op) | ||
67 | { | 61 | { |
68 | return -EINVAL; | 62 | return -EINVAL; |
69 | } | 63 | } |
70 | static inline void handle_sysrq(int key, struct tty_struct *tty) | 64 | |
65 | static inline int unregister_sysrq_key(int key, struct sysrq_key_op *op) | ||
71 | { | 66 | { |
67 | return -EINVAL; | ||
72 | } | 68 | } |
73 | 69 | ||
74 | #define register_sysrq_key(ig,nore) __reterr() | ||
75 | #define unregister_sysrq_key(ig,nore) __reterr() | ||
76 | |||
77 | #endif | 70 | #endif |
78 | 71 | ||
79 | #endif /* _LINUX_SYSRQ_H */ | 72 | #endif /* _LINUX_SYSRQ_H */ |