GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / m68k / sun3 / prom / console.c
blobed72165aadfa78fa36b2cb83a4d1e87d03ec9975
1 /*
2 * console.c: Routines that deal with sending and receiving IO
3 * to/from the current console device using the PROM.
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
6 */
8 #include <linux/types.h>
9 #include <linux/kernel.h>
10 #include <linux/sched.h>
11 #include <asm/openprom.h>
12 #include <asm/oplib.h>
13 #include <asm/system.h>
14 #include <linux/string.h>
16 /* Non blocking get character from console input device, returns -1
17 * if no input was taken. This can be used for polling.
19 int
20 prom_nbgetchar(void)
22 int i = -1;
23 unsigned long flags;
25 local_irq_save(flags);
26 i = (*(romvec->pv_nbgetchar))();
27 local_irq_restore(flags);
28 return i; /* Ugh, we could spin forever on unsupported proms ;( */
31 /* Non blocking put character to console device, returns -1 if
32 * unsuccessful.
34 int
35 prom_nbputchar(char c)
37 unsigned long flags;
38 int i = -1;
40 local_irq_save(flags);
41 i = (*(romvec->pv_nbputchar))(c);
42 local_irq_restore(flags);
43 return i; /* Ugh, we could spin forever on unsupported proms ;( */
46 /* Blocking version of get character routine above. */
47 char
48 prom_getchar(void)
50 int character;
51 while((character = prom_nbgetchar()) == -1) ;
52 return (char) character;
55 /* Blocking version of put character routine above. */
56 void
57 prom_putchar(char c)
59 while(prom_nbputchar(c) == -1) ;
60 return;
63 /* Query for input device type */
65 /* Query for output device type */