aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/vt.c
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2010-08-05 10:22:30 -0400
committerJason Wessel <jason.wessel@windriver.com>2010-08-05 10:22:30 -0400
commit81d4450732c68aa728f2c86c0c2993c6cfc3d032 (patch)
treec332675648080d38e9f461286274534a16e7346b /drivers/char/vt.c
parentb45cfba4e9005d64d419718e7ff7f7cab44c1994 (diff)
vt,console,kdb: automatically set kdb LINES variable
The kernel console interface stores the number of lines it is configured to use. The kdb debugger can greatly benefit by knowing how many lines there are on the console for the pager functionality without having the end user compile in the setting or have to repeatedly change it at run time. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> CC: David Airlie <airlied@linux.ie> CC: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/char/vt.c')
-rw-r--r--drivers/char/vt.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 117ce99115d..4a9eb3044e5 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -104,6 +104,7 @@
104#include <linux/io.h> 104#include <linux/io.h>
105#include <asm/system.h> 105#include <asm/system.h>
106#include <linux/uaccess.h> 106#include <linux/uaccess.h>
107#include <linux/kdb.h>
107 108
108#define MAX_NR_CON_DRIVER 16 109#define MAX_NR_CON_DRIVER 16
109 110
@@ -3442,6 +3443,22 @@ int con_debug_enter(struct vc_data *vc)
3442 console_blanked = 0; 3443 console_blanked = 0;
3443 if (vc->vc_sw->con_debug_enter) 3444 if (vc->vc_sw->con_debug_enter)
3444 ret = vc->vc_sw->con_debug_enter(vc); 3445 ret = vc->vc_sw->con_debug_enter(vc);
3446#ifdef CONFIG_KGDB_KDB
3447 /* Set the initial LINES variable if it is not already set */
3448 if (vc->vc_rows < 999) {
3449 int linecount;
3450 char lns[4];
3451 const char *setargs[3] = {
3452 "set",
3453 "LINES",
3454 lns,
3455 };
3456 if (kdbgetintenv(setargs[0], &linecount)) {
3457 snprintf(lns, 4, "%i", vc->vc_rows);
3458 kdb_set(2, setargs);
3459 }
3460 }
3461#endif /* CONFIG_KGDB_KDB */
3445 return ret; 3462 return ret;
3446} 3463}
3447EXPORT_SYMBOL_GPL(con_debug_enter); 3464EXPORT_SYMBOL_GPL(con_debug_enter);