mirror of
https://github.com/golang/go
synced 2024-11-22 04:44:39 -07:00
runtime: implement runtime usleep for openbsd
R=golang-dev, mikioh.mikioh, hectorchu CC=golang-dev https://golang.org/cl/5173043
This commit is contained in:
parent
e7e5c5adb3
commit
d573ad2671
@ -27,6 +27,24 @@ TEXT runtime·write(SB),7,$-4
|
||||
INT $0x80
|
||||
RET
|
||||
|
||||
TEXT runtime·usleep(SB),7,$20
|
||||
MOVL $0, DX
|
||||
MOVL usec+0(FP), AX
|
||||
MOVL $1000000, CX
|
||||
DIVL CX
|
||||
MOVL AX, 12(SP) // tv_sec
|
||||
MOVL $1000, AX
|
||||
MULL DX
|
||||
MOVL AX, 16(SP) // tv_nsec
|
||||
|
||||
MOVL $0, 0(SP)
|
||||
LEAL 12(SP), AX
|
||||
MOVL AX, 4(SP) // arg 1 - rqtp
|
||||
MOVL $0, 8(SP) // arg 2 - rmtp
|
||||
MOVL $240, AX // sys_nanosleep
|
||||
INT $0x80
|
||||
RET
|
||||
|
||||
TEXT runtime·raisesigpipe(SB),7,$12
|
||||
MOVL $299, AX // sys_getthrid
|
||||
INT $0x80
|
||||
|
@ -100,6 +100,22 @@ TEXT runtime·write(SB),7,$-8
|
||||
SYSCALL
|
||||
RET
|
||||
|
||||
TEXT runtime·usleep(SB),7,$16
|
||||
MOVL $0, DX
|
||||
MOVL usec+0(FP), AX
|
||||
MOVL $1000000, CX
|
||||
DIVL CX
|
||||
MOVQ AX, 0(SP) // tv_sec
|
||||
MOVL $1000, AX
|
||||
MULL DX
|
||||
MOVQ AX, 8(SP) // tv_nsec
|
||||
|
||||
MOVQ SP, DI // arg 1 - rqtp
|
||||
MOVQ $0, SI // arg 2 - rmtp
|
||||
MOVL $240, AX // sys_nanosleep
|
||||
SYSCALL
|
||||
RET
|
||||
|
||||
TEXT runtime·raisesigpipe(SB),7,$16
|
||||
MOVL $299, AX // sys_getthrid
|
||||
SYSCALL
|
||||
|
Loading…
Reference in New Issue
Block a user