[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/9] riscv: Add semihosting support for user mode
From: |
Keith Packard |
Subject: |
[PATCH 6/9] riscv: Add semihosting support for user mode |
Date: |
Thu, 7 Jan 2021 09:07:14 -0800 |
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>
Reviewed-by: Keith Packard <keithp@keithp.com>
Message-Id: <20201214200713.3886611-7-keithp@keithp.com>
---
linux-user/riscv/cpu_loop.c | 5 +++++
1 file changed, 5 insertions(+)
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.29.2
- [PATCH 0/9] Add RISC-V semihosting 0.2. Finish ARM semihosting 2.0, Keith Packard, 2021/01/07
- [PATCH 5/9] riscv: Add semihosting support, Keith Packard, 2021/01/07
- [PATCH 1/9] semihosting: Move ARM semihosting code to shared directories, Keith Packard, 2021/01/07
- [PATCH 7/9] semihosting: Implement SYS_ELAPSED and SYS_TICKFREQ, Keith Packard, 2021/01/07
- [PATCH 9/9] semihosting: Implement SYS_ISERROR, Keith Packard, 2021/01/07
- [PATCH 8/9] semihosting: Implement SYS_TMPNAM, Keith Packard, 2021/01/07
- [PATCH 4/9] semihosting: Support SYS_HEAPINFO when env->boot_info is not set, Keith Packard, 2021/01/07
- [PATCH 2/9] semihosting: Change common-semi API to be architecture-independent, Keith Packard, 2021/01/07
- [PATCH 6/9] riscv: Add semihosting support for user mode,
Keith Packard <=
- [PATCH 3/9] semihosting: Change internal common-semi interfaces to use CPUState *, Keith Packard, 2021/01/07
- Re: [PATCH 0/9] Add RISC-V semihosting 0.2. Finish ARM semihosting 2.0, Alex Bennée, 2021/01/08