- Linus: more PageDirty / swapcache handling
[davej-history.git] / arch / mips64 / sgi-ip27 / ip27-console.c
blobfa3ffb1cb2849cabe6a48ff35030c478628dab8e
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 */
6 #include <linux/init.h>
7 #include <linux/console.h>
8 #include <linux/kdev_t.h>
9 #include <linux/major.h>
10 #include <asm/sn/addrs.h>
11 #include <asm/sn/sn0/hub.h>
12 #include <asm/sn/klconfig.h>
13 #include <asm/sn/ioc3.h>
14 #include <asm/sgialib.h>
15 #include <asm/sn/sn_private.h>
17 void prom_putchar(char c)
19 struct ioc3 *ioc3;
20 struct ioc3_uartregs *uart;
22 ioc3 = (struct ioc3 *)KL_CONFIG_CH_CONS_INFO(master_nasid)->memory_base;
23 uart = &ioc3->sregs.uarta;
25 while ((uart->iu_lsr & 0x20) == 0);
26 uart->iu_thr = c;
29 char __init prom_getchar(void)
31 return 0;
34 static void
35 ip27prom_console_write(struct console *con, const char *s, unsigned n)
37 prom_printf("%s", s);
40 static kdev_t
41 ip27prom_console_dev(struct console *c)
43 return MKDEV(TTY_MAJOR, 64 + c->index);
46 static struct console ip27_prom_console = {
47 name: "prom",
48 write: ip27prom_console_write,
49 device: ip27prom_console_dev,
50 flags: CON_PRINTBUFFER,
51 index: -1,
54 __init void ip27_setup_console(void)
56 register_console(&ip27_prom_console);