Module Name:    src
Committed By:   pgoyette
Date:           Sun Mar 18 09:00:56 UTC 2018

Modified Files:
        src/sys/compat/common [pgoyette-compat]: compat_60_mod.c compat_mod.h
            kern_cpu_60.c kern_sa_60.c
        src/sys/compat/sys [pgoyette-compat]: cpuio.h

Log Message:
Clean-up for kern_cpu_60 code.

Also, although not strictly necessary, include the kern_sa_60 stuff in
the compat_60 module, for completeness.

Still need to deal with some tty code and the ccd driver to finish off
the compat_60 module.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/sys/compat/common/compat_60_mod.c
cvs rdiff -u -r1.1.42.4 -r1.1.42.5 src/sys/compat/common/compat_mod.h
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/compat/common/kern_cpu_60.c
cvs rdiff -u -r1.1.42.2 -r1.1.42.3 src/sys/compat/common/kern_sa_60.c
cvs rdiff -u -r1.5.16.3 -r1.5.16.4 src/sys/compat/sys/cpuio.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/common/compat_60_mod.c
diff -u src/sys/compat/common/compat_60_mod.c:1.1.2.6 src/sys/compat/common/compat_60_mod.c:1.1.2.7
--- src/sys/compat/common/compat_60_mod.c:1.1.2.6	Sun Mar 18 02:05:21 2018
+++ src/sys/compat/common/compat_60_mod.c	Sun Mar 18 09:00:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_60_mod.c,v 1.1.2.6 2018/03/18 02:05:21 pgoyette Exp $	*/
+/*	$NetBSD: compat_60_mod.c,v 1.1.2.7 2018/03/18 09:00:55 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.6 2018/03/18 02:05:21 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_60_mod.c,v 1.1.2.7 2018/03/18 09:00:55 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -51,11 +51,13 @@ __KERNEL_RCSID(0, "$NetBSD: compat_60_mo
 #include <compat/common/compat_util.h>
 #include <compat/common/compat_mod.h>
 
+#include <compat/sys/cpuio.h>
+
 #define REQUIRED_60 "compat_70"		/* XXX No compat_80 yet */
 MODULE(MODULE_CLASS_EXEC, compat_60, REQUIRED_60);
 
 int
