mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-22 09:19:56 +07:00
5c93316c8c
prom_putchar() is used centrally in early printk infrastructure therefore at least MIPS should agree on the function return type. [paul.burton@mips.com: - Include linux/types.h in asm/setup.h to gain the bool typedef before we start include asm/setup.h elsewhere. - Include asm/setup.h in all files that use or define prom_putchar(). - Also standardise on signed rather than unsigned char argument.] Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com> Signed-off-by: Paul Burton <paul.burton@mips.com> Patchwork: https://patchwork.linux-mips.org/patch/19842/ Cc: linux-mips@linux-mips.org Cc: Ralf Baechle <ralf@linux-mips.org> Cc: James Hogan <jhogan@kernel.org> Cc: Jonas Gorski <jonas.gorski@gmail.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com>
40 lines
863 B
C
40 lines
863 B
C
/*
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
* for more details.
|
|
*
|
|
* Copyright (C) 2013 Cavium, Inc.
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/virtio_console.h>
|
|
#include <linux/kvm_para.h>
|
|
#include <asm/setup.h>
|
|
|
|
/*
|
|
* Emit one character to the boot console.
|
|
*/
|
|
void prom_putchar(char c)
|
|
{
|
|
kvm_hypercall3(KVM_HC_MIPS_CONSOLE_OUTPUT, 0 /* port 0 */,
|
|
(unsigned long)&c, 1 /* len == 1 */);
|
|
}
|
|
|
|
#ifdef CONFIG_VIRTIO_CONSOLE
|
|
static int paravirt_put_chars(u32 vtermno, const char *buf, int count)
|
|
{
|
|
kvm_hypercall3(KVM_HC_MIPS_CONSOLE_OUTPUT, vtermno,
|
|
(unsigned long)buf, count);
|
|
|
|
return count;
|
|
}
|
|
|
|
static int __init paravirt_cons_init(void)
|
|
{
|
|
virtio_cons_early_init(paravirt_put_chars);
|
|
return 0;
|
|
}
|
|
core_initcall(paravirt_cons_init);
|
|
|
|
#endif
|