more changes on original files
[linux-2.4.git] / arch / mips / dec / promcon.c
1 /*
2  * Wrap-around code for a console using the
3  * DECstation PROM io-routines.
4  *
5  * Copyright (c) 1998 Harald Koerfgen
6  */
7
8 #include <linux/tty.h>
9 #include <linux/major.h>
10 #include <linux/ptrace.h>
11 #include <linux/init.h>
12 #include <linux/console.h>
13 #include <linux/fs.h>
14
15 #include <asm/dec/prom.h>
16
17 static void prom_console_write(struct console *co, const char *s,
18                                unsigned count)
19 {
20     unsigned i;
21
22     /*
23      *    Now, do each character
24      */
25     for (i = 0; i < count; i++) {
26         if (*s == 10)
27             prom_printf("%c", 13);
28         prom_printf("%c", *s++);
29     }
30 }
31
32 static int __init prom_console_setup(struct console *co, char *options)
33 {
34     return 0;
35 }
36
37 static kdev_t prom_console_device(struct console *c)
38 {
39     return MKDEV(TTY_MAJOR, 64 + c->index);
40 }
41
42 static struct console sercons =
43 {
44     .name       = "ttyS",
45     .write      = prom_console_write,
46     .device     = prom_console_device,
47     .setup      = prom_console_setup,
48     .flags      = CON_PRINTBUFFER,
49     .index      = -1,
50 };
51
52 /*
53  *    Register console.
54  */
55
56 long __init prom_console_init(long kmem_start, long kmem_end)
57 {
58     register_console(&sercons);
59     return kmem_start;
60 }