-compat_60_init()
+compat_60_init(void)
 {
 	int error = 0;
 
@@ -63,6 +65,12 @@ compat_60_init()
 	if (error != 0)
 		return error;
 
+	error = kern_sa_60_init();
+	if (error != 0) {
+		kern_time_60_fini();
+		return 0;
+	}
+
 #ifdef CPU_UCODE
 	error = kern_cpu_60_init();
 	if (error != 0) {
@@ -75,7 +83,7 @@ compat_60_init()
 }
 
 int
-compat_60_fini()
+compat_60_fini(void)
 {
 	int error = 0;
 
@@ -85,9 +93,23 @@ compat_60_fini()
 		return error;
 #endif
 
+	error = kern_sa_60_fini();
+	if (error != 0) {
+#ifdef CPU_UCODE
+		kern_cpu_60_init();
+#endif
+		return error;
+	}
+
 	error = kern_time_60_fini();
-	if (error != 0)
+	if (error != 0) {
+		kern_sa_60_init();
+#ifdef CPU_UCODE
 		kern_cpu_60_init();
+#endif
+		return error;
+	}
+
 
 	return error;
 }

Index: src/sys/compat/common/compat_mod.h
diff -u src/sys/compat/common/compat_mod.h:1.1.42.4 src/sys/compat/common/compat_mod.h:1.1.42.5
--- src/sys/compat/common/compat_mod.h:1.1.42.4	Sun Mar 18 02:05:21 2018
+++ src/sys/compat/common/compat_mod.h	Sun Mar 18 09:00:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_mod.h,v 1.1.42.4 2018/03/18 02:05:21 pgoyette Exp $	*/
+/*	$NetBSD: compat_mod.h,v 1.1.42.5 2018/03/18 09:00:55 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -50,8 +50,8 @@ 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_sa_60_init(void);
+int kern_sa_60_fini(void);
 int kern_tty_60_init(void);
 int kern_tty_60_fini(void);
 #endif

Index: src/sys/compat/common/kern_cpu_60.c
diff -u src/sys/compat/common/kern_cpu_60.c:1.1.2.3 src/sys/compat/common/kern_cpu_60.c:1.1.2.4
--- src/sys/compat/common/kern_cpu_60.c:1.1.2.3	Sun Mar 18 01:17:29 2018
+++ src/sys/compat/common/kern_cpu_60.c	Sun Mar 18 09:00:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_cpu_60.c,v 1.1.2.3 2018/03/18 01:17:29 pgoyette Exp $	*/
+/*	$NetBSD: kern_cpu_60.c,v 1.1.2.4 2018/03/18 09:00:55 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu_60.c,v 1.1.2.3 2018/03/18 01:17:29 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu_60.c,v 1.1.2.4 2018/03/18 09:00:55 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_cpu_ucode.h"
@@ -44,9 +44,8 @@ __KERNEL_RCSID(0, "$NetBSD: kern_cpu_60.
 #include <sys/kauth.h>
 #include <sys/lwp.h>
 #include <sys/cpu.h>
-#include <sys/cpuio.h>
 
-#include <compat/common/compat_mod.h>
+#include <compat/sys/cpuio.h>
 
 static int
 compat6_cpuctl_ioctl(struct lwp *l, u_long cmd, void *data)

Index: src/sys/compat/common/kern_sa_60.c
diff -u src/sys/compat/common/kern_sa_60.c:1.1.42.2 src/sys/compat/common/kern_sa_60.c:1.1.42.3
--- src/sys/compat/common/kern_sa_60.c:1.1.42.2	Fri Mar 16 08:10:26 2018
+++ src/sys/compat/common/kern_sa_60.c	Sun Mar 18 09:00:55 2018
@@ -29,12 +29,27 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: kern_sa_60.c,v 1.1.42.2 2018/03/16 08:10:26 pgoyette Exp $");
+__KERNEL_RCSID(1, "$NetBSD: kern_sa_60.c,v 1.1.42.3 2018/03/18 09:00:55 pgoyette Exp $");
 
 #include <sys/systm.h>
 #include <sys/syscall.h>
+#include <sys/syscallvar.h>
 #include <sys/syscallargs.h>
 
+#include <compat/common/compat_mod.h>
+
+static const struct syscall_package kern_sa_60_syscalls[] = {
+	{ SYS_compat_60_sa_register, 0,
+	     (sy_call_t *)compat_60_sys_sa_register },
+	{ SYS_compat_60_sa_stacks, 0, (sy_call_t *)compat_60_sys_sa_stacks },
+	{ SYS_compat_60_sa_enable, 0, (sy_call_t *)compat_60_sys_sa_enable },
+	{ SYS_compat_60_sa_setconcurrency, 0,
+	     (sy_call_t *)compat_60_sys_sa_setconcurrency },
+	{ SYS_compat_60_sa_yield, 0, (sy_call_t *)compat_60_sys_sa_yield },
+	{ SYS_compat_60_sa_preempt, 0, (sy_call_t *)compat_60_sys_sa_preempt },
+	{ 0, 0, NULL }
+};
+
 int
 compat_60_sys_sa_register(lwp_t *l,
 	const struct compat_60_sys_sa_register_args *uap,
@@ -82,3 +97,17 @@ compat_60_sys_sa_preempt(lwp_t *l,
 {
 	return sys_nosys(l, uap, retval);
 }
+
+int
+kern_sa_60_init(void)
+{
+
+	return syscall_establish(NULL, kern_sa_60_syscalls);
+}
+
+int
+kern_sa_60_fini(void)
+{
+
+	return syscall_disestablish(NULL, kern_sa_60_syscalls);
+}

Index: src/sys/compat/sys/cpuio.h
diff -u src/sys/compat/sys/cpuio.h:1.5.16.3 src/sys/compat/sys/cpuio.h:1.5.16.4
--- src/sys/compat/sys/cpuio.h:1.5.16.3	Sun Mar 18 01:17:29 2018
+++ src/sys/compat/sys/cpuio.h	Sun Mar 18 09:00:55 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuio.h,v 1.5.16.3 2018/03/18 01:17:29 pgoyette Exp $ */
+/* $NetBSD: cpuio.h,v 1.5.16.4 2018/03/18 09:00:55 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -44,4 +44,7 @@ extern int (*compat_cpuctl_ioctl)(struct
 #define OIOC_CPU_UCODE_GET_VERSION      _IOR('c', 4, struct compat6_cpu_ucode)
 #define OIOC_CPU_UCODE_APPLY            _IOW('c', 5, struct compat6_cpu_ucode)
 
+int kern_cpu_60_init(void);
+int kern_cpu_60_fini(void);
+
 #endif /* _COMPAT_SYS_CPUIO_H */

Reply via email to