summaryrefslogtreecommitdiff
path: root/emulators/qemu-devel/files/patch-z6-bsd-user-usrstack1
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/qemu-devel/files/patch-z6-bsd-user-usrstack1')
-rw-r--r--emulators/qemu-devel/files/patch-z6-bsd-user-usrstack118
1 files changed, 18 insertions, 0 deletions
diff --git a/emulators/qemu-devel/files/patch-z6-bsd-user-usrstack1 b/emulators/qemu-devel/files/patch-z6-bsd-user-usrstack1
new file mode 100644
index 000000000000..df26a50388f1
--- /dev/null
+++ b/emulators/qemu-devel/files/patch-z6-bsd-user-usrstack1
@@ -0,0 +1,18 @@
+--- a/bsd-user/syscall.c
++++ b/bsd-user/syscall.c
+@@ -377,6 +377,15 @@ static abi_long do_freebsd_sysctl(abi_ul
+ *q++ = tswap32(*p);
+ oidfmt(snamep, namelen, NULL, &kind);
+ /* XXX swap hnewp */
++#if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 32
++ /* XXX there may be more sysctls that differ */
++ if (namelen == 2 &&
++ snamep[0] == CTL_KERN && snamep[1] == KERN_USRSTACK &&
++ holdlen && holdlen == 4 && hnewp == NULL) {
++ (*(uint32_t *)holdp) = 0xfffff000U;
++ ret = 0;
++ } else
++#endif
+ ret = get_errno(sysctl(snamep, namelen, holdp, &holdlen, hnewp, newlen));
+ if (!ret)
+ sysctl_oldcvt(holdp, holdlen, kind);