git: 92ae21e8a155 - main - sys/arm64: fix return values of freebsd32_{set,swap}context()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 11 Jun 2026 11:47:16 UTC
The branch main has been updated by fuz:
URL: https://cgit.FreeBSD.org/src/commit/?id=92ae21e8a155734f73589b7ef9fa19a6bb6d042f
commit 92ae21e8a155734f73589b7ef9fa19a6bb6d042f
Author: Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-06-11 11:41:29 +0000
Commit: Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2026-06-11 11:46:38 +0000
sys/arm64: fix return values of freebsd32_{set,swap}context()
This patch aligns the return values of freebsd32_{set,swap}context()
with their counterparts on amd64 and powerpc64, fixing the setcontext()
and swapcontext() calls in armv7 applications running on aarch64.
In particular, this fixes random crashes in armv7 Ruby applications
running on aarch64 hosts.
Tested by: fuz
MFC after: 1 week
---
sys/arm64/arm64/freebsd32_machdep.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys/arm64/arm64/freebsd32_machdep.c b/sys/arm64/arm64/freebsd32_machdep.c
index d0218dc1dc80..3c7040bf5bb4 100644
--- a/sys/arm64/arm64/freebsd32_machdep.c
+++ b/sys/arm64/arm64/freebsd32_machdep.c
@@ -293,7 +293,7 @@ freebsd32_setcontext(struct thread *td, struct freebsd32_setcontext_args *uap)
NULL, 0);
}
}
- return (ret);
+ return (ret == 0 ? EJUSTRETURN : ret);
}
int
@@ -341,7 +341,7 @@ freebsd32_swapcontext(struct thread *td, struct freebsd32_swapcontext_args *uap)
}
}
}
- return (ret);
+ return (ret == 0 ? EJUSTRETURN : ret);
}
void