aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/kernel/udbg.c
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2005-09-05 21:56:42 -0400
committerPaul Mackerras <paulus@samba.org>2005-09-06 02:07:36 -0400
commitc8f1c8be629ee34991fdba8bfe46a5c455393209 (patch)
tree66f218e641e87a0ca9ade7601345229b6557761e /arch/ppc64/kernel/udbg.c
parent7f853352e79bf57c4ee279b7458ed0c072e2be76 (diff)
[PATCH] ppc64: Take udbg out of ppc_md
Take udbg out of ppc_md. Allows us to not overwrite early udbg inits when assigning ppc_md. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64/kernel/udbg.c')
-rw-r--r--arch/ppc64/kernel/udbg.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/ppc64/kernel/udbg.c b/arch/ppc64/kernel/udbg.c
index 67e208500aea..2f82e7d7902b 100644
--- a/arch/ppc64/kernel/udbg.c
+++ b/arch/ppc64/kernel/udbg.c
@@ -20,14 +20,18 @@
20#include <asm/io.h> 20#include <asm/io.h>
21#include <asm/prom.h> 21#include <asm/prom.h>
22 22
23void (*udbg_putc)(unsigned char c);
24unsigned char (*udbg_getc)(void);
25int (*udbg_getc_poll)(void);
26
23void udbg_puts(const char *s) 27void udbg_puts(const char *s)
24{ 28{
25 if (ppc_md.udbg_putc) { 29 if (udbg_putc) {
26 char c; 30 char c;
27 31
28 if (s && *s != '\0') { 32 if (s && *s != '\0') {
29 while ((c = *s++) != '\0') 33 while ((c = *s++) != '\0')
30 ppc_md.udbg_putc(c); 34 udbg_putc(c);
31 } 35 }
32 } 36 }
33#if 0 37#if 0
@@ -42,12 +46,12 @@ int udbg_write(const char *s, int n)
42 int remain = n; 46 int remain = n;
43 char c; 47 char c;
44 48
45 if (!ppc_md.udbg_putc) 49 if (!udbg_putc)
46 return 0; 50 return 0;
47 51
48 if (s && *s != '\0') { 52 if (s && *s != '\0') {
49 while (((c = *s++) != '\0') && (remain-- > 0)) { 53 while (((c = *s++) != '\0') && (remain-- > 0)) {
50 ppc_md.udbg_putc(c); 54 udbg_putc(c);
51 } 55 }
52 } 56 }
53 57
@@ -59,12 +63,12 @@ int udbg_read(char *buf, int buflen)
59 char c, *p = buf; 63 char c, *p = buf;
60 int i; 64 int i;
61 65
62 if (!ppc_md.udbg_getc) 66 if (!udbg_getc)
63 return 0; 67 return 0;
64 68
65 for (i = 0; i < buflen; ++i) { 69 for (i = 0; i < buflen; ++i) {
66 do { 70 do {
67 c = ppc_md.udbg_getc(); 71 c = udbg_getc();
68 } while (c == 0x11 || c == 0x13); 72 } while (c == 0x11 || c == 0x13);
69 if (c == 0) 73 if (c == 0)
70 break; 74 break;