2019-12-19 15:13:44 +03:00
|
|
|
/*
|
|
|
|
* linux-user semihosting console
|
|
|
|
*
|
|
|
|
* Copyright (c) 2019
|
|
|
|
* Written by Alex Bennée <alex.bennee@linaro.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*/
|
|
|
|
|
2021-03-23 19:52:51 +03:00
|
|
|
#define SYS_READC 0x07
|
|
|
|
|
2019-12-19 15:13:44 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "semicall.h"
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
char c;
|
|
|
|
|
|
|
|
printf("Semihosting Console Test\n");
|
|
|
|
printf("hit X to exit:");
|
|
|
|
|
|
|
|
do {
|
|
|
|
c = __semi_call(SYS_READC, 0);
|
|
|
|
printf("got '%c'\n", c);
|
|
|
|
} while (c != 'X');
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|