Source-Changes-HG archive

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

[src/pgoyette-compat]: src Move closer to a complete compat_60 module. All t...



details:   https://anonhg.NetBSD.org/src/rev/4279542304ab
branches:  pgoyette-compat
changeset: 830475:4279542304ab
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sun Mar 18 02:05:21 2018 +0000

description:
Move closer to a complete compat_60 module.  All that remains is some
tty stuff and some ccd ioctl()s.

diffstat:

 distrib/sets/lists/modules/mi     |   4 ++-
 sys/compat/common/Makefile        |   6 +++-
 sys/compat/common/compat_60_mod.c |  56 ++++++++++++++++++++------------------
 sys/compat/common/compat_mod.c    |  20 ++++---------
 sys/compat/common/compat_mod.h    |  14 +++++++++-
 sys/compat/common/files.common    |   3 +-
 sys/compat/common/kern_time_60.c  |  26 ++++++++++++++++--
 sys/modules/Makefile              |   8 ++--
 sys/modules/compat_60/Makefile    |   6 +++-
 9 files changed, 91 insertions(+), 52 deletions(-)

diffs (truncated from 336 to 300 lines):

diff -r e39d4f617808 -r 4279542304ab distrib/sets/lists/modules/mi
--- a/distrib/sets/lists/modules/mi     Sun Mar 18 01:17:29 2018 +0000
+++ b/distrib/sets/lists/modules/mi     Sun Mar 18 02:05:21 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.114.2.3 2018/03/15 05:10:05 pgoyette Exp $
+# $NetBSD: mi,v 1.114.2.4 2018/03/18 02:05:21 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -68,6 +68,8 @@
 ./@MODULEDIR@/coda5/coda5.kmod                 base-kernel-modules     kmod
 ./@MODULEDIR@/compat                           base-kernel-modules     kmod
 ./@MODULEDIR@/compat/compat.kmod               base-kernel-modules     kmod
+./@MODULEDIR@/compat_60                                base-kernel-modules     kmod
+./@MODULEDIR@/compat_60/compat_60.kmod         base-kernel-modules     kmod
 ./@MODULEDIR@/compat_70                                base-kernel-modules     kmod
 ./@MODULEDIR@/compat_70/compat_70.kmod         base-kernel-modules     kmod
 ./@MODULEDIR@/compat_ossaudio                  base-kernel-modules     kmod
diff -r e39d4f617808 -r 4279542304ab sys/compat/common/Makefile
--- a/sys/compat/common/Makefile        Sun Mar 18 01:17:29 2018 +0000
+++ b/sys/compat/common/Makefile        Sun Mar 18 02:05:21 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.63 2017/12/20 04:46:19 maya Exp $
+#      $NetBSD: Makefile,v 1.63.2.1 2018/03/18 02:05:21 pgoyette Exp $
 
 LIB=           compat
 NOPIC=         # defined
@@ -33,5 +33,9 @@
        @rm -f lib${LIB}.po
        @${LD} -r -o lib${LIB}.po ${LDFLAGS} `NM=${NM} ${LORDER} ${POBJS} | ${TSORT}`
 
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
+CPPFLAGS+=     -DCPU_UCODE
+.endif
+
 showsources: ${SRCS}
        @echo ${.ALLSRC}
diff -r e39d4f617808 -r 4279542304ab sys/compat/common/compat_60_mod.c
--- a/sys/compat/common/compat_60_mod.c Sun Mar 18 01:17:29 2018 +0000
+++ b/sys/compat/common/compat_60_mod.c Sun Mar 18 02:05:21 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_60_mod.c,v 1.1.2.5 2018/03/17 06:49:57 pgoyette Exp $   */
+/*     $NetBSD: compat_60_mod.c,v 1.1.2.6 2018/03/18 02:05:21 pgoyette Exp $   */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_60_mod.c,v 1.1.2.5 2018/03/17 06:49:57 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_60_mod.c,v 1.1.2.6 2018/03/18 02:05:21 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -51,44 +51,47 @@
 #include <compat/common/compat_util.h>
 #include <compat/common/compat_mod.h>
 
