From 92a97b467e49ed62909ccc57b2a9ded6551d8903 Mon Sep 17 00:00:00 2001 From: christos Date: Thu, 20 Aug 2015 09:44:24 +0000 Subject: [PATCH] move driver attach declarations to ioconf.h --- usr.bin/config/defs.h | 4 ++-- usr.bin/config/mkheaders.c | 12 ++++++++++-- usr.bin/config/mkioconf.c | 10 ++++------ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/usr.bin/config/defs.h b/usr.bin/config/defs.h index afaabbf78fee..a0563e3ea13e 100644 --- a/usr.bin/config/defs.h +++ b/usr.bin/config/defs.h @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.64 2014/11/17 00:53:15 uebayasi Exp $ */ +/* $NetBSD: defs.h,v 1.65 2015/08/20 09:44:24 christos Exp $ */ /* * Copyright (c) 1992, 1993 @@ -107,7 +107,7 @@ extern const char *progname; * The next two lines define the current version of the config(1) binary, * and the minimum version of the configuration files it supports. */ -#define CONFIG_VERSION 20141030 +#define CONFIG_VERSION 20150820 #define CONFIG_MINVERSION 0 /* diff --git a/usr.bin/config/mkheaders.c b/usr.bin/config/mkheaders.c index 1d7d02f250d0..01b2eee1fdfc 100644 --- a/usr.bin/config/mkheaders.c +++ b/usr.bin/config/mkheaders.c @@ -1,4 +1,4 @@ -/* $NetBSD: mkheaders.c,v 1.26 2015/01/22 20:01:22 christos Exp $ */ +/* $NetBSD: mkheaders.c,v 1.27 2015/08/20 09:44:24 christos Exp $ */ /* * Copyright (c) 1992, 1993 @@ -45,7 +45,7 @@ #endif #include -__RCSID("$NetBSD: mkheaders.c,v 1.26 2015/01/22 20:01:22 christos Exp $"); +__RCSID("$NetBSD: mkheaders.c,v 1.27 2015/08/20 09:44:24 christos Exp $"); #include #include @@ -389,11 +389,19 @@ emitioconfh(void) const char *tfname; FILE *tfp; struct devbase *d; + struct devi *i; tfname = "tmp_ioconf.h"; if ((tfp = fopen(tfname, "w")) == NULL) return (herr("open", tfname, NULL)); + fputs("\n/* pseudo-devices */\n", tfp); + TAILQ_FOREACH(i, &allpseudo, i_next) { + fprintf(tfp, "void %sattach(int);\n", + i->i_base->d_name); + } + + fputs("\n/* driver structs */\n", tfp); TAILQ_FOREACH(d, &allbases, d_next) { if (!devbase_has_instances(d, WILD)) continue; diff --git a/usr.bin/config/mkioconf.c b/usr.bin/config/mkioconf.c index a73a3b73d315..8e4507e57238 100644 --- a/usr.bin/config/mkioconf.c +++ b/usr.bin/config/mkioconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: mkioconf.c,v 1.28 2014/11/01 11:02:41 uebayasi Exp $ */ +/* $NetBSD: mkioconf.c,v 1.29 2015/08/20 09:44:24 christos Exp $ */ /* * Copyright (c) 1992, 1993 @@ -45,7 +45,7 @@ #endif #include -__RCSID("$NetBSD: mkioconf.c,v 1.28 2014/11/01 11:02:41 uebayasi Exp $"); +__RCSID("$NetBSD: mkioconf.c,v 1.29 2015/08/20 09:44:24 christos Exp $"); #include #include @@ -92,6 +92,8 @@ mkioconf(void) return (1); } + fprintf(fp, "#include \"ioconf.h\"\n"); + emithdr(fp); emitcfdrivers(fp); emitexterns(fp); @@ -476,10 +478,6 @@ emitpseudo(FILE *fp) struct devbase *d; fputs("\n/* pseudo-devices */\n", fp); - TAILQ_FOREACH(i, &allpseudo, i_next) { - fprintf(fp, "void %sattach(int);\n", - i->i_base->d_name); - } fputs("\nconst struct pdevinit pdevinit[] = {\n", fp); TAILQ_FOREACH(i, &allpseudo, i_next) { d = i->i_base;