提交 0acf10d8 编写于 作者: J Jeremy Fitzhardinge 提交者: Thomas Gleixner

xen: add raw console write functions for debug

Add a couple of functions which can write directly to the Xen console
for debugging.  This output ends up on the host's dom0 console
(assuming it allows the domain to write there).
Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 3843fc25
...@@ -157,3 +157,29 @@ struct console xenboot_console = { ...@@ -157,3 +157,29 @@ struct console xenboot_console = {
.write = xenboot_write_console, .write = xenboot_write_console,
.flags = CON_PRINTBUFFER | CON_BOOT, .flags = CON_PRINTBUFFER | CON_BOOT,
}; };
void xen_raw_console_write(const char *str)
{
int len = strlen(str);
while(len > 0) {
int rc = HYPERVISOR_console_io(CONSOLEIO_write, len, (char *)str);
if (rc <= 0)
break;
str += rc;
len -= rc;
}
}
void xen_raw_printk(const char *fmt, ...)
{
static char buf[512];
va_list ap;
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
xen_raw_console_write(buf);
}
...@@ -3,4 +3,7 @@ ...@@ -3,4 +3,7 @@
extern struct console xenboot_console; extern struct console xenboot_console;
void xen_raw_console_write(const char *str);
void xen_raw_printk(const char *fmt, ...);
#endif /* XEN_HVC_CONSOLE_H */ #endif /* XEN_HVC_CONSOLE_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册