xref: /openbmc/qemu/tests/tcg/aarch64/semicall.h (revision ee48fef0)
1 /*
2  * Semihosting Tests - AArch64 helper
3  *
4  * Copyright (c) 2019, 2024
5  * Written by Alex Bennée <alex.bennee@linaro.org>
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 uintptr_t __semi_call(uintptr_t type, uintptr_t arg0)
11 {
12     register uintptr_t t asm("x0") = type;
13     register uintptr_t a0 asm("x1") = arg0;
14     asm("hlt 0xf000"
15         : "=r" (t)
16         : "r" (t), "r" (a0));
17     return t;
18 }
19