提交 486e58b1 编写于 作者: A Alex Bennée

tests/tcg: add user version of dumb-as-bricks semiconsole test

There are linux-user users of semihosting so we'd better check things
work for them as well.
Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
上级 f0593809
......@@ -32,4 +32,11 @@ run-plugin-semihosting-with-%:
$(call strip-plugin,$<) 2> $<.err, \
"$< on $(TARGET_NAME) with $*")
AARCH64_TESTS += semiconsole
run-semiconsole: semiconsole
$(call skip-test, $<, "MANUAL ONLY")
run-plugin-semiconsole-with-%:
$(call skip-test, $<, "MANUAL ONLY")
TESTS += $(AARCH64_TESTS)
......@@ -49,6 +49,25 @@ run-plugin-semihosting-with-%:
$(call strip-plugin,$<) 2> $<.err, \
"$< on $(TARGET_NAME) with $*")
ARM_TESTS += semiconsole semiconsole-arm
semiconsole: CFLAGS += -mthumb
run-semiconsole: semiconsole
$(call skip-test, $<, "MANUAL ONLY")
run-plugin-semiconsole-with-%:
$(call skip-test, $<, "MANUAL ONLY")
semiconsole-arm: CFLAGS += -marm
semiconsole-arm: semiconsole.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
run-semiconsole-arm: semiconsole-arm
$(call skip-test, $<, "MANUAL ONLY")
run-plugin-semiconsole-arm-with-%:
$(call skip-test, $<, "MANUAL ONLY")
TESTS += $(ARM_TESTS)
# On ARM Linux only supports 4k pages
......
/*
* linux-user semihosting console
*
* Copyright (c) 2019
* Written by Alex Bennée <alex.bennee@linaro.org>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#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;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册