aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/hvc/hvc_xen.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/hvc/hvc_xen.c')
-rw-r--r--drivers/tty/hvc/hvc_xen.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index c193af6a628f..636c9baad7a5 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -183,7 +183,7 @@ static int dom0_write_console(uint32_t vtermno, const char *str, int len)
183{ 183{
184 int rc = HYPERVISOR_console_io(CONSOLEIO_write, len, (char *)str); 184 int rc = HYPERVISOR_console_io(CONSOLEIO_write, len, (char *)str);
185 if (rc < 0) 185 if (rc < 0)
186 return 0; 186 return rc;
187 187
188 return len; 188 return len;
189} 189}
@@ -642,7 +642,22 @@ struct console xenboot_console = {
642 642
643void xen_raw_console_write(const char *str) 643void xen_raw_console_write(const char *str)
644{ 644{
645 dom0_write_console(0, str, strlen(str)); 645 ssize_t len = strlen(str);
646 int rc = 0;
647
648 if (xen_domain()) {
649 rc = dom0_write_console(0, str, len);
650#ifdef CONFIG_X86
651 if (rc == -ENOSYS && xen_hvm_domain())
652 goto outb_print;
653
654 } else if (xen_cpuid_base()) {
655 int i;
656outb_print:
657 for (i = 0; i < len; i++)
658 outb(str[i], 0xe9);
659#endif
660 }
646} 661}
647 662
648void xen_raw_printk(const char *fmt, ...) 663void xen_raw_printk(const char *fmt, ...)