Commit 418b39d4 authored by Alex Brainman's avatar Alex Brainman

runtime: align stack before calling windows in usleep2

Fixes #8174.

LGTM=minux
R=golang-codereviews, minux
CC=golang-codereviews
https://golang.org/cl/102360043
parent a1778ec1
......@@ -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
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