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 /drivers/char/viocons.c | |
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 'drivers/char/viocons.c')
-rw-r--r-- | drivers/char/viocons.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/char/viocons.c b/drivers/char/viocons.c index 6d2e314860df..0e0da443cbd5 100644 --- a/drivers/char/viocons.c +++ b/drivers/char/viocons.c | |||
@@ -61,10 +61,7 @@ | |||
61 | static DEFINE_SPINLOCK(consolelock); | 61 | static DEFINE_SPINLOCK(consolelock); |
62 | static DEFINE_SPINLOCK(consoleloglock); | 62 | static DEFINE_SPINLOCK(consoleloglock); |
63 | 63 | ||
64 | #ifdef CONFIG_MAGIC_SYSRQ | ||
65 | static int vio_sysrq_pressed; | 64 | static int vio_sysrq_pressed; |
66 | extern int sysrq_enabled; | ||
67 | #endif | ||
68 | 65 | ||
69 | #define VIOCHAR_NUM_BUF 16 | 66 | #define VIOCHAR_NUM_BUF 16 |
70 | 67 | ||
@@ -936,8 +933,10 @@ static void vioHandleData(struct HvLpEvent *event) | |||
936 | */ | 933 | */ |
937 | num_pushed = 0; | 934 | num_pushed = 0; |
938 | for (index = 0; index < cevent->len; index++) { | 935 | for (index = 0; index < cevent->len; index++) { |
939 | #ifdef CONFIG_MAGIC_SYSRQ | 936 | /* |
940 | if (sysrq_enabled) { | 937 | * Will be optimized away if !CONFIG_MAGIC_SYSRQ: |
938 | */ | ||
939 | if (sysrq_on()) { | ||
941 | /* 0x0f is the ascii character for ^O */ | 940 | /* 0x0f is the ascii character for ^O */ |
942 | if (cevent->data[index] == '\x0f') { | 941 | if (cevent->data[index] == '\x0f') { |
943 | vio_sysrq_pressed = 1; | 942 | vio_sysrq_pressed = 1; |
@@ -956,7 +955,6 @@ static void vioHandleData(struct HvLpEvent *event) | |||
956 | continue; | 955 | continue; |
957 | } | 956 | } |
958 | } | 957 | } |
959 | #endif | ||
960 | /* | 958 | /* |
961 | * The sysrq sequence isn't included in this check if | 959 | * The sysrq sequence isn't included in this check if |
962 | * sysrq is enabled and compiled into the kernel because | 960 | * sysrq is enabled and compiled into the kernel because |