migration/rdma: Plug memory leaks in qemu_rdma_registration_stop()
[qemu/armbru.git] / tests / tcg / aarch64 / system / semiconsole.c
blobbfe7c9e26b43301a0385b9feb14c38ccbfb2ca2e
1 /*
2 * Semihosting Console Test
4 * Copyright (c) 2019 Linaro Ltd
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
9 #include <inttypes.h>
10 #include <minilib.h>
12 #define SYS_READC 0x7
14 uintptr_t __semi_call(uintptr_t type, uintptr_t arg0)
16 register uintptr_t t asm("x0") = type;
17 register uintptr_t a0 asm("x1") = arg0;
18 asm("hlt 0xf000"
19 : "=r" (t)
20 : "r" (t), "r" (a0));
22 return t;
25 int main(void)
27 char c;
29 ml_printf("Semihosting Console Test\n");
30 ml_printf("hit X to exit:");
32 do {
33 c = __semi_call(SYS_READC, 0);
34 __sys_outc(c);
35 } while (c != 'X');
37 return 0;