return set
}
+func (c *sigctxt) fixsigcode(sig uint32) {
+}
+
//go:nosplit
func semacreate(mp *m) {
if mp.waitsema != 0 {
copy(set.__bits[:], m[:])
return set
}
+
+func (c *sigctxt) fixsigcode(sig uint32) {
+}
copy(set.__bits[:], m[:])
return set
}
+
+func (c *sigctxt) fixsigcode(sig uint32) {
+}
func setSignalstackSP(s *stackt, sp uintptr) {
s.ss_sp = (*byte)(unsafe.Pointer(sp))
}
+
+func (c *sigctxt) fixsigcode(sig uint32) {
+}
copy(set.__bits[:], m[:])
return set
}
+
+func (c *sigctxt) fixsigcode(sig uint32) {
+}
func sigmaskToSigset(m sigmask) sigset {
return sigset(m[0])
}
+
+func (c *sigctxt) fixsigcode(sig uint32) {
+}
package runtime
-import "unsafe"
-
type sigTabT struct {
flags int32
name string
/* 30 */ {_SigNotify, "SIGUSR1: user-defined signal 1"},
/* 31 */ {_SigNotify, "SIGUSR2: user-defined signal 2"},
}
-
-//go:noescape
-func sigreturn(ctx unsafe.Pointer, infostyle uint32)
-
-//go:nosplit
-//go:nowritebarrierrec
-func sigtrampgo(fn uintptr, infostyle, sig uint32, info *siginfo, ctx unsafe.Pointer) {
- if sigfwdgo(sig, info, ctx) {
- sigreturn(ctx, infostyle)
- return
- }
- g := getg()
- if g == nil {
- badsignal(uintptr(sig), &sigctxt{info, ctx})
- sigreturn(ctx, infostyle)
- return
- }
-
- // If some non-Go code called sigaltstack, adjust.
- sp := uintptr(unsafe.Pointer(&sig))
- if sp < g.m.gsignal.stack.lo || sp >= g.m.gsignal.stack.hi {
- var st stackt
- sigaltstack(nil, &st)
- if st.ss_flags&_SS_DISABLE != 0 {
- setg(nil)
- cgocallback(unsafe.Pointer(funcPC(noSignalStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
- }
- stsp := uintptr(unsafe.Pointer(st.ss_sp))
- if sp < stsp || sp >= stsp+st.ss_size {
- setg(nil)
- cgocallback(unsafe.Pointer(funcPC(sigNotOnStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
- }
- setGsignalStack(&st)
- g.m.gsignal.stktopsp = getcallersp(unsafe.Pointer(&sig))
- }
-
- setg(g.m.gsignal)
- c := &sigctxt{info, ctx}
- c.fixsigcode(sig)
- sighandler(sig, info, ctx, g)
- setg(g)
- sigreturn(ctx, infostyle)
-}
package runtime
-import "unsafe"
-
type sigTabT struct {
flags int32
name string
/* 31 */ {_SigNotify, "SIGUSR2: user-defined signal 2"},
/* 32 */ {_SigNotify, "SIGTHR: reserved"},
}
-
-//go:nosplit
-//go:nowritebarrierrec
-func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
- if sigfwdgo(sig, info, ctx) {
- return
- }
- g := getg()
- if g == nil {
- badsignal(uintptr(sig), &sigctxt{info, ctx})
- return
- }
-
- // If some non-Go code called sigaltstack, adjust.
- sp := uintptr(unsafe.Pointer(&sig))
- if sp < g.m.gsignal.stack.lo || sp >= g.m.gsignal.stack.hi {
- var st stackt
- sigaltstack(nil, &st)
- if st.ss_flags&_SS_DISABLE != 0 {
- setg(nil)
- cgocallback(unsafe.Pointer(funcPC(noSignalStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
- }
- stsp := uintptr(unsafe.Pointer(st.ss_sp))
- if sp < stsp || sp >= stsp+st.ss_size {
- setg(nil)
- cgocallback(unsafe.Pointer(funcPC(sigNotOnStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
- }
- setGsignalStack(&st)
- g.m.gsignal.stktopsp = getcallersp(unsafe.Pointer(&sig))
- }
-
- setg(g.m.gsignal)
- sighandler(sig, info, ctx, g)
- setg(g)
-}
package runtime
-import "unsafe"
-
type sigTabT struct {
flags int32
name string
/* 31 */ {_SigNotify, "SIGUSR2: user-defined signal 2"},
/* 32 */ {_SigNotify, "SIGTHR: reserved"},
}
-
-//go:nosplit
-//go:nowritebarrierrec
-func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
- if sigfwdgo(sig, info, ctx) {
- return
- }
- g := getg()
- if g == nil {
- badsignal(uintptr(sig), &sigctxt{info, ctx})
- return
- }
-
- // If some non-Go code called sigaltstack, adjust.
- sp := uintptr(unsafe.Pointer(&sig))
- if sp < g.m.gsignal.stack.lo || sp >= g.m.gsignal.stack.hi {
- var st stackt
- sigaltstack(nil, &st)
- if st.ss_flags&_SS_DISABLE != 0 {
- setg(nil)
- cgocallback(unsafe.Pointer(funcPC(noSignalStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
- }
- stsp := uintptr(unsafe.Pointer(st.ss_sp))
- if sp < stsp || sp >= stsp+st.ss_size {
- setg(nil)
- cgocallback(unsafe.Pointer(funcPC(sigNotOnStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
- }
- setGsignalStack(&st)
- g.m.gsignal.stktopsp = getcallersp(unsafe.Pointer(&sig))
- }
-
- setg(g.m.gsignal)
- sighandler(sig, info, ctx, g)
- setg(g)
-}
+++ /dev/null
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build dragonfly linux netbsd
-
-package runtime
-
-import "unsafe"
-
-// Continuation of the (assembly) sigtramp() logic.
-// This may be called with the world stopped.
-//go:nosplit
-//go:nowritebarrierrec
-func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
- if sigfwdgo(sig, info, ctx) {
- return
- }
- g := getg()
- if g == nil {
- if sig == _SIGPROF {
- // Ignore profiling signals that arrive on
- // non-Go threads. On some systems they will
- // be handled directly by the signal handler,
- // by calling sigprofNonGo, in which case we won't
- // get here anyhow.
- return
- }
- badsignal(uintptr(sig), &sigctxt{info, ctx})
- return
- }
-
- // If some non-Go code called sigaltstack, adjust.
- sp := uintptr(unsafe.Pointer(&sig))
- if sp < g.m.gsignal.stack.lo || sp >= g.m.gsignal.stack.hi {
- var st stackt
- sigaltstack(nil, &st)
- if st.ss_flags&_SS_DISABLE != 0 {
- setg(nil)
- cgocallback(unsafe.Pointer(funcPC(noSignalStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
- }
- stsp := uintptr(unsafe.Pointer(st.ss_sp))
- if sp < stsp || sp >= stsp+st.ss_size {
- setg(nil)
- cgocallback(unsafe.Pointer(funcPC(sigNotOnStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
- }
- setGsignalStack(&st)
- g.m.gsignal.stktopsp = getcallersp(unsafe.Pointer(&sig))
- }
-
- setg(g.m.gsignal)
- sighandler(sig, info, ctx, g)
- setg(g)
-}
dieFromSignal(_SIGPIPE)
}
+// sigtrampgo is called from the signal handler function, sigtramp,
+// written in assembly code.
+// This is called by the signal handler, and the world may be stopped.
+//go:nosplit
+//go:nowritebarrierrec
+func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) {
+ if sigfwdgo(sig, info, ctx) {
+ return
+ }
+ g := getg()
+ if g == nil {
+ if sig == _SIGPROF {
+ // Ignore profiling signals that arrive on
+ // non-Go threads. On some systems they will
+ // be handled directly by the signal handler,
+ // by calling sigprofNonGo, in which case we won't
+ // get here anyhow.
+ return
+ }
+ badsignal(uintptr(sig), &sigctxt{info, ctx})
+ return
+ }
+
+ // If some non-Go code called sigaltstack, adjust.
+ sp := uintptr(unsafe.Pointer(&sig))
+ if sp < g.m.gsignal.stack.lo || sp >= g.m.gsignal.stack.hi {
+ var st stackt
+ sigaltstack(nil, &st)
+ if st.ss_flags&_SS_DISABLE != 0 {
+ setg(nil)
+ cgocallback(unsafe.Pointer(funcPC(noSignalStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
+ }
+ stsp := uintptr(unsafe.Pointer(st.ss_sp))
+ if sp < stsp || sp >= stsp+st.ss_size {
+ setg(nil)
+ cgocallback(unsafe.Pointer(funcPC(sigNotOnStack)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig), 0)
+ }
+ setGsignalStack(&st)
+ g.m.gsignal.stktopsp = getcallersp(unsafe.Pointer(&sig))
+ }
+
+ setg(g.m.gsignal)
+ c := &sigctxt{info, ctx}
+ c.fixsigcode(sig)
+ sighandler(sig, info, ctx, g)
+ setg(g)
+}
+
// sigpanic turns a synchronous signal into a run-time panic.
// If the signal handler sees a synchronous panic, it arranges the
// stack to look like the function where the signal occurred called
MOVL AX, SP
RET
-TEXT runtime·sigreturn(SB),NOSPLIT,$12-8
- MOVL ctx+0(FP), CX
- MOVL infostyle+4(FP), BX
- MOVL $0, 0(SP) // "caller PC" - ignored
- MOVL CX, 4(SP)
- MOVL BX, 8(SP)
- MOVL $184, AX // sigreturn(ucontext, infostyle)
- INT $0x80
- MOVL $0xf1, 0xf1 // crash
- RET
-
// Sigtramp's job is to call the actual signal handler.
// It is called with the following arguments on the stack:
// 0(SP) "return address" - ignored
// 16(SP) siginfo
// 20(SP) context
TEXT runtime·sigtramp(SB),NOSPLIT,$20
- MOVL fn+0(FP), BX
- MOVL BX, 0(SP)
- MOVL infostyle+4(FP), BX
- MOVL BX, 4(SP)
MOVL sig+8(FP), BX
- MOVL BX, 8(SP)
+ MOVL BX, 0(SP)
MOVL info+12(FP), BX
- MOVL BX, 12(SP)
+ MOVL BX, 4(SP)
MOVL ctx+16(FP), BX
- MOVL BX, 16(SP)
+ MOVL BX, 8(SP)
CALL runtime·sigtrampgo(SB)
// call sigreturn
MOVQ BP, SP
RET
-TEXT runtime·sigreturn(SB),NOSPLIT,$0-12
- MOVQ ctx+0(FP), DI
- MOVL infostyle+8(FP), SI
- MOVL $(0x2000000+184), AX
- SYSCALL
- INT $3 // not reached
-
TEXT runtime·sigtramp(SB),NOSPLIT,$32
- MOVQ DI, 0(SP) // fn
- MOVL SI, 8(SP) // infostyle
- MOVL DX, 12(SP) // sig
- MOVQ CX, 16(SP) // info
- MOVQ R8, 24(SP) // ctx
+ MOVL SI, 24(SP) // save infostyle for sigreturn below
+ MOVL DX, 0(SP) // sig
+ MOVQ CX, 8(SP) // info
+ MOVQ R8, 16(SP) // ctx
MOVQ $runtime·sigtrampgo(SB), AX
CALL AX
- INT $3 // not reached (see issue 16453)
+ MOVQ 16(SP), DI // ctx
+ MOVL 24(SP), SI // infostyle
+ MOVL $(0x2000000+184), AX
+ SYSCALL
+ INT $3 // not reached
TEXT runtime·mmap(SB),NOSPLIT,$0
MOVQ addr+0(FP), DI // arg 1 addr