Module Name:    src
Committed By:   pooka
Date:           Sat May  2 15:20:08 UTC 2009

Modified Files:
        src/lib/libukfs: ukfs.c
        src/sys/rump/include/rump: rump.h
        src/sys/rump/librump/rumpkern: rump.c

Log Message:
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().


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/libukfs/ukfs.c
cvs rdiff -u -r1.13 -r1.14 src/sys/rump/include/rump/rump.h
cvs rdiff -u -r1.105 -r1.106 src/sys/rump/librump/rumpkern/rump.c

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

Modified files:

Index: src/lib/libukfs/ukfs.c
diff -u src/lib/libukfs/ukfs.c:1.25 src/lib/libukfs/ukfs.c:1.26
--- src/lib/libukfs/ukfs.c:1.25	Sat May  2 01:15:52 2009
+++ src/lib/libukfs/ukfs.c	Sat May  2 15:20:08 2009
@@ -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;

Index: src/sys/rump/include/rump/rump.h
diff -u src/sys/rump/include/rump/rump.h:1.13 src/sys/rump/include/rump/rump.h:1.14
--- src/sys/rump/include/rump/rump.h:1.13	Wed Apr 29 18:00:49 2009
+++ src/sys/rump/include/rump/rump.h	Sat May  2 15:20:08 2009
@@ -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);

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.105 src/sys/rump/librump/rumpkern/rump.c:1.106
--- src/sys/rump/librump/rumpkern/rump.c:1.105	Thu Apr 30 16:59:32 2009
+++ src/sys/rump/librump/rumpkern/rump.c	Sat May  2 15:20:08 2009
@@ -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 *);

Reply via email to