qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tcg/riscv: Fix building on OpenBSD/riscv64
@ 2024-06-27  4:27 Brad Smith
  2024-06-27 17:20 ` Richard Henderson
  0 siblings, 1 reply; 4+ messages in thread
From: Brad Smith @ 2024-06-27  4:27 UTC (permalink / raw)
  To: Palmer Dabbelt, Alistair Francis, Richard Henderson
  Cc: qemu-riscv, qemu-devel

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 <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



^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] tcg/riscv: Fix building on OpenBSD/riscv64
@ 2024-06-26  7:09 Brad Smith
  2024-06-26 10:11 ` Daniel Henrique Barboza
  0 siblings, 1 reply; 4+ messages in thread
From: Brad Smith @ 2024-06-26  7:09 UTC (permalink / raw)
  To: Palmer Dabbelt, Alistair Francis, Richard Henderson
  Cc: qemu-riscv, qemu-devel

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



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-27 17:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-27  4:27 [PATCH] tcg/riscv: Fix building on OpenBSD/riscv64 Brad Smith
2024-06-27 17:20 ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2024-06-26  7:09 Brad Smith
2024-06-26 10:11 ` Daniel Henrique Barboza

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).