Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / mips / paravirt / serial.c
blob02b665c022721e73f66ce0c586d0ef911e69e02a
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
6 * Copyright (C) 2013 Cavium, Inc.
7 */
9 #include <linux/kernel.h>
10 #include <linux/virtio_console.h>
11 #include <linux/kvm_para.h>
14 * Emit one character to the boot console.
16 int prom_putchar(char c)
18 kvm_hypercall3(KVM_HC_MIPS_CONSOLE_OUTPUT, 0 /* port 0 */,
19 (unsigned long)&c, 1 /* len == 1 */);
21 return 1;
24 #ifdef CONFIG_VIRTIO_CONSOLE
25 static int paravirt_put_chars(u32 vtermno, const char *buf, int count)
27 kvm_hypercall3(KVM_HC_MIPS_CONSOLE_OUTPUT, vtermno,
28 (unsigned long)buf, count);
30 return count;
33 static int __init paravirt_cons_init(void)
35 virtio_cons_early_init(paravirt_put_chars);
36 return 0;
38 core_initcall(paravirt_cons_init);
40 #endif