[PATCH] KDB for ppc64 - write to OF stdout instead of console

Ananth N Mavinakayanahalli ananth at in.ibm.com
Tue May 18 07:07:54 PDT 2004


Hi Anton,

KDB on ppc64 currently reads input from the OF-stdout (udbg_getc_poll)
while the output (kdb_printf) is through the registered consoles. This
leads to problems when working on LPAR mode, where, input is accepted
through the hmc vterm while output is displayed on the serial console.

Patch inlined removes KDB's dependency on consoles completely for I/O.
With this patch, we use the OF stdout for both input and output. 

This should fix the KDB configuration/usage confusions on ppc64 for 
both LPAR and non-LPAR modes.

Please apply!


Thanks,
Ananth
-- 
Ananth Narayan
Linux Technology Center,
IBM Software Lab, INDIA


diff -Naurp temp/ameslab/kdb/kdb_io.c ameslab/kdb/kdb_io.c
--- temp/ameslab/kdb/kdb_io.c	2004-05-04 02:07:51.000000000 -0700
+++ ameslab/kdb/kdb_io.c	2004-05-17 23:37:11.373470688 -0700
@@ -55,6 +55,9 @@
 static struct console *kdbcons;
 #endif
 
+#ifdef CONFIG_PPC64
+#include <asm/udbg.h>
+#endif
 
 #define CMD_BUFLEN 256
 char kdb_prompt_str[CMD_BUFLEN];
@@ -521,6 +524,13 @@ kdb_printf(const char *fmt, ...)
 		prom_printf("%s", kdb_buffer);
 	else
 #endif
+		
+#ifdef CONFIG_PPC64
+	if (udbg_write)
+		udbg_write(kdb_buffer, strlen(kdb_buffer));
+	else
+#endif
+
 	while (c) {
 		c->write(c, kdb_buffer, strlen(kdb_buffer));
 		c = c->next;
@@ -569,6 +579,13 @@ kdb_printf(const char *fmt, ...)
 			prom_printf("%s", moreprompt);
 		else
 #endif
+			
+#ifdef CONFIG_PPC64
+		if (udbg_write)
+			udbg_write(moreprompt, strlen(moreprompt));
+		else
+#endif
+			
 		while (c) {
 			c->write(c, moreprompt, strlen(moreprompt));
 			c = c->next;
---------------------------
Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.


More information about the kdb mailing list