Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git] / tests / tcg / multiarch / arm-compat-semi / semiconsole.c
blob1d82efc589dbc5d6b775e753e4700fc26ed3b823
1 /*
2 * linux-user semihosting console
4 * Copyright (c) 2019
5 * Written by Alex Bennée <alex.bennee@linaro.org>
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 */
10 #define SYS_READC 0x07
12 #include <stdio.h>
13 #include <stdint.h>
14 #include "semicall.h"
16 int main(void)
18 char c;
20 printf("Semihosting Console Test\n");
21 printf("hit X to exit:");
23 do {
24 c = __semi_call(SYS_READC, 0);
25 printf("got '%c'\n", c);
26 } while (c != 'X');
28 return 0;