[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] tcg/riscv: Fix building on OpenBSD/riscv64
From: |
Brad Smith |
Subject: |
[PATCH] tcg/riscv: Fix building on OpenBSD/riscv64 |
Date: |
Wed, 26 Jun 2024 03:09:25 -0400 |
tcg/riscv: Fix building on OpenBSD/riscv64
Signed-off-by: Brad Smith <brad@comstyle.com>
---
tcg/riscv/tcg-target.c.inc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc
index 639363039b..aeae9a8ad8 100644
--- a/tcg/riscv/tcg-target.c.inc
+++ b/tcg/riscv/tcg-target.c.inc
@@ -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;
}
--
2.45.2
- [PATCH] tcg/riscv: Fix building on OpenBSD/riscv64,
Brad Smith <=