aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2019-08-08 17:48:07 +0000
committerWarner Losh <imp@FreeBSD.org>2019-08-08 17:48:07 +0000
commit83959d613a8be581d39fd05adfa79da27be47ecd (patch)
tree5fe54ae57f2aa2a5abb6f173d65d3950e67a3b33 /sys
parent435672e322431c14352a096e8cd3bbae56a38979 (diff)
downloadsrc-83959d613a8be581d39fd05adfa79da27be47ecd.tar.gz
src-83959d613a8be581d39fd05adfa79da27be47ecd.zip
Make arm64 32-bit mode compile with COMPAT_43
The COMPAT_43 option isn't quite like the other compat options, and arm64 makes attempts to support it in 64-bit mode. In 32-bit compat mode, however, two syscall implementations that COMPAT_FREEBSD32 assumes will be there are missing. Provide implementations for these: ofreebsd32_sigreturn (which we'll never encounter, so implement it as nosys as is done in kern_sig.c) and ofreebsd32_getpagesize, where we'll always return 4096 since that's the only PAGE_SIZE we support, similar to how the ia32 implementation does things. Reviewed by: manu@ Differential Revision: https://reviews.freebsd.org/D21192
Notes
Notes: svn path=/head/; revision=350764
Diffstat (limited to 'sys')
-rw-r--r--sys/arm64/arm64/freebsd32_machdep.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/arm64/arm64/freebsd32_machdep.c b/sys/arm64/arm64/freebsd32_machdep.c
index 2e25fe062b19..42900641c7e5 100644
--- a/sys/arm64/arm64/freebsd32_machdep.c
+++ b/sys/arm64/arm64/freebsd32_machdep.c
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
#include <sys/syscallsubr.h>
#include <sys/ktr.h>
#include <sys/sysent.h>
+#include <sys/sysproto.h>
#include <machine/armreg.h>
#ifdef VFP
#include <machine/vfp.h>
@@ -410,3 +411,30 @@ freebsd32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
mtx_lock(&psp->ps_mtx);
}
+
+#ifdef COMPAT_43
+/*
+ * COMPAT_FREEBSD32 assumes we have this system call when COMPAT_43 is defined.
+ * FreeBSD/arm provies a similar getpagesize() syscall.
+ */
+#define ARM32_PAGE_SIZE 4096
+int
+ofreebsd32_getpagesize(struct thread *td,
+ struct ofreebsd32_getpagesize_args *uap)
+{
+
+ td->td_retval[0] = ARM32_PAGE_SIZE;
+ return (0);
+}
+
+/*
+ * Mirror the osigreturn definition in kern_sig.c for !i386 platforms. This
+ * mirrors what's connected to the FreeBSD/arm syscall.
+ */
+int
+ofreebsd32_sigreturn(struct thread *td, struct ofreebsd32_sigreturn_args *uap)
+{
+
+ return (nosys(td, (struct nosys_args *)uap));
+}
+#endif