mirror of
https://github.com/torvalds/linux.git
synced 2026-11-29 10:07:52 +00:00
Move smh_putc() variants in respective arch/*/include/asm/semihost.h, in preparation to add RISC-V support. Signed-off-by: Bin Meng <[email protected]> Tested-by: Sergey Matyukevich <[email protected]> Acked-by: Palmer Dabbelt <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
25 lines
537 B
C
25 lines
537 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (C) 2012 ARM Ltd.
|
|
* Author: Marc Zyngier <[email protected]>
|
|
*
|
|
* Adapted for ARM and earlycon:
|
|
* Copyright (C) 2014 Linaro Ltd.
|
|
* Author: Rob Herring <[email protected]>
|
|
*/
|
|
|
|
#ifndef _ARM64_SEMIHOST_H_
|
|
#define _ARM64_SEMIHOST_H_
|
|
|
|
struct uart_port;
|
|
|
|
static inline void smh_putc(struct uart_port *port, unsigned char c)
|
|
{
|
|
asm volatile("mov x1, %0\n"
|
|
"mov x0, #3\n"
|
|
"hlt 0xf000\n"
|
|
: : "r" (&c) : "x0", "x1", "memory");
|
|
}
|
|
|
|
#endif /* _ARM64_SEMIHOST_H_ */
|