Skip to content

Backport fix to correct usleep asm implementation on s390x for Go1.22 #282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions patches/020-fix-usleep-s390x.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From 3784dc6c80f5fe5dd81874330659074b14546ab2 Mon Sep 17 00:00:00 2001
From: Archana Ravindar <[email protected]>
Date: Fri, 28 Mar 2025 14:44:39 +0530
Subject: [PATCH 1/1] backport usleep fix

---
src/runtime/sys_linux_s390x.s | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/runtime/sys_linux_s390x.s b/src/runtime/sys_linux_s390x.s
index adf5612c3c..e1ae00ff83 100644
--- a/src/runtime/sys_linux_s390x.s
+++ b/src/runtime/sys_linux_s390x.s
@@ -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)
--
2.47.1

Loading