diff options
author | Joel Sing <joel@sing.id.au> | 2021-01-16 04:38:50 +1100 |
---|---|---|
committer | Joel Sing <joel@sing.id.au> | 2021-01-20 09:06:08 +0000 |
commit | 928bda4f4a88efe2e53f3607e8d2ad0796b449c0 (patch) | |
tree | d9cd405d88ffc881d8d903535c3582d96f85fb1b /src/runtime/sys_openbsd_amd64.s | |
parent | 824f2d635ca96a7bded6ed039f8a9c0f06ee1443 (diff) | |
download | go-928bda4f4a88efe2e53f3607e8d2ad0796b449c0.tar.gz go-928bda4f4a88efe2e53f3607e8d2ad0796b449c0.zip |
runtime: convert openbsd/amd64 locking to libc
Switch openbsd/amd64 to locking via libc, rather than performing direct
system calls.
Update #36435
Change-Id: I5e92bd70ce557b78ff385577088a9775cc468ea9
Reviewed-on: https://go-review.googlesource.com/c/go/+/270378
Trust: Joel Sing <joel@sing.id.au>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/sys_openbsd_amd64.s')
-rw-r--r-- | src/runtime/sys_openbsd_amd64.s | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/src/runtime/sys_openbsd_amd64.s b/src/runtime/sys_openbsd_amd64.s index 455234d7cd..ac0ae27e45 100644 --- a/src/runtime/sys_openbsd_amd64.s +++ b/src/runtime/sys_openbsd_amd64.s @@ -168,28 +168,32 @@ TEXT runtime·pthread_kill_trampoline(SB),NOSPLIT,$0 POPQ BP RET -TEXT runtime·osyield(SB),NOSPLIT,$0 - MOVL $298, AX // sys_sched_yield - SYSCALL +TEXT runtime·thrsleep_trampoline(SB),NOSPLIT,$0 + PUSHQ BP + MOVQ SP, BP + MOVL 8(DI), SI // arg 2 - clock_id + MOVQ 16(DI), DX // arg 3 - abstime + MOVQ 24(DI), CX // arg 3 - lock + MOVQ 32(DI), R8 // arg 4 - abort + MOVQ 0(DI), DI // arg 1 - id + CALL libc_thrsleep(SB) + POPQ BP RET -TEXT runtime·thrsleep(SB),NOSPLIT,$0 - MOVQ ident+0(FP), DI // arg 1 - ident - MOVL clock_id+8(FP), SI // arg 2 - clock_id - MOVQ tsp+16(FP), DX // arg 3 - tp - MOVQ lock+24(FP), R10 // arg 4 - lock - MOVQ abort+32(FP), R8 // arg 5 - abort - MOVL $94, AX // sys___thrsleep - SYSCALL - MOVL AX, ret+40(FP) +TEXT runtime·thrwakeup_trampoline(SB),NOSPLIT,$0 + PUSHQ BP + MOVQ SP, BP + MOVL 8(DI), SI // arg 2 - count + MOVQ 0(DI), DI // arg 1 - id + CALL libc_thrwakeup(SB) + POPQ BP RET -TEXT runtime·thrwakeup(SB),NOSPLIT,$0 - MOVQ ident+0(FP), DI // arg 1 - ident - MOVL n+8(FP), SI // arg 2 - n - MOVL $301, AX // sys___thrwakeup - SYSCALL - MOVL AX, ret+16(FP) +TEXT runtime·sched_yield_trampoline(SB),NOSPLIT,$0 + PUSHQ BP + MOVQ SP, BP + CALL libc_sched_yield(SB) + POPQ BP RET // Exit the entire program (like C exit) |