From: Brad Smith <brad@comstyle.com>
To: Palmer Dabbelt <palmer@dabbelt.com>,
Alistair Francis <Alistair.Francis@wdc.com>,
Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-riscv@nongnu.org, qemu-devel@nongnu.org
Subject: [PATCH] tcg/riscv: Fix building on OpenBSD/riscv64
Date: Thu, 27 Jun 2024 00:27:34 -0400 [thread overview]
Message-ID: <ZnzqNlUbHG5Ue6L1@humpty.home.comstyle.com> (raw)
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
next reply other threads:[~2024-06-27 4:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-27 4:27 Brad Smith [this message]
2024-06-27 17:20 ` [PATCH] tcg/riscv: Fix building on OpenBSD/riscv64 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZnzqNlUbHG5Ue6L1@humpty.home.comstyle.com \
--to=brad@comstyle.com \
--cc=Alistair.Francis@wdc.com \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).