Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/pgoyette-compat]: src/sys Move netbsd32_rndpseudo_50.c out of the main n...
details: https://anonhg.NetBSD.org/src/rev/8587185d2bf1
branches: pgoyette-compat
changeset: 830668:8587185d2bf1
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Tue Sep 11 23:26:21 2018 +0000
description:
Move netbsd32_rndpseudo_50.c out of the main netbsd32 module and into
the module that handles netbsd32_50 compatability.
diffstat:
sys/compat/netbsd32/netbsd32_compat_50.c | 19 +++++++++++++++----
sys/compat/netbsd32/netbsd32_mod.c | 13 +++++--------
sys/modules/compat_netbsd32/Makefile | 3 +--
sys/modules/compat_netbsd32_50/Makefile | 4 ++--
4 files changed, 23 insertions(+), 16 deletions(-)
diffs (150 lines):
diff -r 2ca2227c8d39 -r 8587185d2bf1 sys/compat/netbsd32/netbsd32_compat_50.c
--- a/sys/compat/netbsd32/netbsd32_compat_50.c Tue Sep 11 21:18:32 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_50.c Tue Sep 11 23:26:21 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_compat_50.c,v 1.32.16.6 2018/09/11 21:18:32 pgoyette Exp $ */
+/* $NetBSD: netbsd32_compat_50.c,v 1.32.16.7 2018/09/11 23:26:21 pgoyette Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.32.16.6 2018/09/11 21:18:32 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.32.16.7 2018/09/11 23:26:21 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -65,6 +65,7 @@
#include <sys/dirent.h>
#include <sys/kauth.h>
#include <sys/vfs_syscalls.h>
+#include <sys/rnd.h>
#include <compat/netbsd32/netbsd32.h>
#include <compat/netbsd32/netbsd32_syscall.h>
@@ -72,6 +73,7 @@
#include <compat/netbsd32/netbsd32_conv.h>
#include <compat/sys/mount.h>
#include <compat/sys/time.h>
+#include <compat/sys/rnd.h>
#if defined(COMPAT_50)
@@ -992,15 +994,24 @@
static int
compat_netbsd32_50_modcmd(modcmd_t cmd, void *arg)
{
+ int ret;
switch (cmd) {
case MODULE_CMD_INIT:
- return syscall_establish(&emul_netbsd32,
+ vec_compat32_50_rnd_ioctl = compat32_50_rnd_ioctl;
+ ret = syscall_establish(&emul_netbsd32,
compat_netbsd32_50_syscalls);
+ if (ret)
+ vec_compat32_50_rnd_ioctl = (void *)enosys;
+ return ret;
case MODULE_CMD_FINI:
- return syscall_disestablish(&emul_netbsd32,
+ vec_compat32_50_rnd_ioctl = (void *)enosys;
+ ret = syscall_disestablish(&emul_netbsd32,
compat_netbsd32_50_syscalls);
+ if (ret)
+ vec_compat32_50_rnd_ioctl = compat32_50_rnd_ioctl;
+ return ret;
default:
return ENOTTY;
diff -r 2ca2227c8d39 -r 8587185d2bf1 sys/compat/netbsd32/netbsd32_mod.c
--- a/sys/compat/netbsd32/netbsd32_mod.c Tue Sep 11 21:18:32 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_mod.c Tue Sep 11 23:26:21 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_mod.c,v 1.13.16.5 2018/09/11 04:53:42 pgoyette Exp $ */
+/* $NetBSD: netbsd32_mod.c,v 1.13.16.6 2018/09/11 23:26:21 pgoyette Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_mod.c,v 1.13.16.5 2018/09/11 04:53:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_mod.c,v 1.13.16.6 2018/09/11 23:26:21 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_execfmt.h"
@@ -44,11 +44,9 @@
#include <sys/module.h>
#include <sys/exec.h>
#include <sys/exec_elf.h>
-#include <sys/rnd.h>
#include <compat/netbsd32/netbsd32_sysctl.h>
#include <compat/netbsd32/netbsd32_exec.h>
-#include <compat/sys/rnd.h>
# define DEPS1 "compat_09,ksem"
@@ -114,21 +112,20 @@
netbsd32_sysctl_init();
error = exec_add(netbsd32_execsw,
__arraycount(netbsd32_execsw));
- vec_compat32_50_rnd_ioctl = compat32_50_rnd_ioctl;
vec_compat32_80_modctl = compat32_80_modctl_compat_stub;
if (error != 0) {
- vec_compat32_50_rnd_ioctl = (void *)enosys;
vec_compat32_80_modctl = (void *)enosys;
netbsd32_sysctl_fini();
}
return error;
case MODULE_CMD_FINI:
- vec_compat32_50_rnd_ioctl = (void *)enosys;
vec_compat32_80_modctl = (void *)enosys;
error = exec_remove(netbsd32_execsw,
__arraycount(netbsd32_execsw));
- if (error == 0)
+ if (error)
+ vec_compat32_80_modctl = compat32_80_modctl_compat_stub;
+ else
netbsd32_sysctl_fini();
return error;
diff -r 2ca2227c8d39 -r 8587185d2bf1 sys/modules/compat_netbsd32/Makefile
--- a/sys/modules/compat_netbsd32/Makefile Tue Sep 11 21:18:32 2018 +0000
+++ b/sys/modules/compat_netbsd32/Makefile Tue Sep 11 23:26:21 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20.12.6 2018/09/11 07:01:10 pgoyette Exp $
+# $NetBSD: Makefile,v 1.20.12.7 2018/09/11 23:26:21 pgoyette Exp $
.include "../Makefile.inc"
.include "../Makefile.assym"
@@ -36,7 +36,6 @@
SRCS+= netbsd32_socket.c netbsd32_syscalls.c
SRCS+= netbsd32_sysctl.c netbsd32_sysent.c
SRCS+= netbsd32_time.c netbsd32_wait.c
-SRCS+= netbsd32_rndpseudo_50.c
SRCS+= netbsd32_mod.c netbsd32_module.c
.if ${MACHINE_CPU} != "mips" && ${MACHINE_CPU} != "powerpc"
diff -r 2ca2227c8d39 -r 8587185d2bf1 sys/modules/compat_netbsd32_50/Makefile
--- a/sys/modules/compat_netbsd32_50/Makefile Tue Sep 11 21:18:32 2018 +0000
+++ b/sys/modules/compat_netbsd32_50/Makefile Tue Sep 11 23:26:21 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1.2.2 2018/09/11 04:20:51 pgoyette Exp $
+# $NetBSD: Makefile,v 1.1.2.3 2018/09/11 23:26:21 pgoyette Exp $
.include "../Makefile.inc"
@@ -9,6 +9,6 @@
CPPFLAGS+= -DCOMPAT_NETBSD32
CPPFLAGS+= -DCOMPAT_50 -DCOMPAT_60 -DCOMPAT_70 -DCOMPAT_80
-SRCS+= netbsd32_compat_50.c
+SRCS+= netbsd32_compat_50.c netbsd32_rndpseudo_50.c
.include <bsd.kmodule.mk>
Home |
Main Index |
Thread Index |
Old Index