aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2026-06-11 11:41:29 +0000
committerRobert Clausecker <fuz@FreeBSD.org>2026-06-11 11:46:38 +0000
commit92ae21e8a155734f73589b7ef9fa19a6bb6d042f (patch)
tree8c976e12a2732d680a8b5bb7fda5bb00bc3c89fa
parent3260c42c4183ac817cf08fcaa236d4d21b4fc0d2 (diff)
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
-rw-r--r--sys/arm64/arm64/freebsd32_machdep.c4
1 files 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