// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Assembly to get into package runtime without using exported symbols.
-
-// +build amd64 amd64p32 arm arm64 386 ppc64 ppc64le
-
-#include "textflag.h"
-
-#ifdef GOARCH_arm
-#define JMP B
-#endif
-#ifdef GOARCH_ppc64
-#define JMP BR
-#endif
-#ifdef GOARCH_ppc64le
-#define JMP BR
-#endif
-
-TEXT ·signal_disable(SB),NOSPLIT,$0
- JMP runtime·signal_disable(SB)
-
-TEXT ·signal_enable(SB),NOSPLIT,$0
- JMP runtime·signal_enable(SB)
-
-TEXT ·signal_ignore(SB),NOSPLIT,$0
- JMP runtime·signal_ignore(SB)
-
-TEXT ·signal_recv(SB),NOSPLIT,$0
- JMP runtime·signal_recv(SB)
-
+// The runtime package uses //go:linkname to push a few functions into this
+// package but we still need a .s file so the Go tool does not pass -complete
+// to the go tool compile so the latter does not complain about Go functions
+// with no bodies.
"syscall"
)
-// In assembly.
+// Defined by the runtime package.
func signal_disable(uint32)
func signal_enable(uint32)
func signal_ignore(uint32)
// 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.
}
// 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
}
// 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
}
// 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
package runtime
+import _ "unsafe"
+
const qsize = 64
var sig struct {
// 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()
}
// 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
}
// 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) {
}