Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/netbsd32 Add MODULE infrastructure to netbsd32_nf...
details: https://anonhg.NetBSD.org/src/rev/97144095b368
branches: trunk
changeset: 341971:97144095b368
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Tue Dec 01 09:12:23 2015 +0000
description:
Add MODULE infrastructure to netbsd32_nfssvc.c, remove dependency on it
from netbsd32_mod.c
diffstat:
sys/compat/netbsd32/netbsd32_mod.c | 6 ++--
sys/compat/netbsd32/netbsd32_nfssvc.c | 36 +++++++++++++++++++++++++++++++++-
2 files changed, 37 insertions(+), 5 deletions(-)
diffs (95 lines):
diff -r 7944a91866b6 -r 97144095b368 sys/compat/netbsd32/netbsd32_mod.c
--- a/sys/compat/netbsd32/netbsd32_mod.c Tue Dec 01 09:10:49 2015 +0000
+++ b/sys/compat/netbsd32/netbsd32_mod.c Tue Dec 01 09:12:23 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_mod.c,v 1.10 2015/11/30 01:31:02 pgoyette Exp $ */
+/* $NetBSD: netbsd32_mod.c,v 1.11 2015/12/01 09:12:23 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.10 2015/11/30 01:31:02 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_mod.c,v 1.11 2015/12/01 09:12:23 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_execfmt.h"
@@ -48,7 +48,7 @@
#include <compat/netbsd32/netbsd32_sysctl.h>
#include <compat/netbsd32/netbsd32_exec.h>
-# define DEPS1 "compat,compat_sysv,nfsserver,mqueue,ksem"
+# define DEPS1 "compat,compat_sysv,mqueue,ksem"
#if defined(EXEC_ELF32)
# define DEPS2 ",exec_elf32"
diff -r 7944a91866b6 -r 97144095b368 sys/compat/netbsd32/netbsd32_nfssvc.c
--- a/sys/compat/netbsd32/netbsd32_nfssvc.c Tue Dec 01 09:10:49 2015 +0000
+++ b/sys/compat/netbsd32/netbsd32_nfssvc.c Tue Dec 01 09:12:23 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_nfssvc.c,v 1.3 2015/08/05 23:17:06 mrg Exp $ */
+/* $NetBSD: netbsd32_nfssvc.c,v 1.4 2015/12/01 09:12:23 pgoyette Exp $ */
/*
* Copyright (c) 2015 Matthew R. Green
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_nfssvc.c,v 1.3 2015/08/05 23:17:06 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_nfssvc.c,v 1.4 2015/12/01 09:12:23 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_nfs.h"
@@ -40,6 +40,8 @@
#include <sys/param.h>
#include <sys/vnode.h>
#include <sys/filedesc.h>
+#include <sys/module.h>
+#include <sys/syscallvar.h>
#include <compat/netbsd32/netbsd32.h>
#include <compat/netbsd32/netbsd32_syscall.h>
@@ -51,6 +53,8 @@
#include <nfs/nfs.h>
#include <nfs/nfs_var.h>
+extern struct emul emul_netbsd32;
+
static int nfssvc32_addsock_in(struct nfsd_args *, const void *);
static int nfssvc32_setexports_in(struct mountd_exports_list *, const void *);
static int nfssvc32_nsd_in(struct nfsd_srvargs *, const void *);
@@ -186,3 +190,31 @@
return do_nfssvc(&netbsd32_ops, l, flag, argp, retval);
}
+
+static const struct syscall_package compat_nfssvc_syscalls[] = {
+ { NETBSD32_SYS_netbsd32_nfssvc, 0, (sy_call_t *)netbsd32_nfssvc },
+ { 0, 0, NULL },
+};
+
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_nfssrv, "nfsserver,compat_netbsd32");
+
+static int
+compat_netbsd32_nfssrv_modcmd(modcmd_t cmd, void *arg)
+{
+ int error;
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ error = syscall_establish(&emul_netbsd32,
+ compat_nfssvc_syscalls);
+ break;
+ case MODULE_CMD_FINI:
+ error = syscall_disestablish(&emul_netbsd32,
+ compat_nfssvc_syscalls);
+ break;
+ default:
+ error = ENOTTY;
+ break;
+ }
+ return error;
+}
Home |
Main Index |
Thread Index |
Old Index