Module Name: src
Committed By: pooka
Date: Thu Mar 25 19:39:06 UTC 2010
Modified Files:
src/usr.bin/config: mkioconf.c
Log Message:
Generate cfdriver and cfattach lists for ioconf configs.
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/config/mkioconf.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/config/mkioconf.c
diff -u src/usr.bin/config/mkioconf.c:1.16 src/usr.bin/config/mkioconf.c:1.17
--- src/usr.bin/config/mkioconf.c:1.16 Wed Feb 3 21:32:27 2010
+++ src/usr.bin/config/mkioconf.c Thu Mar 25 19:39:05 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: mkioconf.c,v 1.16 2010/02/03 21:32:27 pooka Exp $ */
+/* $NetBSD: mkioconf.c,v 1.17 2010/03/25 19:39:05 pooka Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -95,9 +95,9 @@
emitloc(fp);
emitparents(fp);
emitcfdata(fp);
+ emitcfattachinit(fp);
if (ioconfname == NULL) {
- emitcfattachinit(fp);
emitroots(fp);
emitpseudo(fp);
if (!do_devsw)
@@ -237,11 +237,12 @@
NEWLINE;
- /* the initial list is not added to ioconf-only configs */
- if (ioconfname)
- return;
+ fprintf(fp,
+ "%sstruct cfdriver * const cfdriver_%s_%s[] = {\n",
+ ioconfname ? "static " : "",
+ ioconfname ? "comp" : "list",
+ ioconfname ? ioconfname : "initial");
- fprintf(fp, "struct cfdriver * const cfdriver_list_initial[] = {\n");
TAILQ_FOREACH(d, &allbases, d_next) {
if (!devbase_has_instances(d, WILD))
continue;
@@ -289,7 +290,10 @@
}
NEWLINE;
- fprintf(fp, "const struct cfattachinit cfattachinit[] = {\n");
+ fprintf(fp, "%sconst struct cfattachinit cfattach%s%s[] = {\n",
+ ioconfname ? "static " : "",
+ ioconfname ? "_comp_" : "init",
+ ioconfname ? ioconfname : "");
TAILQ_FOREACH(d, &allbases, d_next) {
if (!devbase_has_instances(d, WILD))
@@ -369,9 +373,10 @@
"#define NORM FSTATE_NOTFOUND\n"
"#define STAR FSTATE_STAR\n"
"\n"
- "struct cfdata cfdata%s%s[] = {\n"
+ "%sstruct cfdata cfdata%s%s[] = {\n"
" /* driver attachment unit state "
"loc flags pspec */\n",
+ ioconfname ? "static " : "",
ioconfname ? "_" : "",
ioconfname ? ioconfname : "");
for (p = packed; (i = *p) != NULL; p++) {