-static const struct syscall_package compat_60_syscalls[] = {
-       { SYS_compat_60__lwp_park, 0, (sy_call_t *)compat_60_sys__lwp_park },
-       { 0, 0, NULL }
-};
-
-#ifdef _MODULE
-
 #define REQUIRED_60 "compat_70"                /* XXX No compat_80 yet */
 MODULE(MODULE_CLASS_EXEC, compat_60, REQUIRED_60);
 
-static const struct syscall_package compat__60_syscalls[] = {
-        { SYS_compat_60__lwp_park, 0, (sy_call_t *)compat_60_sys__lwp_park },  
-        NULL, 0, NULL }
-};
-#endif /* _MODULE */
-
 int
-compat_60_init(void)
+compat_60_init()
 {
        int error = 0;
 
-       error = syscall_establish(NULL, compat_60_syscalls);
+       error = kern_time_60_init();
        if (error != 0)
                return error;
-       return 0;
-}
 
-int
-compat_60_fini(void)
-{
-       int error = 0;
-
-       error = syscall_disestablish(NULL, compat_60_syscalls);
+#ifdef CPU_UCODE
+       error = kern_cpu_60_init();
+       if (error != 0) {
+               kern_time_60_fini();
+               return 0;
+       }
+#endif
 
        return error;
 }
 
-#ifdef _MODULE
+int
+compat_60_fini()
+{
+       int error = 0;
+
+#ifdef CPU_UCODE
+       error = kern_cpu_60_fini();
+       if (error != 0)
+               return error;
+#endif
+
+       error = kern_time_60_fini();
+       if (error != 0)
+               kern_cpu_60_init();
+
+       return error;
+}
+
 static int
 compat_60_modcmd(modcmd_t cmd, void *arg)
 {
@@ -102,4 +105,3 @@
                return ENOTTY;
        }
 }
-#endif /* _MODULE */
diff -r e39d4f617808 -r 4279542304ab sys/compat/common/compat_mod.c
--- a/sys/compat/common/compat_mod.c    Sun Mar 18 01:17:29 2018 +0000
+++ b/sys/compat/common/compat_mod.c    Sun Mar 18 02:05:21 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_mod.c,v 1.24.14.14 2018/03/17 21:37:52 pgoyette Exp $   */
+/*     $NetBSD: compat_mod.c,v 1.24.14.15 2018/03/18 02:05:21 pgoyette Exp $   */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.24.14.14 2018/03/17 21:37:52 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.24.14.15 2018/03/18 02:05:21 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -286,29 +286,23 @@
                uvm_50_init();
                if_50_init();
 #endif
-#ifdef COMPAT_60
-               if ((error = compat_60_init()) != 0)
-                       return error;
-#endif
 #ifdef COMPAT_70
                compat_70_init();
 #endif
 #ifdef COMPAT_60
-               kern_cpu_60_init();
-#endif
-#ifdef COMPAT_60
-               kern_cpu_60_fini();
+               if ((error = compat_60_init()) != 0)
+                       return error;
 #endif
                return 0;
 
        case MODULE_CMD_FINI:
-#ifdef COMPAT_70
-               compat_70_fini();
-#endif
 #ifdef COMPAT_60
                if ((error = compat_60_fini()) != 0)
                        return error;
 #endif
+#ifdef COMPAT_70
+               compat_70_fini();
+#endif
 #ifdef COMPAT_10
                vfs_syscalls_10_fini();
 #endif
diff -r e39d4f617808 -r 4279542304ab sys/compat/common/compat_mod.h
--- a/sys/compat/common/compat_mod.h    Sun Mar 18 01:17:29 2018 +0000
+++ b/sys/compat/common/compat_mod.h    Sun Mar 18 02:05:21 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_mod.h,v 1.1.42.3 2018/03/17 00:44:38 pgoyette Exp $     */
+/*     $NetBSD: compat_mod.h,v 1.1.42.4 2018/03/18 02:05:21 pgoyette Exp $     */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -32,16 +32,28 @@
 #ifndef        _COMPAT_MOD_H
 #define        _COMPAT_MOD_H
 
