From 392e8802486cb573b916e746010e141a75f507e6 Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 15 Nov 2014 09:58:27 +0800 Subject: init android origin source code --- ANDROID_3.4.5/arch/mips/dec/promcon.c | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 ANDROID_3.4.5/arch/mips/dec/promcon.c (limited to 'ANDROID_3.4.5/arch/mips/dec/promcon.c') diff --git a/ANDROID_3.4.5/arch/mips/dec/promcon.c b/ANDROID_3.4.5/arch/mips/dec/promcon.c new file mode 100644 index 00000000..c239c25b --- /dev/null +++ b/ANDROID_3.4.5/arch/mips/dec/promcon.c @@ -0,0 +1,54 @@ +/* + * Wrap-around code for a console using the + * DECstation PROM io-routines. + * + * Copyright (c) 1998 Harald Koerfgen + */ + +#include +#include +#include +#include +#include + +#include + +static void prom_console_write(struct console *co, const char *s, + unsigned count) +{ + unsigned i; + + /* + * Now, do each character + */ + for (i = 0; i < count; i++) { + if (*s == 10) + prom_printf("%c", 13); + prom_printf("%c", *s++); + } +} + +static int __init prom_console_setup(struct console *co, char *options) +{ + return 0; +} + +static struct console sercons = { + .name = "ttyS", + .write = prom_console_write, + .setup = prom_console_setup, + .flags = CON_PRINTBUFFER, + .index = -1, +}; + +/* + * Register console. + */ + +static int __init prom_console_init(void) +{ + register_console(&sercons); + + return 0; +} +console_initcall(prom_console_init); -- cgit