diff options
author | Austin Clements <austin@google.com> | 2019-10-14 17:05:56 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2019-10-26 02:52:28 +0000 |
commit | 8714e39497dba141ce7ed83c6a18c3c0def66e77 (patch) | |
tree | a0cb6cb5980a58c5bca11c05741016de705fe742 /src/runtime/sys_freebsd_arm64.s | |
parent | 334291d1f629fb027bfcd7bff6d30e01dd9bf4c5 (diff) | |
download | go-8714e39497dba141ce7ed83c6a18c3c0def66e77.tar.gz go-8714e39497dba141ce7ed83c6a18c3c0def66e77.zip |
runtime: M-targeted signals for BSDs
For these, we split up the existing runtime.raise assembly
implementation into its constituent "get thread ID" and "signal
thread" parts. This lets us implement signalM and reimplement raise in
pure Go. (NetBSD conveniently already had lwp_self.)
We also change minit to store the procid directly, rather than
depending on newosproc to do so. This is because newosproc isn't
called for the bootstrap M, but we need a procid for every M. This is
also simpler overall.
For #10958, #24543.
Change-Id: Ie5f1fcada6a33046375066bcbe054d1f784d39c0
Reviewed-on: https://go-review.googlesource.com/c/go/+/201402
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/sys_freebsd_arm64.s')
-rw-r--r-- | src/runtime/sys_freebsd_arm64.s | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/runtime/sys_freebsd_arm64.s b/src/runtime/sys_freebsd_arm64.s index ca2ea4f1d6..e0ef2f679d 100644 --- a/src/runtime/sys_freebsd_arm64.s +++ b/src/runtime/sys_freebsd_arm64.s @@ -197,13 +197,19 @@ TEXT runtime·usleep(SB),NOSPLIT,$24-4 SVC RET -// func raise(sig uint32) -TEXT runtime·raise(SB),NOSPLIT,$8 - MOVD $8(RSP), R0 // arg 1 &8(RSP) +// func thr_self() thread +TEXT runtime·thr_self(SB),NOSPLIT,$8-8 + MOVD $ptr-8(SP), R0 // arg 1 &8(SP) MOVD $SYS_thr_self, R8 SVC - MOVD 8(RSP), R0 // arg 1 pid - MOVW sig+0(FP), R1 + MOVD ptr-8(SP), R0 + MOVD R0, ret+0(FP) + RET + +// func thr_kill(t thread, sig int) +TEXT runtime·thr_kill(SB),NOSPLIT,$0-16 + MOVD tid+0(FP), R0 // arg 1 pid + MOVD sig+8(FP), R1 // arg 2 sig MOVD $SYS_thr_kill, R8 SVC RET |