Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Aug 2019 17:48:07 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r350764 - head/sys/arm64/arm64
Message-ID:  <201908081748.x78Hm79V085760@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Thu Aug  8 17:48:07 2019
New Revision: 350764
URL: https://svnweb.freebsd.org/changeset/base/350764

Log:
  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

Modified:
  head/sys/arm64/arm64/freebsd32_machdep.c

Modified: head/sys/arm64/arm64/freebsd32_machdep.c
==============================================================================
--- head/sys/arm64/arm64/freebsd32_machdep.c	Thu Aug  8 17:30:51 2019	(r350763)
+++ head/sys/arm64/arm64/freebsd32_machdep.c	Thu Aug  8 17:48:07 2019	(r350764)
@@ -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, sigs
 	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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908081748.x78Hm79V085760>