Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/netbsd32 Properly mark netbsd32_compat_43 syscall...



details:   https://anonhg.NetBSD.org/src/rev/3bcb3d2654ac
branches:  trunk
changeset: 745591:3bcb3d2654ac
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sat Mar 07 00:56:41 2020 +0000

description:
Properly mark netbsd32_compat_43 syscalls that are directly implemented
by calling their compat_43 equivalents.  With these changes, and with
built-in versions of COMPAT_NETBSD32, COMPAT_NOMID, and COMPAT_09, I can
now run a netbsd-0.9 statically linked i386 (32-bit) version of /bin/ls
on a 9.99.x amd64 host!

Addresses PR kern/55047 but more changes coming to handle non-built-in
modules.

XXX pullup-9

diffstat:

 sys/compat/netbsd32/netbsd32_compat_43.c |  24 ++++++++++++++++++++++--
 sys/compat/netbsd32/syscalls.master      |  14 ++++++--------
 2 files changed, 28 insertions(+), 10 deletions(-)

diffs (104 lines):

diff -r 4a5c46f94401 -r 3bcb3d2654ac sys/compat/netbsd32/netbsd32_compat_43.c
--- a/sys/compat/netbsd32/netbsd32_compat_43.c  Sat Mar 07 00:53:24 2020 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_43.c  Sat Mar 07 00:56:41 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_compat_43.c,v 1.59 2020/01/01 09:17:45 maxv Exp $     */
+/*     $NetBSD: netbsd32_compat_43.c,v 1.60 2020/03/07 00:56:41 pgoyette Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_43.c,v 1.59 2020/01/01 09:17:45 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_43.c,v 1.60 2020/03/07 00:56:41 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_43.h"
@@ -769,6 +769,26 @@
            (sy_call_t *)compat_43_netbsd32_sigsetmask },
        { NETBSD32_SYS_compat_43_netbsd32_osigstack, 0,
            (sy_call_t *)compat_43_netbsd32_osigstack },
+/*
+ * These syscalls are provided by emul_netbsd compat_43 code, but their
+ * entry points must still be loaded in the emul_netbsd32 disatch table
+ */
+       { NETBSD32_SYS_compat_43_ogetpagesize, 0,
+           (sy_call_t *)compat_43_sys_getpagesize },
+       { NETBSD32_SYS_compat_43_ogetdtablesize, 0,
+           (sy_call_t *)compat_43_sys_getdtablesize},
+       { NETBSD32_SYS_compat_43_ogethostid, 0,
+           (sy_call_t *)compat_43_sys_gethostid },
+       { NETBSD32_SYS_compat_43_owait, 0,
+           (sy_call_t *)compat_43_sys_wait },
+/*
+ * Skip oquota since it isn't part of compat_43
+ *     { NETBSD32_SYS_compat_43_oquota, 0,
+ *         (sy_call_t *)compat_43_sys_quota },
+ */
+
+/* End of compat_43 syscalls */
+
        { 0, 0, NULL }
 }; 
 
diff -r 4a5c46f94401 -r 3bcb3d2654ac sys/compat/netbsd32/syscalls.master
--- a/sys/compat/netbsd32/syscalls.master       Sat Mar 07 00:53:24 2020 +0000
+++ b/sys/compat/netbsd32/syscalls.master       Sat Mar 07 00:56:41 2020 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.131 2020/01/18 07:33:24 kamil Exp $
+       $NetBSD: syscalls.master,v 1.132 2020/03/07 00:56:41 pgoyette Exp $
 
 ;      from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
 ;      @(#)syscalls.master     8.2 (Berkeley) 1/13/94
@@ -183,7 +183,7 @@
                        { int|netbsd32||ogetkerninfo(int op, \
                            netbsd32_charp where, netbsd32_intp size, \
                            int arg); }
-64     COMPAT_43 MODULAR compat_netbsd32_43    \
+64     COMPAT_43 MODULAR compat_43     \
                        { int|sys||getpagesize(void); } ogetpagesize
 65     COMPAT_12 MODULAR compat_netbsd32_12    \
                        { int|netbsd32||msync(netbsd32_voidp addr, \
@@ -219,7 +219,7 @@
                        { int|netbsd32||setitimer(int which, \
                            netbsd32_itimerval50p_t itv, \
                            netbsd32_itimerval50p_t oitv); }
-84     COMPAT_43 MODULAR compat_netbsd32_43    \
+84     COMPAT_43 MODULAR compat_43     \
                        { int|sys||wait(void); } owait
 85     COMPAT_12 MODULAR compat_netbsd32_12    \
                        { int|netbsd32||oswapon(netbsd32_charp name); }
@@ -232,7 +232,7 @@
 88     COMPAT_43 MODULAR compat_netbsd32_43    \
                        { int|netbsd32||osethostname(netbsd32_charp hostname, \
                            u_int len); }
-89     COMPAT_43 MODULAR compat_netbsd32_43    \
+89     COMPAT_43 MODULAR compat_43     \
                        { int|sys||getdtablesize(void); } ogetdtablesize
 90     STD             { int|netbsd32||dup2(int from, int to); }
 91     UNIMPL          getdopt
@@ -343,7 +343,7 @@
 141    COMPAT_43 MODULAR compat_netbsd32_43    \
                        { int|netbsd32||ogetpeername(int fdes, \
                            netbsd32_voidp asa, netbsd32_intp alen); }
-142    COMPAT_43 MODULAR compat_netbsd32_43    \
+142    COMPAT_43 MODULAR compat_43     \
                        { int32_t|sys||gethostid(void); } ogethostid
 143    COMPAT_43 MODULAR compat_netbsd32_43    \
                        { int|netbsd32||sethostid(int32_t hostid); }
@@ -360,12 +360,10 @@
 148    COMPAT_50 MODULAR compat_netbsd32_50    \
                        { int|netbsd32||quotactl(netbsd32_charp path, int cmd, \
                            int uid, netbsd32_voidp arg); }
-149    COMPAT_43 MODULAR compat_netbsd32_43    \
-                       { int|sys||quota(void); } oquota
 #else
 148    EXCL            compat_netbsd32_quotactl
+#endif
 149    EXCL            compat_netbsd32_quota
-#endif
 150    COMPAT_43 MODULAR compat_netbsd32_43    \
                        { int|netbsd32||ogetsockname(int fdec, \
                            netbsd32_voidp asa, netbsd32_intp alen); }



Home | Main Index | Thread Index | Old Index