Sat Oct 17 13:52:52 2015 UTC ()
initialize MODULE_CLASS_DRIVER modules before the drivers themselves are loaded during autoconfiguration


(jmcneill)
diff -r1.470 -r1.471 src/sys/kern/init_main.c

cvs diff -r1.470 -r1.471 src/sys/kern/init_main.c (expand / switch to unified diff)

--- src/sys/kern/init_main.c 2015/09/14 01:40:03 1.470
+++ src/sys/kern/init_main.c 2015/10/17 13:52:52 1.471
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: init_main.c,v 1.470 2015/09/14 01:40:03 uebayasi Exp $ */ 1/* $NetBSD: init_main.c,v 1.471 2015/10/17 13:52:52 jmcneill Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -87,27 +87,27 @@ @@ -87,27 +87,27 @@
87 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 87 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
88 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 88 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
89 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 89 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
90 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 90 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
91 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 91 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
92 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 92 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
93 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 93 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
94 * SUCH DAMAGE. 94 * SUCH DAMAGE.
95 * 95 *
96 * @(#)init_main.c 8.16 (Berkeley) 5/14/95 96 * @(#)init_main.c 8.16 (Berkeley) 5/14/95
97 */ 97 */
98 98
99#include <sys/cdefs.h> 99#include <sys/cdefs.h>
100__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.470 2015/09/14 01:40:03 uebayasi Exp $"); 100__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.471 2015/10/17 13:52:52 jmcneill Exp $");
101 101
102#include "opt_ddb.h" 102#include "opt_ddb.h"
103#include "opt_ipsec.h" 103#include "opt_ipsec.h"
104#include "opt_modular.h" 104#include "opt_modular.h"
105#include "opt_ntp.h" 105#include "opt_ntp.h"
106#include "opt_pipe.h" 106#include "opt_pipe.h"
107#include "opt_syscall_debug.h" 107#include "opt_syscall_debug.h"
108#include "opt_sysv.h" 108#include "opt_sysv.h"
109#include "opt_fileassoc.h" 109#include "opt_fileassoc.h"
110#include "opt_ktrace.h" 110#include "opt_ktrace.h"
111#include "opt_pax.h" 111#include "opt_pax.h"
112#include "opt_compat_netbsd.h" 112#include "opt_compat_netbsd.h"
113#include "opt_wapbl.h" 113#include "opt_wapbl.h"
@@ -729,26 +729,29 @@ configure(void) @@ -729,26 +729,29 @@ configure(void)
729 /* 729 /*
730 * XXX 730 * XXX
731 * callout_setfunc() requires mutex(9) so it can't be in config_init() 731 * callout_setfunc() requires mutex(9) so it can't be in config_init()
732 * on amiga and atari which use config_init() and autoconf(9) fucntions 732 * on amiga and atari which use config_init() and autoconf(9) fucntions
733 * to initialize console devices. 733 * to initialize console devices.
734 */ 734 */
735 config_twiddle_init(); 735 config_twiddle_init();
736 736
737 pmf_init(); 737 pmf_init();
738#if NDRVCTL > 0 738#if NDRVCTL > 0
739 drvctl_init(); 739 drvctl_init();
740#endif 740#endif
741 741
 742 /* Initialize driver modules */
 743 module_init_class(MODULE_CLASS_DRIVER);
 744
742 userconf_init(); 745 userconf_init();
743 if (boothowto & RB_USERCONF) 746 if (boothowto & RB_USERCONF)
744 userconf_prompt(); 747 userconf_prompt();
745 748
746 if ((boothowto & (AB_SILENT|AB_VERBOSE)) == AB_SILENT) { 749 if ((boothowto & (AB_SILENT|AB_VERBOSE)) == AB_SILENT) {
747 printf_nolog("Detecting hardware..."); 750 printf_nolog("Detecting hardware...");
748 } 751 }
749 752
750 /* 753 /*
751 * Do the machine-dependent portion of autoconfiguration. This 754 * Do the machine-dependent portion of autoconfiguration. This
752 * sets the configuration machinery here in motion by "finding" 755 * sets the configuration machinery here in motion by "finding"
753 * the root bus. When this function returns, we expect interrupts 756 * the root bus. When this function returns, we expect interrupts
754 * to be enabled. 757 * to be enabled.