diff options
-rw-r--r-- | arch/arm/kernel/early_printk.c | 17 | ||||
-rw-r--r-- | arch/blackfin/kernel/early_printk.c | 2 | ||||
-rw-r--r-- | arch/microblaze/kernel/early_printk.c | 26 | ||||
-rw-r--r-- | arch/mips/kernel/early_printk.c | 12 | ||||
-rw-r--r-- | arch/powerpc/kernel/udbg.c | 6 | ||||
-rw-r--r-- | arch/sh/kernel/sh_bios.c | 4 | ||||
-rw-r--r-- | arch/tile/kernel/early_printk.c | 27 | ||||
-rw-r--r-- | arch/um/kernel/early_printk.c | 8 | ||||
-rw-r--r-- | arch/unicore32/kernel/early_printk.c | 12 | ||||
-rw-r--r-- | arch/x86/kernel/early_printk.c | 21 | ||||
-rw-r--r-- | include/linux/console.h | 1 | ||||
-rw-r--r-- | include/linux/printk.h | 6 | ||||
-rw-r--r-- | kernel/printk.c | 30 |
13 files changed, 63 insertions, 109 deletions
diff --git a/arch/arm/kernel/early_printk.c b/arch/arm/kernel/early_printk.c index 85aa2b292692..43076536965c 100644 --- a/arch/arm/kernel/early_printk.c +++ b/arch/arm/kernel/early_printk.c | |||
@@ -29,28 +29,17 @@ static void early_console_write(struct console *con, const char *s, unsigned n) | |||
29 | early_write(s, n); | 29 | early_write(s, n); |
30 | } | 30 | } |
31 | 31 | ||
32 | static struct console early_console = { | 32 | static struct console early_console_dev = { |
33 | .name = "earlycon", | 33 | .name = "earlycon", |
34 | .write = early_console_write, | 34 | .write = early_console_write, |
35 | .flags = CON_PRINTBUFFER | CON_BOOT, | 35 | .flags = CON_PRINTBUFFER | CON_BOOT, |
36 | .index = -1, | 36 | .index = -1, |
37 | }; | 37 | }; |
38 | 38 | ||
39 | asmlinkage void early_printk(const char *fmt, ...) | ||
40 | { | ||
41 | char buf[512]; | ||
42 | int n; | ||
43 | va_list ap; | ||
44 | |||
45 | va_start(ap, fmt); | ||
46 | n = vscnprintf(buf, sizeof(buf), fmt, ap); | ||
47 | early_write(buf, n); | ||
48 | va_end(ap); | ||
49 | } | ||
50 | |||
51 | static int __init setup_early_printk(char *buf) | 39 | static int __init setup_early_printk(char *buf) |
52 | { | 40 | { |
53 | register_console(&early_console); | 41 | early_console = &early_console_dev; |
42 | register_console(&early_console_dev); | ||
54 | return 0; | 43 | return 0; |
55 | } | 44 | } |
56 | 45 | ||
diff --git a/arch/blackfin/kernel/early_printk.c b/arch/blackfin/kernel/early_printk.c index 84ed8375113c..61fbd2de993d 100644 --- a/arch/blackfin/kernel/early_printk.c +++ b/arch/blackfin/kernel/early_printk.c | |||
@@ -25,8 +25,6 @@ extern struct console *bfin_earlyserial_init(unsigned int port, | |||
25 | extern struct console *bfin_jc_early_init(void); | 25 | extern struct console *bfin_jc_early_init(void); |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | static struct console *early_console; | ||
29 | |||
30 | /* Default console */ | 28 | /* Default console */ |
31 | #define DEFAULT_PORT 0 | 29 | #define DEFAULT_PORT 0 |
32 | #define DEFAULT_CFLAG CS8|B57600 | 30 | #define DEFAULT_CFLAG CS8|B57600 |
diff --git a/arch/microblaze/kernel/early_printk.c b/arch/microblaze/kernel/early_printk.c index 60dcacc68038..365f2d53f1b2 100644 --- a/arch/microblaze/kernel/early_printk.c +++ b/arch/microblaze/kernel/early_printk.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <asm/setup.h> | 21 | #include <asm/setup.h> |
22 | #include <asm/prom.h> | 22 | #include <asm/prom.h> |
23 | 23 | ||
24 | static u32 early_console_initialized; | ||
25 | static u32 base_addr; | 24 | static u32 base_addr; |
26 | 25 | ||
27 | #ifdef CONFIG_SERIAL_UARTLITE_CONSOLE | 26 | #ifdef CONFIG_SERIAL_UARTLITE_CONSOLE |
@@ -109,27 +108,11 @@ static struct console early_serial_uart16550_console = { | |||
109 | }; | 108 | }; |
110 | #endif /* CONFIG_SERIAL_8250_CONSOLE */ | 109 | #endif /* CONFIG_SERIAL_8250_CONSOLE */ |
111 | 110 | ||
112 | static struct console *early_console; | ||
113 | |||
114 | void early_printk(const char *fmt, ...) | ||
115 | { | ||
116 | char buf[512]; | ||
117 | int n; | ||
118 | va_list ap; | ||
119 | |||
120 | if (early_console_initialized) { | ||
121 | va_start(ap, fmt); | ||
122 | n = vscnprintf(buf, 512, fmt, ap); | ||
123 | early_console->write(early_console, buf, n); | ||
124 | va_end(ap); | ||
125 | } | ||
126 | } | ||
127 | |||
128 | int __init setup_early_printk(char *opt) | 111 | int __init setup_early_printk(char *opt) |
129 | { | 112 | { |
130 | int version = 0; | 113 | int version = 0; |
131 | 114 | ||
132 | if (early_console_initialized) | 115 | if (early_console) |
133 | return 1; | 116 | return 1; |
134 | 117 | ||
135 | base_addr = of_early_console(&version); | 118 | base_addr = of_early_console(&version); |
@@ -159,7 +142,6 @@ int __init setup_early_printk(char *opt) | |||
159 | } | 142 | } |
160 | 143 | ||
161 | register_console(early_console); | 144 | register_console(early_console); |
162 | early_console_initialized = 1; | ||
163 | return 0; | 145 | return 0; |
164 | } | 146 | } |
165 | return 1; | 147 | return 1; |
@@ -169,7 +151,7 @@ int __init setup_early_printk(char *opt) | |||
169 | * only for early console because of performance degression */ | 151 | * only for early console because of performance degression */ |
170 | void __init remap_early_printk(void) | 152 | void __init remap_early_printk(void) |
171 | { | 153 | { |
172 | if (!early_console_initialized || !early_console) | 154 | if (!early_console) |
173 | return; | 155 | return; |
174 | pr_info("early_printk_console remapping from 0x%x to ", base_addr); | 156 | pr_info("early_printk_console remapping from 0x%x to ", base_addr); |
175 | base_addr = (u32) ioremap(base_addr, PAGE_SIZE); | 157 | base_addr = (u32) ioremap(base_addr, PAGE_SIZE); |
@@ -194,9 +176,9 @@ void __init remap_early_printk(void) | |||
194 | 176 | ||
195 | void __init disable_early_printk(void) | 177 | void __init disable_early_printk(void) |
196 | { | 178 | { |
197 | if (!early_console_initialized || !early_console) | 179 | if (!early_console) |
198 | return; | 180 | return; |
199 | pr_warn("disabling early console\n"); | 181 | pr_warn("disabling early console\n"); |
200 | unregister_console(early_console); | 182 | unregister_console(early_console); |
201 | early_console_initialized = 0; | 183 | early_console = NULL; |
202 | } | 184 | } |
diff --git a/arch/mips/kernel/early_printk.c b/arch/mips/kernel/early_printk.c index 9e6440eaa455..505cb77d1280 100644 --- a/arch/mips/kernel/early_printk.c +++ b/arch/mips/kernel/early_printk.c | |||
@@ -7,7 +7,9 @@ | |||
7 | * Copyright (C) 2007 MIPS Technologies, Inc. | 7 | * Copyright (C) 2007 MIPS Technologies, Inc. |
8 | * written by Ralf Baechle (ralf@linux-mips.org) | 8 | * written by Ralf Baechle (ralf@linux-mips.org) |
9 | */ | 9 | */ |
10 | #include <linux/kernel.h> | ||
10 | #include <linux/console.h> | 11 | #include <linux/console.h> |
12 | #include <linux/printk.h> | ||
11 | #include <linux/init.h> | 13 | #include <linux/init.h> |
12 | 14 | ||
13 | #include <asm/setup.h> | 15 | #include <asm/setup.h> |
@@ -24,20 +26,18 @@ static void early_console_write(struct console *con, const char *s, unsigned n) | |||
24 | } | 26 | } |
25 | } | 27 | } |
26 | 28 | ||
27 | static struct console early_console = { | 29 | static struct console early_console_prom = { |
28 | .name = "early", | 30 | .name = "early", |
29 | .write = early_console_write, | 31 | .write = early_console_write, |
30 | .flags = CON_PRINTBUFFER | CON_BOOT, | 32 | .flags = CON_PRINTBUFFER | CON_BOOT, |
31 | .index = -1 | 33 | .index = -1 |
32 | }; | 34 | }; |
33 | 35 | ||
34 | static int early_console_initialized __initdata; | ||
35 | |||
36 | void __init setup_early_printk(void) | 36 | void __init setup_early_printk(void) |
37 | { | 37 | { |
38 | if (early_console_initialized) | 38 | if (early_console) |
39 | return; | 39 | return; |
40 | early_console_initialized = 1; | 40 | early_console = &early_console_prom; |
41 | 41 | ||
42 | register_console(&early_console); | 42 | register_console(&early_console_prom); |
43 | } | 43 | } |
diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c index f9748498fe58..13b867093499 100644 --- a/arch/powerpc/kernel/udbg.c +++ b/arch/powerpc/kernel/udbg.c | |||
@@ -156,15 +156,13 @@ static struct console udbg_console = { | |||
156 | .index = 0, | 156 | .index = 0, |
157 | }; | 157 | }; |
158 | 158 | ||
159 | static int early_console_initialized; | ||
160 | |||
161 | /* | 159 | /* |
162 | * Called by setup_system after ppc_md->probe and ppc_md->early_init. | 160 | * Called by setup_system after ppc_md->probe and ppc_md->early_init. |
163 | * Call it again after setting udbg_putc in ppc_md->setup_arch. | 161 | * Call it again after setting udbg_putc in ppc_md->setup_arch. |
164 | */ | 162 | */ |
165 | void __init register_early_udbg_console(void) | 163 | void __init register_early_udbg_console(void) |
166 | { | 164 | { |
167 | if (early_console_initialized) | 165 | if (early_console) |
168 | return; | 166 | return; |
169 | 167 | ||
170 | if (!udbg_putc) | 168 | if (!udbg_putc) |
@@ -174,7 +172,7 @@ void __init register_early_udbg_console(void) | |||
174 | printk(KERN_INFO "early console immortal !\n"); | 172 | printk(KERN_INFO "early console immortal !\n"); |
175 | udbg_console.flags &= ~CON_BOOT; | 173 | udbg_console.flags &= ~CON_BOOT; |
176 | } | 174 | } |
177 | early_console_initialized = 1; | 175 | early_console = &udbg_console; |
178 | register_console(&udbg_console); | 176 | register_console(&udbg_console); |
179 | } | 177 | } |
180 | 178 | ||
diff --git a/arch/sh/kernel/sh_bios.c b/arch/sh/kernel/sh_bios.c index 47475cca068a..fe584e516964 100644 --- a/arch/sh/kernel/sh_bios.c +++ b/arch/sh/kernel/sh_bios.c | |||
@@ -104,6 +104,7 @@ void sh_bios_vbr_reload(void) | |||
104 | ); | 104 | ); |
105 | } | 105 | } |
106 | 106 | ||
107 | #ifdef CONFIG_EARLY_PRINTK | ||
107 | /* | 108 | /* |
108 | * Print a string through the BIOS | 109 | * Print a string through the BIOS |
109 | */ | 110 | */ |
@@ -144,8 +145,6 @@ static struct console bios_console = { | |||
144 | .index = -1, | 145 | .index = -1, |
145 | }; | 146 | }; |
146 | 147 | ||
147 | static struct console *early_console; | ||
148 | |||
149 | static int __init setup_early_printk(char *buf) | 148 | static int __init setup_early_printk(char *buf) |
150 | { | 149 | { |
151 | int keep_early = 0; | 150 | int keep_early = 0; |
@@ -170,3 +169,4 @@ static int __init setup_early_printk(char *buf) | |||
170 | return 0; | 169 | return 0; |
171 | } | 170 | } |
172 | early_param("earlyprintk", setup_early_printk); | 171 | early_param("earlyprintk", setup_early_printk); |
172 | #endif | ||
diff --git a/arch/tile/kernel/early_printk.c b/arch/tile/kernel/early_printk.c index afb9c9a0d887..34d72a151bf3 100644 --- a/arch/tile/kernel/early_printk.c +++ b/arch/tile/kernel/early_printk.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/string.h> | 18 | #include <linux/string.h> |
19 | #include <linux/irqflags.h> | 19 | #include <linux/irqflags.h> |
20 | #include <linux/printk.h> | ||
20 | #include <asm/setup.h> | 21 | #include <asm/setup.h> |
21 | #include <hv/hypervisor.h> | 22 | #include <hv/hypervisor.h> |
22 | 23 | ||
@@ -33,25 +34,8 @@ static struct console early_hv_console = { | |||
33 | }; | 34 | }; |
34 | 35 | ||
35 | /* Direct interface for emergencies */ | 36 | /* Direct interface for emergencies */ |
36 | static struct console *early_console = &early_hv_console; | ||
37 | static int early_console_initialized; | ||
38 | static int early_console_complete; | 37 | static int early_console_complete; |
39 | 38 | ||
40 | static void early_vprintk(const char *fmt, va_list ap) | ||
41 | { | ||
42 | char buf[512]; | ||
43 | int n = vscnprintf(buf, sizeof(buf), fmt, ap); | ||
44 | early_console->write(early_console, buf, n); | ||
45 | } | ||
46 | |||
47 | void early_printk(const char *fmt, ...) | ||
48 | { | ||
49 | va_list ap; | ||
50 | va_start(ap, fmt); | ||
51 | early_vprintk(fmt, ap); | ||
52 | va_end(ap); | ||
53 | } | ||
54 | |||
55 | void early_panic(const char *fmt, ...) | 39 | void early_panic(const char *fmt, ...) |
56 | { | 40 | { |
57 | va_list ap; | 41 | va_list ap; |
@@ -69,14 +53,13 @@ static int __initdata keep_early; | |||
69 | 53 | ||
70 | static int __init setup_early_printk(char *str) | 54 | static int __init setup_early_printk(char *str) |
71 | { | 55 | { |
72 | if (early_console_initialized) | 56 | if (early_console) |
73 | return 1; | 57 | return 1; |
74 | 58 | ||
75 | if (str != NULL && strncmp(str, "keep", 4) == 0) | 59 | if (str != NULL && strncmp(str, "keep", 4) == 0) |
76 | keep_early = 1; | 60 | keep_early = 1; |
77 | 61 | ||
78 | early_console = &early_hv_console; | 62 | early_console = &early_hv_console; |
79 | early_console_initialized = 1; | ||
80 | register_console(early_console); | 63 | register_console(early_console); |
81 | 64 | ||
82 | return 0; | 65 | return 0; |
@@ -85,12 +68,12 @@ static int __init setup_early_printk(char *str) | |||
85 | void __init disable_early_printk(void) | 68 | void __init disable_early_printk(void) |
86 | { | 69 | { |
87 | early_console_complete = 1; | 70 | early_console_complete = 1; |
88 | if (!early_console_initialized || !early_console) | 71 | if (!early_console) |
89 | return; | 72 | return; |
90 | if (!keep_early) { | 73 | if (!keep_early) { |
91 | early_printk("disabling early console\n"); | 74 | early_printk("disabling early console\n"); |
92 | unregister_console(early_console); | 75 | unregister_console(early_console); |
93 | early_console_initialized = 0; | 76 | early_console = NULL; |
94 | } else { | 77 | } else { |
95 | early_printk("keeping early console\n"); | 78 | early_printk("keeping early console\n"); |
96 | } | 79 | } |
@@ -98,7 +81,7 @@ void __init disable_early_printk(void) | |||
98 | 81 | ||
99 | void warn_early_printk(void) | 82 | void warn_early_printk(void) |
100 | { | 83 | { |
101 | if (early_console_complete || early_console_initialized) | 84 | if (early_console_complete || early_console) |
102 | return; | 85 | return; |
103 | early_printk("\ | 86 | early_printk("\ |
104 | Machine shutting down before console output is fully initialized.\n\ | 87 | Machine shutting down before console output is fully initialized.\n\ |
diff --git a/arch/um/kernel/early_printk.c b/arch/um/kernel/early_printk.c index 49480f092456..4a0800bc37b2 100644 --- a/arch/um/kernel/early_printk.c +++ b/arch/um/kernel/early_printk.c | |||
@@ -16,7 +16,7 @@ static void early_console_write(struct console *con, const char *s, unsigned int | |||
16 | um_early_printk(s, n); | 16 | um_early_printk(s, n); |
17 | } | 17 | } |
18 | 18 | ||
19 | static struct console early_console = { | 19 | static struct console early_console_dev = { |
20 | .name = "earlycon", | 20 | .name = "earlycon", |
21 | .write = early_console_write, | 21 | .write = early_console_write, |
22 | .flags = CON_BOOT, | 22 | .flags = CON_BOOT, |
@@ -25,8 +25,10 @@ static struct console early_console = { | |||
25 | 25 | ||
26 | static int __init setup_early_printk(char *buf) | 26 | static int __init setup_early_printk(char *buf) |
27 | { | 27 | { |
28 | register_console(&early_console); | 28 | if (!early_console) { |
29 | 29 | early_console = &early_console_dev; | |
30 | register_console(&early_console_dev); | ||
31 | } | ||
30 | return 0; | 32 | return 0; |
31 | } | 33 | } |
32 | 34 | ||
diff --git a/arch/unicore32/kernel/early_printk.c b/arch/unicore32/kernel/early_printk.c index 3922255f1fa8..9be0d5d02a9a 100644 --- a/arch/unicore32/kernel/early_printk.c +++ b/arch/unicore32/kernel/early_printk.c | |||
@@ -33,21 +33,17 @@ static struct console early_ocd_console = { | |||
33 | .index = -1, | 33 | .index = -1, |
34 | }; | 34 | }; |
35 | 35 | ||
36 | /* Direct interface for emergencies */ | ||
37 | static struct console *early_console = &early_ocd_console; | ||
38 | |||
39 | static int __initdata keep_early; | ||
40 | |||
41 | static int __init setup_early_printk(char *buf) | 36 | static int __init setup_early_printk(char *buf) |
42 | { | 37 | { |
43 | if (!buf) | 38 | int keep_early; |
39 | |||
40 | if (!buf || early_console) | ||
44 | return 0; | 41 | return 0; |
45 | 42 | ||
46 | if (strstr(buf, "keep")) | 43 | if (strstr(buf, "keep")) |
47 | keep_early = 1; | 44 | keep_early = 1; |
48 | 45 | ||
49 | if (!strncmp(buf, "ocd", 3)) | 46 | early_console = &early_ocd_console; |
50 | early_console = &early_ocd_console; | ||
51 | 47 | ||
52 | if (keep_early) | 48 | if (keep_early) |
53 | early_console->flags &= ~CON_BOOT; | 49 | early_console->flags &= ~CON_BOOT; |
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c index 9b9f18b49918..d15f575a861b 100644 --- a/arch/x86/kernel/early_printk.c +++ b/arch/x86/kernel/early_printk.c | |||
@@ -169,25 +169,9 @@ static struct console early_serial_console = { | |||
169 | .index = -1, | 169 | .index = -1, |
170 | }; | 170 | }; |
171 | 171 | ||
172 | /* Direct interface for emergencies */ | ||
173 | static struct console *early_console = &early_vga_console; | ||
174 | static int __initdata early_console_initialized; | ||
175 | |||
176 | asmlinkage void early_printk(const char *fmt, ...) | ||
177 | { | ||
178 | char buf[512]; | ||
179 | int n; | ||
180 | va_list ap; | ||
181 | |||
182 | va_start(ap, fmt); | ||
183 | n = vscnprintf(buf, sizeof(buf), fmt, ap); | ||
184 | early_console->write(early_console, buf, n); | ||
185 | va_end(ap); | ||
186 | } | ||
187 | |||
188 | static inline void early_console_register(struct console *con, int keep_early) | 172 | static inline void early_console_register(struct console *con, int keep_early) |
189 | { | 173 | { |
190 | if (early_console->index != -1) { | 174 | if (con->index != -1) { |
191 | printk(KERN_CRIT "ERROR: earlyprintk= %s already used\n", | 175 | printk(KERN_CRIT "ERROR: earlyprintk= %s already used\n", |
192 | con->name); | 176 | con->name); |
193 | return; | 177 | return; |
@@ -207,9 +191,8 @@ static int __init setup_early_printk(char *buf) | |||
207 | if (!buf) | 191 | if (!buf) |
208 | return 0; | 192 | return 0; |
209 | 193 | ||
210 | if (early_console_initialized) | 194 | if (early_console) |
211 | return 0; | 195 | return 0; |
212 | early_console_initialized = 1; | ||
213 | 196 | ||
214 | keep = (strstr(buf, "keep") != NULL); | 197 | keep = (strstr(buf, "keep") != NULL); |
215 | 198 | ||
diff --git a/include/linux/console.h b/include/linux/console.h index 29680a8cda99..73bab0f58af5 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -141,6 +141,7 @@ struct console { | |||
141 | for (con = console_drivers; con != NULL; con = con->next) | 141 | for (con = console_drivers; con != NULL; con = con->next) |
142 | 142 | ||
143 | extern int console_set_on_cmdline; | 143 | extern int console_set_on_cmdline; |
144 | extern struct console *early_console; | ||
144 | 145 | ||
145 | extern int add_preferred_console(char *name, int idx, char *options); | 146 | extern int add_preferred_console(char *name, int idx, char *options); |
146 | extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options); | 147 | extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options); |
diff --git a/include/linux/printk.h b/include/linux/printk.h index 822171fcb1c8..1c35c23bccd7 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -95,8 +95,14 @@ int no_printk(const char *fmt, ...) | |||
95 | return 0; | 95 | return 0; |
96 | } | 96 | } |
97 | 97 | ||
98 | #ifdef CONFIG_EARLY_PRINTK | ||
98 | extern asmlinkage __printf(1, 2) | 99 | extern asmlinkage __printf(1, 2) |
99 | void early_printk(const char *fmt, ...); | 100 | void early_printk(const char *fmt, ...); |
101 | void early_vprintk(const char *fmt, va_list ap); | ||
102 | #else | ||
103 | static inline __printf(1, 2) __cold | ||
104 | void early_printk(const char *s, ...) { } | ||
105 | #endif | ||
100 | 106 | ||
101 | #ifdef CONFIG_PRINTK | 107 | #ifdef CONFIG_PRINTK |
102 | asmlinkage __printf(5, 0) | 108 | asmlinkage __printf(5, 0) |
diff --git a/kernel/printk.c b/kernel/printk.c index 2de593df036b..1c8ca176458f 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -49,13 +49,6 @@ | |||
49 | #define CREATE_TRACE_POINTS | 49 | #define CREATE_TRACE_POINTS |
50 | #include <trace/events/printk.h> | 50 | #include <trace/events/printk.h> |
51 | 51 | ||
52 | /* | ||
53 | * Architectures can override it: | ||
54 | */ | ||
55 | void asmlinkage __attribute__((weak)) early_printk(const char *fmt, ...) | ||
56 | { | ||
57 | } | ||
58 | |||
59 | /* printk's without a loglevel use this.. */ | 52 | /* printk's without a loglevel use this.. */ |
60 | #define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL | 53 | #define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL |
61 | 54 | ||
@@ -1723,6 +1716,29 @@ static size_t cont_print_text(char *text, size_t size) { return 0; } | |||
1723 | 1716 | ||
1724 | #endif /* CONFIG_PRINTK */ | 1717 | #endif /* CONFIG_PRINTK */ |
1725 | 1718 | ||
1719 | #ifdef CONFIG_EARLY_PRINTK | ||
1720 | struct console *early_console; | ||
1721 | |||
1722 | void early_vprintk(const char *fmt, va_list ap) | ||
1723 | { | ||
1724 | if (early_console) { | ||
1725 | char buf[512]; | ||
1726 | int n = vscnprintf(buf, sizeof(buf), fmt, ap); | ||
1727 | |||
1728 | early_console->write(early_console, buf, n); | ||
1729 | } | ||
1730 | } | ||
1731 | |||
1732 | asmlinkage void early_printk(const char *fmt, ...) | ||
1733 | { | ||
1734 | va_list ap; | ||
1735 | |||
1736 | va_start(ap, fmt); | ||
1737 | early_vprintk(fmt, ap); | ||
1738 | va_end(ap); | ||
1739 | } | ||
1740 | #endif | ||
1741 | |||
1726 | static int __add_preferred_console(char *name, int idx, char *options, | 1742 | static int __add_preferred_console(char *name, int idx, char *options, |
1727 | char *brl_options) | 1743 | char *brl_options) |
1728 | { | 1744 | { |