diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-05-26 18:31:00 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-27 04:11:35 -0400 |
commit | 0922abdc3982ae54cbe1b24ac5aa91a260eca1bb (patch) | |
tree | 3107fc3f1af7e4a1fd6edd78957c40486153990c /drivers | |
parent | 0acf10d8fbd52926217d3933d196b33fe2468f18 (diff) |
xen: make early console also write to debug console
When using "earlyprintk=xen", also write the console output to the raw
debug console. This will appear on dom0's console if the hypervisor
has been compiled to allow it.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/hvc_xen.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/char/hvc_xen.c b/drivers/char/hvc_xen.c index e97d9d168325..2413af342a81 100644 --- a/drivers/char/hvc_xen.c +++ b/drivers/char/hvc_xen.c | |||
@@ -134,12 +134,27 @@ module_init(xen_init); | |||
134 | module_exit(xen_fini); | 134 | module_exit(xen_fini); |
135 | console_initcall(xen_cons_init); | 135 | console_initcall(xen_cons_init); |
136 | 136 | ||
137 | static void raw_console_write(const char *str, int len) | ||
138 | { | ||
139 | while(len > 0) { | ||
140 | int rc = HYPERVISOR_console_io(CONSOLEIO_write, len, (char *)str); | ||
141 | if (rc <= 0) | ||
142 | break; | ||
143 | |||
144 | str += rc; | ||
145 | len -= rc; | ||
146 | } | ||
147 | } | ||
148 | |||
149 | #ifdef CONFIG_EARLY_PRINTK | ||
137 | static void xenboot_write_console(struct console *console, const char *string, | 150 | static void xenboot_write_console(struct console *console, const char *string, |
138 | unsigned len) | 151 | unsigned len) |
139 | { | 152 | { |
140 | unsigned int linelen, off = 0; | 153 | unsigned int linelen, off = 0; |
141 | const char *pos; | 154 | const char *pos; |
142 | 155 | ||
156 | raw_console_write(string, len); | ||
157 | |||
143 | while (off < len && NULL != (pos = strchr(string+off, '\n'))) { | 158 | while (off < len && NULL != (pos = strchr(string+off, '\n'))) { |
144 | linelen = pos-string+off; | 159 | linelen = pos-string+off; |
145 | if (off + linelen > len) | 160 | if (off + linelen > len) |
@@ -155,21 +170,13 @@ static void xenboot_write_console(struct console *console, const char *string, | |||
155 | struct console xenboot_console = { | 170 | struct console xenboot_console = { |
156 | .name = "xenboot", | 171 | .name = "xenboot", |
157 | .write = xenboot_write_console, | 172 | .write = xenboot_write_console, |
158 | .flags = CON_PRINTBUFFER | CON_BOOT, | 173 | .flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME, |
159 | }; | 174 | }; |
175 | #endif /* CONFIG_EARLY_PRINTK */ | ||
160 | 176 | ||
161 | void xen_raw_console_write(const char *str) | 177 | void xen_raw_console_write(const char *str) |
162 | { | 178 | { |
163 | int len = strlen(str); | 179 | raw_console_write(str, strlen(str)); |
164 | |||
165 | while(len > 0) { | ||
166 | int rc = HYPERVISOR_console_io(CONSOLEIO_write, len, (char *)str); | ||
167 | if (rc <= 0) | ||
168 | break; | ||
169 | |||
170 | str += rc; | ||
171 | len -= rc; | ||
172 | } | ||
173 | } | 180 | } |
174 | 181 | ||
175 | void xen_raw_printk(const char *fmt, ...) | 182 | void xen_raw_printk(const char *fmt, ...) |