1
0
mirror of https://github.com/golang/go synced 2024-10-02 04:28:33 -06:00

runtime: align stack before calling windows in usleep2

Fixes #8174.

LGTM=minux
R=golang-codereviews, minux
CC=golang-codereviews
https://golang.org/cl/102360043
This commit is contained in:
Alex Brainman 2014-07-10 14:23:50 +10:00
parent a1778ec146
commit 418b39d436

View File

@ -367,7 +367,10 @@ usleep1_ret:
RET
// Runs on OS stack. duration (in 100ns units) is in BX.
TEXT runtime·usleep2(SB),NOSPLIT,$8
TEXT runtime·usleep2(SB),NOSPLIT,$16
MOVQ SP, AX
ANDQ $~15, SP // alignment as per Windows requirement
MOVQ AX, 8(SP)
// Want negative 100ns units.
NEGQ BX
MOVQ SP, R8 // ptime
@ -376,4 +379,5 @@ TEXT runtime·usleep2(SB),NOSPLIT,$8
MOVQ $0, DX // alertable
MOVQ runtime·NtWaitForSingleObject(SB), AX
CALL AX
MOVQ 8(SP), SP
RET