+#include <sys/sysctl.h>
+
 void compat_sysctl_init(void);
 void compat_sysctl_fini(void);
 
 void compat_sysctl_time(struct sysctllog **);
 void compat_sysctl_vfs(struct sysctllog **);
 
+#ifdef COMPAT_70
 int compat_70_init(void);
 int compat_70_fini(void);
+#endif
 
+#ifdef COMPAT_60
 int compat_60_init(void);
 int compat_60_fini(void);
+int kern_time_60_init(void);
+int kern_time_60_fini(void);
+int kern_cpu_60_init(void);
+int kern_cpu_60_fini(void);
+int kern_tty_60_init(void);
+int kern_tty_60_fini(void);
+#endif
 
 #endif /* !_COMPAT_MOD_H_ */
diff -r e39d4f617808 -r 4279542304ab sys/compat/common/files.common
--- a/sys/compat/common/files.common    Sun Mar 18 01:17:29 2018 +0000
+++ b/sys/compat/common/files.common    Sun Mar 18 02:05:21 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.common,v 1.1.2.11 2018/03/16 08:10:26 pgoyette Exp $
+#      $NetBSD: files.common,v 1.1.2.12 2018/03/18 02:05:21 pgoyette Exp $
 
 #
 # Generic files, used by all compat options.
@@ -70,6 +70,7 @@
 file   compat/common/kern_sa_60.c              compat_60
 file   compat/common/tty_60.c                  compat_60
 file   compat/common/kern_time_60.c            compat_60
+file   compat/common/kern_cpu_60.c             compat_60
 
 # Compatibility code for NetBSD 7.0
 file   compat/common/compat_70_mod.c           compat_70
diff -r e39d4f617808 -r 4279542304ab sys/compat/common/kern_time_60.c
--- a/sys/compat/common/kern_time_60.c  Sun Mar 18 01:17:29 2018 +0000
+++ b/sys/compat/common/kern_time_60.c  Sun Mar 18 02:05:21 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_time_60.c,v 1.1 2013/03/29 01:02:50 christos Exp $        */
+/*     $NetBSD: kern_time_60.c,v 1.1.38.1 2018/03/18 02:05:21 pgoyette Exp $   */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -29,18 +29,24 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_time_60.c,v 1.1 2013/03/29 01:02:50 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time_60.c,v 1.1.38.1 2018/03/18 02:05:21 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/lwp.h>
 #include <sys/time.h>
-#include <sys/sysctl.h>
+#include <sys/syscall.h>
+#include <sys/syscallvar.h>
 #include <sys/syscallargs.h>
 
 #include <compat/common/compat_util.h>
 #include <compat/common/compat_mod.h>
 
+static const struct syscall_package compat_60_syscalls[] = {
+       { SYS_compat_60__lwp_park, 0, (sy_call_t *)compat_60_sys__lwp_park },
+       { 0, 0, NULL }
+};
+
 int
 compat_60_sys__lwp_park(struct lwp *l,
     const struct compat_60_sys__lwp_park_args *uap, register_t *retval)
@@ -72,3 +78,17 @@
 
        return lwp_park(CLOCK_REALTIME, TIMER_ABSTIME, tsp, SCARG(uap, hint));
 }
+
+int
+kern_time_60_init(void)
+{
+
+       return syscall_establish(NULL, compat_60_syscalls);
+}
+
+int
+kern_time_60_fini(void)
+{
+
+       return syscall_disestablish(NULL, compat_60_syscalls);
+}
diff -r e39d4f617808 -r 4279542304ab sys/modules/Makefile
--- a/sys/modules/Makefile      Sun Mar 18 01:17:29 2018 +0000
+++ b/sys/modules/Makefile      Sun Mar 18 02:05:21 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.202.2.7 2018/03/16 02:55:20 pgoyette Exp $
+#      $NetBSD: Makefile,v 1.202.2.8 2018/03/18 02:05:21 pgoyette Exp $



Home | Main Index | Thread Index | Old Index