瀏覽代碼

kgdboc: Add ekgdboc for early use of the kernel debugger

The ekgdboc= differs from kgdboc= in that you can begin debuggin as
soon as the exceptions are setup and the kgdb I/O driver is available,
instead of waiting until the tty subsystem is available.

CC: kgdb-bugreport@lists.sourceforge.net
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Jason Wessel 15 年之前
父節點
當前提交
9731191f75
共有 2 個文件被更改,包括 25 次插入0 次删除
  1. 6 0
      Documentation/kernel-parameters.txt
  2. 19 0
      drivers/serial/kgdboc.c

+ 6 - 0
Documentation/kernel-parameters.txt

@@ -713,6 +713,12 @@ and is between 256 and 4096 characters. It is defined in the file
 			The VGA output is eventually overwritten by the real
 			The VGA output is eventually overwritten by the real
 			console.
 			console.
 
 
+	ekgdboc=	[X86,KGDB] Allow early kernel console debugging
+			ekgdboc=kbd
+
+			This is desgined to be used in conjunction with
+			the boot argument: earlyprintk=vga
+
 	eata=		[HW,SCSI]
 	eata=		[HW,SCSI]
 
 
 	edd=		[EDD]
 	edd=		[EDD]

+ 19 - 0
drivers/serial/kgdboc.c

@@ -223,6 +223,25 @@ static struct kgdb_io kgdboc_io_ops = {
 	.post_exception		= kgdboc_post_exp_handler,
 	.post_exception		= kgdboc_post_exp_handler,
 };
 };
 
 
+#ifdef CONFIG_KGDB_SERIAL_CONSOLE
+/* This is only available if kgdboc is a built in for early debugging */
+int __init kgdboc_early_init(char *opt)
+{
+	/* save the first character of the config string because the
+	 * init routine can destroy it.
+	 */
+	char save_ch;
+
+	kgdboc_option_setup(opt);
+	save_ch = config[0];
+	init_kgdboc();
+	config[0] = save_ch;
+	return 0;
+}
+
+early_param("ekgdboc", kgdboc_early_init);
+#endif /* CONFIG_KGDB_SERIAL_CONSOLE */
+
 module_init(init_kgdboc);
 module_init(init_kgdboc);
 module_exit(cleanup_kgdboc);
 module_exit(cleanup_kgdboc);
 module_param_call(kgdboc, param_set_kgdboc_var, param_get_string, &kps, 0644);
 module_param_call(kgdboc, param_set_kgdboc_var, param_get_string, &kps, 0644);