Skip to content

Commit b268b60

Browse files
committed
runtime: remove pthread_kill/pthread_self for openbsd
We're now using getthrid() and thrkill() instead. Updates #36435 Change-Id: I1c6bcfb9b46d149e0a2a10e936a244576489a88e Reviewed-on: https://go-review.googlesource.com/c/go/+/285692 Trust: Joel Sing <joel@sing.id.au> Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Zhang <cherryyz@google.com>
1 parent ec40517 commit b268b60

File tree

3 files changed

+0
-48
lines changed

3 files changed

+0
-48
lines changed

src/runtime/sys_openbsd.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,6 @@ func pthread_create(attr *pthreadattr, start uintptr, arg unsafe.Pointer) int32
4646
}
4747
func pthread_create_trampoline()
4848

49-
//go:nosplit
50-
//go:cgo_unsafe_args
51-
func pthread_self() (t pthread) {
52-
libcCall(unsafe.Pointer(funcPC(pthread_self_trampoline)), unsafe.Pointer(&t))
53-
return
54-
}
55-
func pthread_self_trampoline()
56-
57-
//go:nosplit
58-
//go:cgo_unsafe_args
59-
func pthread_kill(t pthread, sig uint32) {
60-
libcCall(unsafe.Pointer(funcPC(pthread_kill_trampoline)), unsafe.Pointer(&t))
61-
}
62-
func pthread_kill_trampoline()
63-
6449
// Tell the linker that the libc_* functions are to be found
6550
// in a system library, with the libc_ prefix missing.
6651

@@ -70,8 +55,5 @@ func pthread_kill_trampoline()
7055
//go:cgo_import_dynamic libc_pthread_attr_setdetachstate pthread_attr_setdetachstate "libpthread.so"
7156
//go:cgo_import_dynamic libc_pthread_create pthread_create "libpthread.so"
7257
//go:cgo_import_dynamic libc_pthread_sigmask pthread_sigmask "libpthread.so"
73-
//go:cgo_import_dynamic libc_pthread_self pthread_self "libpthread.so"
74-
//go:cgo_import_dynamic libc_pthread_kill pthread_kill "libpthread.so"
7558

7659
//go:cgo_import_dynamic _ _ "libpthread.so"
77-
//go:cgo_import_dynamic _ _ "libc.so"

src/runtime/sys_openbsd_amd64.s

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -150,24 +150,6 @@ TEXT runtime·pthread_create_trampoline(SB),NOSPLIT,$0
150150
POPQ BP
151151
RET
152152

153-
TEXT runtime·pthread_self_trampoline(SB),NOSPLIT,$0
154-
PUSHQ BP
155-
MOVQ SP, BP
156-
MOVQ DI, BX // BX is caller-save
157-
CALL libc_pthread_self(SB)
158-
MOVQ AX, 0(BX) // return value
159-
POPQ BP
160-
RET
161-
162-
TEXT runtime·pthread_kill_trampoline(SB),NOSPLIT,$0
163-
PUSHQ BP
164-
MOVQ SP, BP
165-
MOVQ 8(DI), SI // arg 2 - sig
166-
MOVQ 0(DI), DI // arg 1 - thread
167-
CALL libc_pthread_kill(SB)
168-
POPQ BP
169-
RET
170-
171153
TEXT runtime·thrsleep_trampoline(SB),NOSPLIT,$0
172154
PUSHQ BP
173155
MOVQ SP, BP

src/runtime/sys_openbsd_arm64.s

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,6 @@ TEXT runtime·pthread_create_trampoline(SB),NOSPLIT,$0
188188
ADD $16, RSP
189189
RET
190190

191-
TEXT runtime·pthread_self_trampoline(SB),NOSPLIT,$0
192-
MOVD R0, R19 // pointer to args
193-
CALL libc_pthread_self(SB)
194-
MOVD R0, 0(R19) // return value
195-
RET
196-
197-
TEXT runtime·pthread_kill_trampoline(SB),NOSPLIT,$0
198-
MOVW 8(R0), R1 // arg 2 - sig
199-
MOVD 0(R0), R0 // arg 1 - thread
200-
CALL libc_pthread_kill(SB)
201-
RET
202-
203191
// Exit the entire program (like C exit)
204192
TEXT runtime·exit(SB),NOSPLIT|NOFRAME,$0
205193
MOVW code+0(FP), R0 // arg 1 - status

0 commit comments

Comments
 (0)