aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sigqueue_plan9.go
diff options
context:
space:
mode:
authorMichael Hudson-Doyle <michael.hudson@canonical.com>2015-10-16 09:56:07 +1300
committerMichael Hudson-Doyle <michael.hudson@canonical.com>2015-10-16 07:11:04 +0000
commit0b8d583320b2f6247669ef0bb1ba011054ca1c88 (patch)
tree4365cd408a3b041be5a5c5ce6e5d43c88651b3b1 /src/runtime/sigqueue_plan9.go
parent4c2465d47d8c706832bbc57668680a3ffc4d800f (diff)
downloadgo-0b8d583320b2f6247669ef0bb1ba011054ca1c88.tar.gz
go-0b8d583320b2f6247669ef0bb1ba011054ca1c88.zip
runtime, os/signal: use //go:linkname instead of assembly stubs to get access to runtime functions
os/signal depends on a few unexported runtime functions. This removes the assembly stubs it used to get access to these in favour of using //go:linkname in runtime to make the functions accessible to os/signal. This is motivated by ppc64le shared libraries, where you cannot BR to a symbol defined in a shared library (only BL), but it seems like an improvment anyway. Change-Id: I09361203ce38070bd3f132f6dc5ac212f2dc6f58 Reviewed-on: https://go-review.googlesource.com/15871 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Dave Cheney <dave@cheney.net>
Diffstat (limited to 'src/runtime/sigqueue_plan9.go')
-rw-r--r--src/runtime/sigqueue_plan9.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/runtime/sigqueue_plan9.go b/src/runtime/sigqueue_plan9.go
index f000fabd1a..89f96be2e9 100644
--- a/src/runtime/sigqueue_plan9.go
+++ b/src/runtime/sigqueue_plan9.go
@@ -6,6 +6,8 @@
package runtime
+import _ "unsafe"
+
const qsize = 64
var sig struct {
@@ -92,6 +94,7 @@ func sendNote(s *byte) bool {
// Called to receive the next queued signal.
// Must only be called from a single goroutine at a time.
+//go:linkname signal_recv os/signal.signal_recv
func signal_recv() string {
for {
note := sig.q.pop()
@@ -108,6 +111,7 @@ func signal_recv() string {
}
// Must only be called from a single goroutine at a time.
+//go:linkname signal_enable os/signal.signal_enable
func signal_enable(s uint32) {
if !sig.inuse {
// The first call to signal_enable is for us
@@ -120,9 +124,11 @@ func signal_enable(s uint32) {
}
// Must only be called from a single goroutine at a time.
+//go:linkname signal_disable os/signal.signal_disable
func signal_disable(s uint32) {
}
// Must only be called from a single goroutine at a time.
+//go:linkname signal_ignore os/signal.signal_ignore
func signal_ignore(s uint32) {
}