Module Name:    src
Committed By:   pgoyette
Date:           Thu Apr 23 23:23:14 UTC 2015

Modified Files:
        src/sys/rump/dev/lib/libsysmon: sysmon_component.c

Log Message:
Update initialization of sysmon rump library sub-components. These are now 
handled as part of module initialization, and do not require manual invocation.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/dev/lib/libsysmon/sysmon_component.c

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

Modified files:

Index: src/sys/rump/dev/lib/libsysmon/sysmon_component.c
diff -u src/sys/rump/dev/lib/libsysmon/sysmon_component.c:1.1 src/sys/rump/dev/lib/libsysmon/sysmon_component.c:1.2
--- src/sys/rump/dev/lib/libsysmon/sysmon_component.c:1.1	Thu Mar 13 01:47:07 2014
+++ src/sys/rump/dev/lib/libsysmon/sysmon_component.c	Thu Apr 23 23:23:14 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysmon_component.c,v 1.1 2014/03/13 01:47:07 pooka Exp $	*/
+/*	$NetBSD: sysmon_component.c,v 1.2 2015/04/23 23:23:14 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysmon_component.c,v 1.1 2014/03/13 01:47:07 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_component.c,v 1.2 2015/04/23 23:23:14 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -40,27 +40,22 @@ __KERNEL_RCSID(0, "$NetBSD: sysmon_compo
 #include "rump_dev_private.h"
 #include "rump_vfs_private.h"
 
-#include "ioconf.c"
-
-void swwdogattach(int);
-void swsensorattach(int);
-
 RUMP_COMPONENT(RUMP_COMPONENT_DEV)
 {
 	extern const struct cdevsw sysmon_cdevsw;
 	devmajor_t bmaj, cmaj;
 	int error;
 
-	if ((error = config_init_component(cfdriver_ioconf_swwdog,
-	    cfattach_ioconf_swwdog, cfdata_ioconf_swwdog)) != 0) {
-		printf("cannot attach swwdog: %d\n", error);
-		return;
-	}
-
+	/*
+	 * Temporarily attach the devsw so we can determine our
+	 * major device number.  We'll detach it immediately, so
+	 * normal module initialization can permanently attach.
+	 */
 	bmaj = cmaj = -1;
 	if ((error = devsw_attach("sysmon", NULL, &bmaj,
 	    &sysmon_cdevsw, &cmaj)) != 0)
 		panic("sysmon devsw attach failed: %d", error);
+	devsw_detach(NULL, &sysmon_cdevsw);
 
 	if ((error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/sysmon",
 	    cmaj, SYSMON_MINOR_ENVSYS)) != 0)
@@ -71,12 +66,4 @@ RUMP_COMPONENT(RUMP_COMPONENT_DEV)
 	if ((error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/power",
 	    cmaj, SYSMON_MINOR_POWER)) != 0)
 		panic("cannot create /dev/power: %d", error);
-
-	sysmon_task_queue_preinit();
-	sysmon_task_queue_init();
-	sysmon_envsys_init();
-	sysmon_power_init();
-	sysmon_wdog_init();
-
-	rump_pdev_add(swwdogattach, 0);
 }

Reply via email to