Skip to content

Commit bb0e5c2

Browse files
pmurgopherbot
authored andcommitted
[release-branch.go1.24] runtime: fix usleep on s390x/linux
The timespec argument takes the remainder in nanoseconds, not microseconds. Convert the remaining time to nsec. Fixes #71728 Change-Id: I36cbbe3a088830c5e3afcc9516ef42e96ee21268 Reviewed-on: https://go-review.googlesource.com/c/go/+/648915 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Mauri de Souza Meneguzzo <[email protected]> Reviewed-by: Axel Busch <[email protected]> Run-TryBot: Paul Murphy <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Vishwanatha HD <[email protected]> Reviewed-on: https://go-review.googlesource.com/c/go/+/649375 Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent cd0e528 commit bb0e5c2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/runtime/sys_linux_s390x.s

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ TEXT runtime·usleep(SB),NOSPLIT,$16-4
112112
MOVW $1000000, R3
113113
DIVD R3, R2
114114
MOVD R2, 8(R15)
115-
MOVW $1000, R3
116-
MULLD R2, R3
115+
MULLD R2, R3 // Convert sec to usec and subtract
117116
SUB R3, R4
117+
MOVW $1000, R3
118+
MULLD R3, R4 // Convert remaining usec into nsec.
118119
MOVD R4, 16(R15)
119120

120121
// nanosleep(&ts, 0)

0 commit comments

Comments
 (0)