diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2010-08-05 10:22:30 -0400 |
---|---|---|
committer | Jason Wessel <jason.wessel@windriver.com> | 2010-08-05 10:22:30 -0400 |
commit | 408a4be1f8cbee511895ee07da2a007a5a24303f (patch) | |
tree | 9d31d812ffe9eaec638f0698b3e6ba913ca51a7e /drivers/serial/kgdboc.c | |
parent | 81d4450732c68aa728f2c86c0c2993c6cfc3d032 (diff) |
kgdboc: Add call backs to allow kernel mode switching
Add the kms keyword processing to kgdboc and the callbacks to invoke
console switching when ever kgdboc is started with "kgdboc=kms,kbd".
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/serial/kgdboc.c')
-rw-r--r-- | drivers/serial/kgdboc.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/serial/kgdboc.c b/drivers/serial/kgdboc.c index a9a94ae72349..39f9a1adaa75 100644 --- a/drivers/serial/kgdboc.c +++ b/drivers/serial/kgdboc.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/kdb.h> | 17 | #include <linux/kdb.h> |
18 | #include <linux/tty.h> | 18 | #include <linux/tty.h> |
19 | #include <linux/console.h> | 19 | #include <linux/console.h> |
20 | #include <linux/vt_kern.h> | ||
20 | 21 | ||
21 | #define MAX_CONFIG_LEN 40 | 22 | #define MAX_CONFIG_LEN 40 |
22 | 23 | ||
@@ -31,6 +32,7 @@ static struct kparam_string kps = { | |||
31 | .maxlen = MAX_CONFIG_LEN, | 32 | .maxlen = MAX_CONFIG_LEN, |
32 | }; | 33 | }; |
33 | 34 | ||
35 | static int kgdboc_use_kms; /* 1 if we use kernel mode switching */ | ||
34 | static struct tty_driver *kgdb_tty_driver; | 36 | static struct tty_driver *kgdb_tty_driver; |
35 | static int kgdb_tty_line; | 37 | static int kgdb_tty_line; |
36 | 38 | ||
@@ -104,6 +106,12 @@ static int configure_kgdboc(void) | |||
104 | kgdboc_io_ops.is_console = 0; | 106 | kgdboc_io_ops.is_console = 0; |
105 | kgdb_tty_driver = NULL; | 107 | kgdb_tty_driver = NULL; |
106 | 108 | ||
109 | kgdboc_use_kms = 0; | ||
110 | if (strncmp(cptr, "kms,", 4) == 0) { | ||
111 | cptr += 4; | ||
112 | kgdboc_use_kms = 1; | ||
113 | } | ||
114 | |||
107 | if (kgdboc_register_kbd(&cptr)) | 115 | if (kgdboc_register_kbd(&cptr)) |
108 | goto do_register; | 116 | goto do_register; |
109 | 117 | ||
@@ -201,8 +209,14 @@ static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp) | |||
201 | return configure_kgdboc(); | 209 | return configure_kgdboc(); |
202 | } | 210 | } |
203 | 211 | ||
212 | static int dbg_restore_graphics; | ||
213 | |||
204 | static void kgdboc_pre_exp_handler(void) | 214 | static void kgdboc_pre_exp_handler(void) |
205 | { | 215 | { |
216 | if (!dbg_restore_graphics && kgdboc_use_kms) { | ||
217 | dbg_restore_graphics = 1; | ||
218 | con_debug_enter(vc_cons[fg_console].d); | ||
219 | } | ||
206 | /* Increment the module count when the debugger is active */ | 220 | /* Increment the module count when the debugger is active */ |
207 | if (!kgdb_connected) | 221 | if (!kgdb_connected) |
208 | try_module_get(THIS_MODULE); | 222 | try_module_get(THIS_MODULE); |
@@ -213,6 +227,10 @@ static void kgdboc_post_exp_handler(void) | |||
213 | /* decrement the module count when the debugger detaches */ | 227 | /* decrement the module count when the debugger detaches */ |
214 | if (!kgdb_connected) | 228 | if (!kgdb_connected) |
215 | module_put(THIS_MODULE); | 229 | module_put(THIS_MODULE); |
230 | if (kgdboc_use_kms && dbg_restore_graphics) { | ||
231 | dbg_restore_graphics = 0; | ||
232 | con_debug_leave(); | ||
233 | } | ||
216 | } | 234 | } |
217 | 235 | ||
218 | static struct kgdb_io kgdboc_io_ops = { | 236 | static struct kgdb_io kgdboc_io_ops = { |