This source file includes following definitions.
- early_console_write
- setup_early_printk
1
2
3
4
5
6
7
8
9
10 #include <linux/kernel.h>
11 #include <linux/console.h>
12 #include <linux/printk.h>
13 #include <linux/init.h>
14
15 #include <asm/setup.h>
16
17 static void early_console_write(struct console *con, const char *s, unsigned n)
18 {
19 while (n-- && *s) {
20 if (*s == '\n')
21 prom_putchar('\r');
22 prom_putchar(*s);
23 s++;
24 }
25 }
26
27 static struct console early_console_prom = {
28 .name = "early",
29 .write = early_console_write,
30 .flags = CON_PRINTBUFFER | CON_BOOT,
31 .index = -1
32 };
33
34 void __init setup_early_printk(void)
35 {
36 if (early_console)
37 return;
38 early_console = &early_console_prom;
39
40 register_console(&early_console_prom);
41 }