Sat May 2 15:20:08 2009 UTC ()
Since rump_module_load() doesn't actually load the module, change
the name to rump_module_init().  Also, adjust the signature to take
a direct pointer to modinfo and allow passing of props.  Finally,
provide rump_module_fini().


(pooka)
diff -r1.25 -r1.26 src/lib/libukfs/ukfs.c
diff -r1.13 -r1.14 src/sys/rump/include/rump/rump.h
diff -r1.105 -r1.106 src/sys/rump/librump/rumpkern/rump.c

cvs diff -r1.25 -r1.26 src/lib/libukfs/ukfs.c (expand / switch to context diff)
--- src/lib/libukfs/ukfs.c 2009/05/02 01:15:52 1.25
+++ src/lib/libukfs/ukfs.c 2009/05/02 15:20:08 1.26
@@ -1,4 +1,4 @@
-/*	$NetBSD: ukfs.c,v 1.25 2009/05/02 01:15:52 pooka Exp $	*/
+/*	$NetBSD: ukfs.c,v 1.26 2009/05/02 15:20:08 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008  Antti Kantee.  All Rights Reserved.
@@ -675,7 +675,8 @@
 int
 ukfs_modload(const char *fname)
 {
-	void *handle, *thesym;
+	void *handle;
+	struct modinfo **mi;
 	struct stat sb;
 	int error;
 
@@ -692,9 +693,9 @@
 		return -1;
 	}
 
-	thesym = dlsym(handle, "__start_link_set_modules");
-	if (thesym) {
-		error = rump_module_load(thesym);
+	mi = dlsym(handle, "__start_link_set_modules");
+	if (mi) {
+		error = rump_module_init(*mi, NULL);
 		if (error)
 			goto errclose;
 		return 1;

cvs diff -r1.13 -r1.14 src/sys/rump/include/rump/rump.h (expand / switch to context diff)
--- src/sys/rump/include/rump/rump.h 2009/04/29 18:00:49 1.13
+++ src/sys/rump/include/rump/rump.h 2009/05/02 15:20:08 1.14
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.h,v 1.13 2009/04/29 18:00:49 pooka Exp $	*/
+/*	$NetBSD: rump.h,v 1.14 2009/05/02 15:20:08 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -43,10 +43,17 @@
 struct fid;
 struct statvfs;
 
+/* yetch */
 #if !defined(_RUMPKERNEL) && !defined(__NetBSD__)
 struct kauth_cred;
 typedef struct kauth_cred *kauth_cred_t;
 #endif
+#if defined(__NetBSD__)
+#include <prop/proplib.h>
+#else
+struct prop_dictionary;
+typedef struct prop_dictionary *prop_dictionary_t;
+#endif /* __NetBSD__ */
 
 struct lwp;
 struct modinfo;
@@ -64,7 +71,8 @@
  */
 #define RUMP_VERSION	01
 #define rump_init()	rump__init(RUMP_VERSION)
-int	rump_module_load(struct modinfo **);
+int	rump_module_init(struct modinfo *, prop_dictionary_t props);
+int	rump_module_fini(struct modinfo *);
 
 int		rump__init(int);
 struct mount	*rump_mnt_init(struct vfsops *, int);

cvs diff -r1.105 -r1.106 src/sys/rump/librump/rumpkern/rump.c (expand / switch to context diff)
--- src/sys/rump/librump/rumpkern/rump.c 2009/04/30 16:59:32 1.105
+++ src/sys/rump/librump/rumpkern/rump.c 2009/05/02 15:20:08 1.106
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.105 2009/04/30 16:59:32 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.106 2009/05/02 15:20:08 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.105 2009/04/30 16:59:32 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.106 2009/05/02 15:20:08 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -482,13 +482,20 @@
 }
 
 int
-rump_module_load(struct modinfo **mi)
+rump_module_init(struct modinfo *mi, prop_dictionary_t props)
 {
 
-	if (!module_compatible((*mi)->mi_version, __NetBSD_Version__))
+	if (!module_compatible(mi->mi_version, __NetBSD_Version__))
 		return EPROGMISMATCH;
 
-	return (*mi)->mi_modcmd(MODULE_CMD_INIT, NULL);
+	return mi->mi_modcmd(MODULE_CMD_INIT, props);
+}
+
+int
+rump_module_fini(struct modinfo *mi)
+{
+
+	return mi->mi_modcmd(MODULE_CMD_FINI, NULL);
 }
 
 int _syspuffs_stub(int, int *);