From: Jason Wessel <jason.wessel@windriver.com>
To: torvalds@linux-foundation.org
Cc: linux-kernel@vger.kernel.org,
kgdb-bugreport@lists.sourceforge.net,
Jason Wessel <jason.wessel@windriver.com>,
Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: [PATCH 3/9] kgdboc: Add call backs to allow kernel mode switching
Date: Thu, 5 Aug 2010 09:39:52 -0500 [thread overview]
Message-ID: <1281019198-6777-4-git-send-email-jason.wessel@windriver.com> (raw)
In-Reply-To: <1281019198-6777-3-git-send-email-jason.wessel@windriver.com>
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>
---
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 a9a94ae..39f9a1a 100644
--- a/drivers/serial/kgdboc.c
+++ b/drivers/serial/kgdboc.c
@@ -17,6 +17,7 @@
#include <linux/kdb.h>
#include <linux/tty.h>
#include <linux/console.h>
+#include <linux/vt_kern.h>
#define MAX_CONFIG_LEN 40
@@ -31,6 +32,7 @@ static struct kparam_string kps = {
.maxlen = MAX_CONFIG_LEN,
};
+static int kgdboc_use_kms; /* 1 if we use kernel mode switching */
static struct tty_driver *kgdb_tty_driver;
static int kgdb_tty_line;
@@ -104,6 +106,12 @@ static int configure_kgdboc(void)
kgdboc_io_ops.is_console = 0;
kgdb_tty_driver = NULL;
+ kgdboc_use_kms = 0;
+ if (strncmp(cptr, "kms,", 4) == 0) {
+ cptr += 4;
+ kgdboc_use_kms = 1;
+ }
+
if (kgdboc_register_kbd(&cptr))
goto do_register;
@@ -201,8 +209,14 @@ static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp)
return configure_kgdboc();
}
+static int dbg_restore_graphics;
+
static void kgdboc_pre_exp_handler(void)
{
+ if (!dbg_restore_graphics && kgdboc_use_kms) {
+ dbg_restore_graphics = 1;
+ con_debug_enter(vc_cons[fg_console].d);
+ }
/* Increment the module count when the debugger is active */
if (!kgdb_connected)
try_module_get(THIS_MODULE);
@@ -213,6 +227,10 @@ static void kgdboc_post_exp_handler(void)
/* decrement the module count when the debugger detaches */
if (!kgdb_connected)
module_put(THIS_MODULE);
+ if (kgdboc_use_kms && dbg_restore_graphics) {
+ dbg_restore_graphics = 0;
+ con_debug_leave();
+ }
}
static struct kgdb_io kgdboc_io_ops = {
--
1.6.4.rc1
next prev parent reply other threads:[~2010-08-05 14:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-05 14:39 [GIT PULL] kgdb,kdb,kms for 2.6.36 (2 of 2) Jason Wessel
2010-08-05 14:39 ` [PATCH 1/9] vt,console,kdb: implement atomic console enter/leave functions Jason Wessel
2010-08-05 14:39 ` [PATCH 2/9] vt,console,kdb: automatically set kdb LINES variable Jason Wessel
2010-08-05 14:39 ` Jason Wessel [this message]
2010-08-05 14:39 ` [PATCH 4/9] fb: add hooks to handle KDB enter/exit Jason Wessel
2010-08-05 14:39 ` [PATCH 5/9] drm: add KGDB/KDB support Jason Wessel
2010-08-05 14:39 ` [PATCH 6/9] drm/i915: use new fb debug hooks Jason Wessel
2010-08-05 14:39 ` [PATCH 7/9] i915: when kgdb is active display compression should be off Jason Wessel
2010-08-05 14:39 ` [PATCH 8/9] drm_fb_helper: Preserve capability to use atomic kms Jason Wessel
2010-08-05 14:39 ` [PATCH 9/9] kgdb,docs: Update the kgdb docs to include kms Jason Wessel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1281019198-6777-4-git-send-email-jason.wessel@windriver.com \
--to=jason.wessel@windriver.com \
--cc=jbarnes@virtuousgeek.org \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®