From 0b8d583320b2f6247669ef0bb1ba011054ca1c88 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 16 Oct 2015 09:56:07 +1300 Subject: 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 TryBot-Result: Gobot Gobot Reviewed-by: Minux Ma Reviewed-by: Dave Cheney --- src/runtime/sigqueue.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/runtime/sigqueue.go') diff --git a/src/runtime/sigqueue.go b/src/runtime/sigqueue.go index e6e1a84063..f28067f3f9 100644 --- a/src/runtime/sigqueue.go +++ b/src/runtime/sigqueue.go @@ -90,6 +90,7 @@ Send: // 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() uint32 { for { // Serve any signals from local copy. @@ -127,6 +128,7 @@ func signal_recv() uint32 { } // 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 @@ -145,6 +147,7 @@ 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) { if s >= uint32(len(sig.wanted)*32) { return @@ -154,6 +157,7 @@ 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) { if s >= uint32(len(sig.wanted)*32) { return -- cgit v1.3-5-g45d5