This source file includes following definitions.
- early_ocd_write
- setup_early_printk
1
2
3
4
5
6
7
8
9 #include <linux/console.h>
10 #include <linux/init.h>
11 #include <linux/string.h>
12 #include <mach/ocd.h>
13
14
15
16 static void early_ocd_write(struct console *con, const char *s, unsigned n)
17 {
18 while (*s && n-- > 0) {
19 if (*s == '\n')
20 ocd_putc((int)'\r');
21 ocd_putc((int)*s);
22 s++;
23 }
24 }
25
26 static struct console early_ocd_console = {
27 .name = "earlyocd",
28 .write = early_ocd_write,
29 .flags = CON_PRINTBUFFER,
30 .index = -1,
31 };
32
33 static int __init setup_early_printk(char *buf)
34 {
35 if (!buf || early_console)
36 return 0;
37
38 early_console = &early_ocd_console;
39 if (strstr(buf, "keep"))
40 early_console->flags &= ~CON_BOOT;
41 else
42 early_console->flags |= CON_BOOT;
43 register_console(early_console);
44 return 0;
45 }
46 early_param("earlyprintk", setup_early_printk);