]> Git Repo - linux.git/blame - arch/mips/kernel/early_printk.c
Merge branch 'xen-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen
[linux.git] / arch / mips / kernel / early_printk.c
CommitLineData
36a88530
RB
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 * Copyright (C) 2002, 2003, 06, 07 Ralf Baechle ([email protected])
7 * Copyright (C) 2007 MIPS Technologies, Inc.
8 * written by Ralf Baechle ([email protected])
9 */
10#include <linux/console.h>
11#include <linux/init.h>
12
13extern void prom_putchar(char);
14
ca4437d4
FBH
15static void __init
16early_console_write(struct console *con, const char *s, unsigned n)
36a88530
RB
17{
18 while (n-- && *s) {
19 if (*s == '\n')
20 prom_putchar('\r');
21 prom_putchar(*s);
22 s++;
23 }
24}
25
ca4437d4 26static struct console early_console __initdata = {
36a88530
RB
27 .name = "early",
28 .write = early_console_write,
29 .flags = CON_PRINTBUFFER | CON_BOOT,
30 .index = -1
31};
32
36ea1d57
FBH
33static int early_console_initialized __initdata;
34
36a88530
RB
35void __init setup_early_printk(void)
36{
36ea1d57
FBH
37 if (early_console_initialized)
38 return;
39 early_console_initialized = 1;
40
36a88530
RB
41 register_console(&early_console);
42}
This page took 0.120721 seconds and 4 git commands to generate.