xref: /optee_os/core/arch/riscv/kernel/semihosting_rv.S (revision 6d716a4b4588d0f73662e3b2527b92a12a877bc5)
1/* SPDX-License-Identifier: BSD-2-Clause */
2/*
3 * Copyright (c) 2024 Andes Technology Corporation
4 */
5
6#include <asm.S>
7
8/*
9 * uintptr_t __do_semihosting(uintptr_t op, uintptr_t arg)
10 *
11 * Refer to RISC-V Semihosting Binary Interface:
12 * https://github.com/riscv-non-isa/riscv-semihosting/blob/main/binary-interface.adoc
13 */
14FUNC __do_semihosting , : , .identity_map
15.option push
16.option norvc
17	slli	x0, x0, 0x1f
18	ebreak
19	srai    x0, x0, 0x7
20.option pop
21	ret
22END_FUNC __do_semihosting
23