Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/dev/lib/libsysmon Update initialization of sysmon r...
details: https://anonhg.NetBSD.org/src/rev/45ec0d1fcb17
branches: trunk
changeset: 337692:45ec0d1fcb17
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Thu Apr 23 23:23:14 2015 +0000
description:
Update initialization of sysmon rump library sub-components. These are now handled as part of module initialization, and do not require manual invocation.
diffstat:
sys/rump/dev/lib/libsysmon/sysmon_component.c | 29 +++++++-------------------
1 files changed, 8 insertions(+), 21 deletions(-)
diffs (65 lines):
diff -r 8fe6c5123d0b -r 45ec0d1fcb17 sys/rump/dev/lib/libsysmon/sysmon_component.c
--- a/sys/rump/dev/lib/libsysmon/sysmon_component.c Thu Apr 23 23:23:08 2015 +0000
+++ b/sys/rump/dev/lib/libsysmon/sysmon_component.c Thu Apr 23 23:23:14 2015 +0000
@@ -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 @@
#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 @@
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);
}
Home |
Main Index |
Thread Index |
Old Index