summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2002-03-19 06:14:34 +0000
committeralfred <alfred@FreeBSD.org>2002-03-19 06:14:34 +0000
commit678a5827b019dd2ddfb5e05517a940dbbf41b617 (patch)
tree57415b8129187301a7d79d4adbebf0ceaefe02b8 /sys/i386
parentc900f7bd6fb6ff230c7c7f0120909bcbc1c7c6f7 (diff)
downloadFreeBSD-src-678a5827b019dd2ddfb5e05517a940dbbf41b617.zip
FreeBSD-src-678a5827b019dd2ddfb5e05517a940dbbf41b617.tar.gz
fix perfmon for DEVFS.
PR: kern/36008
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/perfmon.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/i386/i386/perfmon.c b/sys/i386/i386/perfmon.c
index 4d6c9a2..3b446d6 100644
--- a/sys/i386/i386/perfmon.c
+++ b/sys/i386/i386/perfmon.c
@@ -58,6 +58,16 @@ static d_close_t perfmon_close;
static d_open_t perfmon_open;
static d_ioctl_t perfmon_ioctl;
+/*
+ * XXX perfmon_init_dev(void *) is a split from the perfmon_init() funtion.
+ * This solves a problem for DEVFS users. It loads the "perfmon" driver after
+ * the DEVFS subsystem has been kicked into action. The SI_ORDER_ANY is to
+ * assure that it is the most lowest priority task which, guarantees the
+ * above.
+ */
+static void perfmon_init_dev __P((void *));
+SYSINIT(cpu, SI_SUB_DRIVERS, SI_ORDER_ANY, perfmon_init_dev, NULL);
+
#define CDEV_MAJOR 2 /* We're really a minor of mem.c */
static struct cdevsw perfmon_cdevsw = {
/* open */ perfmon_open,
@@ -105,6 +115,12 @@ perfmon_init(void)
break;
}
#endif /* SMP */
+}
+
+static void
+perfmon_init_dev(dummy)
+ void *dummy;
+{
make_dev(&perfmon_cdevsw, 32, UID_ROOT, GID_KMEM, 0640, "perfmon");
}
OpenPOWER on IntegriCloud