6 static struct console_device
*console
;
8 int printf (const char *fmt
, ...)
12 char printbuffer
[CFG_PBSIZE
];
16 /* For this to work, printbuffer must be larger than
17 * anything we ever want to print.
19 i
= vsprintf (printbuffer
, fmt
, args
);
22 /* Print the string */
27 EXPORT_SYMBOL(printf
);
29 int vprintf (const char *fmt
, va_list args
)
32 char printbuffer
[CFG_PBSIZE
];
34 /* For this to work, printbuffer must be larger than
35 * anything we ever want to print.
37 i
= vsprintf (printbuffer
, fmt
, args
);
39 /* Print the string */
44 EXPORT_SYMBOL(vprintf
);
46 void console_puts(unsigned int ch
, const char *str
)
52 console_putc(ch
, '\r');
56 EXPORT_SYMBOL(console_puts
);
58 void console_putc(unsigned int ch
, char c
)
63 console
->putc(console
, c
);
65 console
->putc(console
, '\r');
67 EXPORT_SYMBOL(console_putc
);
69 int fputc(int fd
, char c
)
76 return write(fd
, &c
, 1);
81 int fputs(int fd
, const char *s
)
88 return write(fd
, s
, strlen(s
));
98 return console
->tstc(console
);
106 return console
->getc(console
);
110 void console_flush(void)
112 if (console
&& console
->flush
)
113 console
->flush(console
);
115 EXPORT_SYMBOL(console_flush
);
117 #ifndef ARCH_HAS_CTRLC
118 /* test if ctrl-c was pressed */
121 if (tstc() && getc() == 3)
125 EXPORT_SYMBOL(ctrlc
);
126 #endif /* ARCH_HAS_CTRC */
128 int console_register(struct console_device
*newcdev
)