tcg/riscv: Fix building on OpenBSD/riscv64
PATCH 1/1 tcg/riscv: Fix building on OpenBSD/riscv64
tcg/riscv: Fix building on OpenBSD/riscv64
Use ucontext_t/struct sigcontext member name from machine/signal.h instead of Linux specific name.
Signed-off-by Brad Smith <[email protected]>
--- tcg/riscv/tcg-target.c.inc | 5 +++++ 1 file changed, 5 insertions(+)
tcg/riscv/tcg-target.c.inc +5 -0
@@ -2116,7 +2116,12 @@ static void sigill_handler(int signo, siginfo_t *si, void *data) { /* Skip the faulty instruction */ ucontext_t *uc = (ucontext_t *)data; + +#ifdef __OpenBSD__ + uc->sc_sepc += 4; +#else uc->uc_mcontext.__gregs[REG_PC] += 4; +#endif got_sigill = 1; }
Signature · 1 line
2.45.2
Quoted 9 lines · Brad Smith
tcg/riscv: Fix building on OpenBSD/riscv64
Use ucontext_t/struct sigcontext member name from
machine/signal.hinstead of Linux specific name.Signed-off-by Brad Smith <[email protected]>--- tcg/riscv/tcg-target.c.inc | 5 +++++ 1 file changed, 5 insertions(+)
Thanks. I'm going to clean all of this up into util/cpuinfo-riscv.c, similar to other hosts, and I will include this.
r~
Quoted 18 lines
tcg/riscv/tcg-target.c.inc +5
-0@@ -2116,7 +2116,12 @@ static void sigill_handler(int signo, siginfo_t *si, void *data) { /* Skip the faulty instruction */ ucontext_t *uc = (ucontext_t *)data; + +#ifdef __OpenBSD__ + uc->sc_sepc += 4; +#else uc->uc_mcontext.__gregs[REG_PC] += 4; +#endif got_sigill = 1; }