Commit d573ad26 authored by Joel Sing's avatar Joel Sing Committed by Brad Fitzpatrick

runtime: implement runtime usleep for openbsd

R=golang-dev, mikioh.mikioh, hectorchu
CC=golang-dev
https://golang.org/cl/5173043
parent e7e5c5ad
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment