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

Ananth N Mavinakayanahalli ananth at in.ibm.com
Wed May 19 00:07:54 EST 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;

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list