diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2010-08-05 09:22:30 -0500 |
---|---|---|
committer | Jason Wessel <jason.wessel@windriver.com> | 2010-08-05 09:22:30 -0500 |
commit | 81d4450732c68aa728f2c86c0c2993c6cfc3d032 (patch) | |
tree | c332675648080d38e9f461286274534a16e7346b /drivers/char/vt.c | |
parent | b45cfba4e9005d64d419718e7ff7f7cab44c1994 (diff) | |
download | lwn-81d4450732c68aa728f2c86c0c2993c6cfc3d032.tar.gz lwn-81d4450732c68aa728f2c86c0c2993c6cfc3d032.zip |
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.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 117ce99115dc..4a9eb3044e52 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -104,6 +104,7 @@ #include <linux/io.h> #include <asm/system.h> #include <linux/uaccess.h> +#include <linux/kdb.h> #define MAX_NR_CON_DRIVER 16 @@ -3442,6 +3443,22 @@ int con_debug_enter(struct vc_data *vc) console_blanked = 0; if (vc->vc_sw->con_debug_enter) ret = vc->vc_sw->con_debug_enter(vc); +#ifdef CONFIG_KGDB_KDB + /* Set the initial LINES variable if it is not already set */ + if (vc->vc_rows < 999) { + int linecount; + char lns[4]; + const char *setargs[3] = { + "set", + "LINES", + lns, + }; + if (kdbgetintenv(setargs[0], &linecount)) { + snprintf(lns, 4, "%i", vc->vc_rows); + kdb_set(2, setargs); + } + } +#endif /* CONFIG_KGDB_KDB */ return ret; } EXPORT_SYMBOL_GPL(con_debug_enter); |