aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/prom/console_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/prom/console_64.c')
-rw-r--r--arch/sparc/prom/console_64.c48
1 files changed, 37 insertions, 11 deletions
diff --git a/arch/sparc/prom/console_64.c b/arch/sparc/prom/console_64.c
index f55d58a8a156..10322dc2f557 100644
--- a/arch/sparc/prom/console_64.c
+++ b/arch/sparc/prom/console_64.c
@@ -21,14 +21,22 @@ extern int prom_stdin, prom_stdout;
21inline int 21inline int
22prom_nbgetchar(void) 22prom_nbgetchar(void)
23{ 23{
24 unsigned long args[7];
24 char inc; 25 char inc;
25 26
26 if (p1275_cmd("read", P1275_ARG(1,P1275_ARG_OUT_BUF)| 27 args[0] = (unsigned long) "read";
27 P1275_INOUT(3,1), 28 args[1] = 3;
28 prom_stdin, &inc, P1275_SIZE(1)) == 1) 29 args[2] = 1;
30 args[3] = (unsigned int) prom_stdin;
31 args[4] = (unsigned long) &inc;
32 args[5] = 1;
33 args[6] = (unsigned long) -1;
34
35 p1275_cmd_direct(args);
36
37 if (args[6] == 1)
29 return inc; 38 return inc;
30 else 39 return -1;
31 return -1;
32} 40}
33 41
34/* Non blocking put character to console device, returns -1 if 42/* Non blocking put character to console device, returns -1 if
@@ -37,12 +45,22 @@ prom_nbgetchar(void)
37inline int 45inline int
38prom_nbputchar(char c) 46prom_nbputchar(char c)
39{ 47{
48 unsigned long args[7];
40 char outc; 49 char outc;
41 50
42 outc = c; 51 outc = c;
43 if (p1275_cmd("write", P1275_ARG(1,P1275_ARG_IN_BUF)| 52
44 P1275_INOUT(3,1), 53 args[0] = (unsigned long) "write";
45 prom_stdout, &outc, P1275_SIZE(1)) == 1) 54 args[1] = 3;
55 args[2] = 1;
56 args[3] = (unsigned int) prom_stdout;
57 args[4] = (unsigned long) &outc;
58 args[5] = 1;
59 args[6] = (unsigned long) -1;
60
61 p1275_cmd_direct(args);
62
63 if (args[6] == 1)
46 return 0; 64 return 0;
47 else 65 else
48 return -1; 66 return -1;
@@ -67,7 +85,15 @@ prom_putchar(char c)
67void 85void
68prom_puts(const char *s, int len) 86prom_puts(const char *s, int len)
69{ 87{
70 p1275_cmd("write", P1275_ARG(1,P1275_ARG_IN_BUF)| 88 unsigned long args[7];
71 P1275_INOUT(3,1), 89
72 prom_stdout, s, P1275_SIZE(len)); 90 args[0] = (unsigned long) "write";
91 args[1] = 3;
92 args[2] = 1;
93 args[3] = (unsigned int) prom_stdout;
94 args[4] = (unsigned long) s;
95 args[5] = len;
96 args[6] = (unsigned long) -1;
97
98 p1275_cmd_direct(args);
73} 99}