Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / tests / tcg / arm / semicall.h
blob624937c557711ff22ddf553b5588039070b3e99a
1 /*
2 * Semihosting Tests - ARM Helper
4 * Copyright (c) 2019, 2024
5 * Written by Alex Bennée <alex.bennee@linaro.org>
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
10 uintptr_t __semi_call(uintptr_t type, uintptr_t arg0)
12 register uintptr_t t asm("r0") = type;
13 register uintptr_t a0 asm("r1") = arg0;
14 #ifdef __thumb__
15 # define SVC "svc 0xab"
16 #else
17 # define SVC "svc 0x123456"
18 #endif
19 asm(SVC : "=r" (t)
20 : "r" (t), "r" (a0));
21 return t;