Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Split config_init() into config_init() and config_init_m...
details: https://anonhg.NetBSD.org/src/rev/e4eaa3d23df8
branches: trunk
changeset: 747568:e4eaa3d23df8
user: pooka <pooka%NetBSD.org@localhost>
date: Mon Sep 21 12:14:46 2009 +0000
description:
Split config_init() into config_init() and config_init_mi() to help
platforms which want to call config_init() very early in the boot.
diffstat:
sys/kern/init_main.c | 6 +++---
sys/kern/subr_autoconf.c | 22 +++++++++++++++-------
sys/rump/librump/rumpdev/rump_dev.c | 6 +++---
sys/sys/device.h | 3 ++-
4 files changed, 23 insertions(+), 14 deletions(-)
diffs (129 lines):
diff -r b522bcf591bf -r e4eaa3d23df8 sys/kern/init_main.c
--- a/sys/kern/init_main.c Mon Sep 21 08:12:47 2009 +0000
+++ b/sys/kern/init_main.c Mon Sep 21 12:14:46 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: init_main.c,v 1.400 2009/09/16 15:23:04 pooka Exp $ */
+/* $NetBSD: init_main.c,v 1.401 2009/09/21 12:14:46 pooka Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.400 2009/09/16 15:23:04 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.401 2009/09/21 12:14:46 pooka Exp $");
#include "opt_ddb.h"
#include "opt_ipsec.h"
@@ -716,7 +716,7 @@
{
/* Initialize autoconf data structures. */
- config_init();
+ config_init_mi();
/*
* XXX
* callout_setfunc() requires mutex(9) so it can't be in config_init()
diff -r b522bcf591bf -r e4eaa3d23df8 sys/kern/subr_autoconf.c
--- a/sys/kern/subr_autoconf.c Mon Sep 21 08:12:47 2009 +0000
+++ b/sys/kern/subr_autoconf.c Mon Sep 21 12:14:46 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.184 2009/09/16 22:45:24 dyoung Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.185 2009/09/21 12:14:47 pooka Exp $ */
/*
* Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.184 2009/09/16 22:45:24 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.185 2009/09/21 12:14:47 pooka Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -219,7 +219,7 @@
#define STREQ(s1, s2) \
(*(s1) == *(s2) && strcmp((s1), (s2)) == 0)
-static int config_initialized; /* config_init() has been called. */
+static bool config_initialized = false; /* config_init() has been called. */
static int config_do_twiddle;
static callout_t config_twiddle_ch;
@@ -237,8 +237,7 @@
const struct cfattachinit *cfai;
int i, j;
- if (config_initialized)
- return;
+ KASSERT(config_initialized == false);
mutex_init(&alldevs_mtx, MUTEX_DEFAULT, IPL_NONE);
cv_init(&alldevs_cv, "alldevs");
@@ -268,9 +267,18 @@
initcftable.ct_cfdata = cfdata;
TAILQ_INSERT_TAIL(&allcftables, &initcftable, ct_list);
- sysctl_detach_setup(NULL);
+
+ config_initialized = true;
+}
- config_initialized = 1;
+void
+config_init_mi(void)
+{
+
+ if (!config_initialized)
+ config_init();
+
+ sysctl_detach_setup(NULL);
}
void
diff -r b522bcf591bf -r e4eaa3d23df8 sys/rump/librump/rumpdev/rump_dev.c
--- a/sys/rump/librump/rumpdev/rump_dev.c Mon Sep 21 08:12:47 2009 +0000
+++ b/sys/rump/librump/rumpdev/rump_dev.c Mon Sep 21 12:14:46 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rump_dev.c,v 1.4 2009/09/20 23:16:09 pooka Exp $ */
+/* $NetBSD: rump_dev.c,v 1.5 2009/09/21 12:14:47 pooka Exp $ */
/*
* Copyright (c) 2009 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump_dev.c,v 1.4 2009/09/20 23:16:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_dev.c,v 1.5 2009/09/21 12:14:47 pooka Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -44,7 +44,7 @@
rump_dev_init(void)
{
- config_init();
+ config_init_mi();
rump_dev_cgd_init();
rump_dev_raidframe_init();
diff -r b522bcf591bf -r e4eaa3d23df8 sys/sys/device.h
--- a/sys/sys/device.h Mon Sep 21 08:12:47 2009 +0000
+++ b/sys/sys/device.h Mon Sep 21 12:14:46 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.123 2009/09/16 22:45:23 dyoung Exp $ */
+/* $NetBSD: device.h,v 1.124 2009/09/21 12:14:47 pooka Exp $ */
/*
* Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -422,6 +422,7 @@
int config_handle_wedges(struct device *, int);
void config_init(void);
+void config_init_mi(void);
void drvctl_init(void);
int config_cfdriver_attach(struct cfdriver *);
Home |
Main Index |
Thread Index |
Old Index