1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2022 tinylab.org
4 * Author: Bin Meng <bmeng@tinylab.org>
7 #ifndef _RISCV_SEMIHOST_H_
8 #define _RISCV_SEMIHOST_H_
12 static inline void smh_putc(struct uart_port
*port
, unsigned char c
)
14 asm volatile("addi a1, %0, 0\n"
19 "slli zero, zero, 0x1f\n"
21 "srai zero, zero, 0x7\n"
23 : : "r" (&c
) : "a0", "a1", "memory");
26 #endif /* _RISCV_SEMIHOST_H_ */