]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.24] runtime: fix usleep on s390x/linux
authorPaul Murphy <murp@ibm.com>
Wed, 12 Feb 2025 14:45:34 +0000 (08:45 -0600)
committerGopher Robot <gobot@golang.org>
Wed, 19 Feb 2025 17:14:47 +0000 (09:14 -0800)
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 <gobot@golang.org>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Axel Busch <axel.busch@ibm.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Vishwanatha HD <vishwanatha.hd@ibm.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/649375
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/runtime/sys_linux_s390x.s

index 7da4a5272991d4ac2024c9e2384dce066c9565a2..2f9d4beda82f64382956dbd5691f4ed8e0e7bf1f 100644 (file)
@@ -112,9 +112,10 @@ TEXT runtimeĀ·usleep(SB),NOSPLIT,$16-4
        MOVW    $1000000, R3
        DIVD    R3, R2
        MOVD    R2, 8(R15)
-       MOVW    $1000, R3
-       MULLD   R2, R3
+       MULLD   R2, R3          // Convert sec to usec and subtract
        SUB     R3, R4
+       MOVW    $1000, R3
+       MULLD   R3, R4          // Convert remaining usec into nsec.
        MOVD    R4, 16(R15)
 
        // nanosleep(&ts, 0)