aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/go-signal.c
diff options
context:
space:
mode:
authorBenny Siegert <bsiegert@gmail.com>2020-04-20 16:11:14 +0200
committerIan Lance Taylor <iant@golang.org>2020-04-20 21:20:53 -0700
commit8e841bd419fb9dc3e027367fc11078b677541a9a (patch)
tree6057bd268fb933a070fa9faac31f86e95b767c69 /libgo/runtime/go-signal.c
parent8ab392f97bb51854e11fae9c2e9a15b67206efba (diff)
downloadgcc-8e841bd419fb9dc3e027367fc11078b677541a9a.zip
gcc-8e841bd419fb9dc3e027367fc11078b677541a9a.tar.gz
gcc-8e841bd419fb9dc3e027367fc11078b677541a9a.tar.bz2
gccgo: fix runtime compilation on NetBSD
si_code in siginfo_t is a macro on NetBSD, not a member of the struct itself, so add a C trampoline for receiving its value. Also replace references to mos.waitsemacount with the replacement and add some helpers from os_netbsd.go in the GC repository. Update golang/go#38538. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/228918
Diffstat (limited to 'libgo/runtime/go-signal.c')
-rw-r--r--libgo/runtime/go-signal.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c
index a07fdea..b429fdb 100644
--- a/libgo/runtime/go-signal.c
+++ b/libgo/runtime/go-signal.c
@@ -179,6 +179,18 @@ setSigactionHandler(struct sigaction* sa, uintptr handler)
// C code to fetch values from the siginfo_t and ucontext_t pointers
// passed to a signal handler.
+uintptr getSiginfoCode(siginfo_t *)
+ __attribute__ ((no_split_stack));
+
+uintptr getSiginfoCode(siginfo_t *)
+ __asm__ (GOSYM_PREFIX "runtime.getSiginfoCode");
+
+uintptr
+getSiginfoCode(siginfo_t *info)
+{
+ return (uintptr)(info->si_code);
+}
+
struct getSiginfoRet {
uintptr sigaddr;
uintptr sigpc;