[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 27/30] riscv: Add semihosting support for user mode
From: |
Alex Bennée |
Subject: |
[PULL 27/30] riscv: Add semihosting support for user mode |
Date: |
Fri, 15 Jan 2021 13:08:25 +0000 |
From: Kito Cheng <kito.cheng@sifive.com>
This could made testing more easier and ARM/AArch64 has supported on
their linux user mode too, so I think it should be reasonable.
Verified GCC testsuite with newlib/semihosting.
Signed-off-by: Kito Cheng <kito.cheng@sifive.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210107170717.2098982-7-keithp@keithp.com>
Message-Id: <20210108224256.2321-18-alex.bennee@linaro.org>
diff --git a/linux-user/riscv/cpu_loop.c b/linux-user/riscv/cpu_loop.c
index aa9e437875..9665dabb09 100644
--- a/linux-user/riscv/cpu_loop.c
+++ b/linux-user/riscv/cpu_loop.c
@@ -23,6 +23,7 @@
#include "qemu.h"
#include "cpu_loop-common.h"
#include "elf.h"
+#include "hw/semihosting/common-semi.h"
void cpu_loop(CPURISCVState *env)
{
@@ -91,6 +92,10 @@ void cpu_loop(CPURISCVState *env)
sigcode = TARGET_SEGV_MAPERR;
sigaddr = env->badaddr;
break;
+ case RISCV_EXCP_SEMIHOST:
+ env->gpr[xA0] = do_common_semihosting(cs);
+ env->pc += 4;
+ break;
case EXCP_DEBUG:
gdbstep:
signum = TARGET_SIGTRAP;
--
2.20.1
- [PULL 21/30] target/arm: use official org.gnu.gdb.aarch64.sve layout for registers, (continued)
- [PULL 21/30] target/arm: use official org.gnu.gdb.aarch64.sve layout for registers, Alex Bennée, 2021/01/15
- [PULL 30/30] semihosting: Implement SYS_ISERROR, Alex Bennée, 2021/01/15
- [PULL 29/30] semihosting: Implement SYS_TMPNAM, Alex Bennée, 2021/01/15
- [PULL 07/30] Makefile: wrap cscope in quiet-command calls, Alex Bennée, 2021/01/15
- [PULL 28/30] semihosting: Implement SYS_ELAPSED and SYS_TICKFREQ, Alex Bennée, 2021/01/15
- [PULL 16/30] gdbstub: implement a softmmu based test, Alex Bennée, 2021/01/15
- [PULL 18/30] gdbstub: drop CPUEnv from gdb_exit(), Alex Bennée, 2021/01/15
- [PULL 19/30] gdbstub: drop gdbserver_cleanup in favour of gdb_exit, Alex Bennée, 2021/01/15
- [PULL 23/30] semihosting: Change common-semi API to be architecture-independent, Alex Bennée, 2021/01/15
- [PULL 08/30] docker: expand debian-amd64 image to include tag tools, Alex Bennée, 2021/01/15
- [PULL 27/30] riscv: Add semihosting support for user mode,
Alex Bennée <=
- [PULL 20/30] gdbstub: ensure we clean-up when terminated, Alex Bennée, 2021/01/15
- [PULL 22/30] semihosting: Move ARM semihosting code to shared directories, Alex Bennée, 2021/01/15
- [PULL 15/30] Revert "tests/tcg/multiarch/Makefile.target: Disable run-gdbstub-sha1 test", Alex Bennée, 2021/01/15
- [PULL 10/30] Fix build with new yank feature by adding stubs, Alex Bennée, 2021/01/15
- [PULL 11/30] gitlab: migrate the minimal tools and unit tests from Travis, Alex Bennée, 2021/01/15
- [PULL 09/30] gitlab: move docs and tools build across from Travis, Alex Bennée, 2021/01/15
- [PULL 26/30] riscv: Add semihosting support, Alex Bennée, 2021/01/15
- [PULL 12/30] scripts/checkpatch.pl: fix git-show invocation to include diffstat, Alex Bennée, 2021/01/15
- [PULL 24/30] semihosting: Change internal common-semi interfaces to use CPUState *, Alex Bennée, 2021/01/15
- Re: [PULL 00/30] testing, gdbstub and semihosting, Peter Maydell, 2021/01/15