aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/pdc_cons.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/kernel/pdc_cons.c')
-rw-r--r--arch/parisc/kernel/pdc_cons.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
index 33b1f84441b1..ccb68090781e 100644
--- a/arch/parisc/kernel/pdc_cons.c
+++ b/arch/parisc/kernel/pdc_cons.c
@@ -52,28 +52,30 @@
52#include <linux/tty.h> 52#include <linux/tty.h>
53#include <asm/pdc.h> /* for iodc_call() proto and friends */ 53#include <asm/pdc.h> /* for iodc_call() proto and friends */
54 54
55static spinlock_t pdc_console_lock = SPIN_LOCK_UNLOCKED;
55 56
56static void pdc_console_write(struct console *co, const char *s, unsigned count) 57static void pdc_console_write(struct console *co, const char *s, unsigned count)
57{ 58{
58 pdc_iodc_print(s, count); 59 int i = 0;
60 unsigned long flags;
61
62 spin_lock_irqsave(&pdc_console_lock, flags);
63 do {
64 i += pdc_iodc_print(s + i, count - i);
65 } while (i < count);
66 spin_unlock_irqrestore(&pdc_console_lock, flags);
59} 67}
60 68
61void pdc_printf(const char *fmt, ...) 69int pdc_console_poll_key(struct console *co)
62{ 70{
63 va_list args; 71 int c;
64 char buf[1024]; 72 unsigned long flags;
65 int i, len;
66
67 va_start(args, fmt);
68 len = vscnprintf(buf, sizeof(buf), fmt, args);
69 va_end(args);
70 73
71 pdc_iodc_print(buf, len); 74 spin_lock_irqsave(&pdc_console_lock, flags);
72} 75 c = pdc_iodc_getc();
76 spin_unlock_irqrestore(&pdc_console_lock, flags);
73 77
74int pdc_console_poll_key(struct console *co) 78 return c;
75{
76 return pdc_iodc_getc();
77} 79}
78 80
79static int pdc_console_setup(struct console *co, char *options) 81static int pdc_console_setup(struct console *co, char *options)