diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-12-13 03:34:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 12:05:50 -0500 |
commit | 5d6f647fc6bb57377c9f417c4752e43189f56bb1 (patch) | |
tree | ab30c24c021adc549aab6bf042108d920975d9a9 /include | |
parent | e61c90188b9956edae1105eef361d8981a352fcd (diff) |
[PATCH] debug: add sysrq_always_enabled boot option
Most distributions enable sysrq support but set it to 0 by default. Add a
sysrq_always_enabled boot option to always-enable sysrq keys. Useful for
debugging - without having to modify the disribution's config files (which
might not be possible if the kernel is on a live CD, etc.).
Also, while at it, clean up the sysrq interfaces.
[bunk@stusta.de: make sysrq_always_enabled_setup() static]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sysrq.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h index 9df8833670cb..98a1d8cfb73d 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h | |||
@@ -37,23 +37,37 @@ struct sysrq_key_op { | |||
37 | 37 | ||
38 | #ifdef CONFIG_MAGIC_SYSRQ | 38 | #ifdef CONFIG_MAGIC_SYSRQ |
39 | 39 | ||
40 | extern int sysrq_on(void); | ||
41 | |||
42 | /* | ||
43 | * Do not use this one directly: | ||
44 | */ | ||
45 | extern int __sysrq_enabled; | ||
46 | |||
40 | /* Generic SysRq interface -- you may call it from any device driver, supplying | 47 | /* Generic SysRq interface -- you may call it from any device driver, supplying |
41 | * ASCII code of the key, pointer to registers and kbd/tty structs (if they | 48 | * ASCII code of the key, pointer to registers and kbd/tty structs (if they |
42 | * are available -- else NULL's). | 49 | * are available -- else NULL's). |
43 | */ | 50 | */ |
44 | 51 | ||
45 | void handle_sysrq(int, struct tty_struct *); | 52 | void handle_sysrq(int key, struct tty_struct *tty); |
46 | void __handle_sysrq(int, struct tty_struct *, int check_mask); | 53 | void __handle_sysrq(int key, struct tty_struct *tty, int check_mask); |
47 | int register_sysrq_key(int, struct sysrq_key_op *); | 54 | int register_sysrq_key(int key, struct sysrq_key_op *op); |
48 | int unregister_sysrq_key(int, struct sysrq_key_op *); | 55 | int unregister_sysrq_key(int key, struct sysrq_key_op *op); |
49 | struct sysrq_key_op *__sysrq_get_key_op(int key); | 56 | struct sysrq_key_op *__sysrq_get_key_op(int key); |
50 | 57 | ||
51 | #else | 58 | #else |
52 | 59 | ||
60 | static inline int sysrq_on(void) | ||
61 | { | ||
62 | return 0; | ||
63 | } | ||
53 | static inline int __reterr(void) | 64 | static inline int __reterr(void) |
54 | { | 65 | { |
55 | return -EINVAL; | 66 | return -EINVAL; |
56 | } | 67 | } |
68 | static inline void handle_sysrq(int key, struct tty_struct *tty) | ||
69 | { | ||
70 | } | ||
57 | 71 | ||
58 | #define register_sysrq_key(ig,nore) __reterr() | 72 | #define register_sysrq_key(ig,nore) __reterr() |
59 | #define unregister_sysrq_key(ig,nore) __reterr() | 73 | #define unregister_sysrq_key(ig,nore) __reterr() |