summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/config/Makefile4
-rw-r--r--usr.sbin/config/config.h54
-rw-r--r--usr.sbin/config/config.y123
-rw-r--r--usr.sbin/config/lang.l3
-rw-r--r--usr.sbin/config/main.c39
-rw-r--r--usr.sbin/config/mkglue.c412
-rw-r--r--usr.sbin/config/mkheaders.c19
-rw-r--r--usr.sbin/config/mkioconf.c1015
-rw-r--r--usr.sbin/config/mkmakefile.c68
-rw-r--r--usr.sbin/config/mkoptions.c28
-rw-r--r--usr.sbin/config/mkswapconf.c13
-rw-r--r--usr.sbin/config/mkubglue.c198
12 files changed, 144 insertions, 1832 deletions
diff --git a/usr.sbin/config/Makefile b/usr.sbin/config/Makefile
index 047dd96..a8b9929 100644
--- a/usr.sbin/config/Makefile
+++ b/usr.sbin/config/Makefile
@@ -1,9 +1,9 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
-# $Id: Makefile,v 1.20 1998/05/06 15:27:57 bde Exp $
+# $Id: Makefile,v 1.21 1999/04/13 18:22:57 peter Exp $
PROG= config
CFLAGS+=-I. -I${.CURDIR}
-SRCS= config.y main.c lang.l mkioconf.c mkmakefile.c mkglue.c mkheaders.c \
+SRCS= config.y main.c lang.l mkioconf.c mkmakefile.c mkheaders.c \
mkoptions.c mkswapconf.c y.tab.h
MAN8= config.8
DPADD= ${LIBL}
diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h
index 823d541..5a72b17 100644
--- a/usr.sbin/config/config.h
+++ b/usr.sbin/config/config.h
@@ -153,16 +153,9 @@ struct config {
*/
int machine;
char *machinename;
-#define MACHINE_VAX 1
-#define MACHINE_TAHOE 2
-#define MACHINE_HP300 3
-#define MACHINE_I386 4
-#define MACHINE_MIPS 5
-#define MACHINE_PMAX 6
-#define MACHINE_LUNA68K 7
-#define MACHINE_NEWS3400 8
-#define MACHINE_PC98 9
-#define MACHINE_ALPHA 10
+#define MACHINE_I386 1
+#define MACHINE_PC98 2
+#define MACHINE_ALPHA 3
/*
* For each machine, a set of CPU's may be specified as supported.
@@ -192,45 +185,38 @@ struct opt_list {
struct opt_list *o_next;
} *otab;
-char *ident;
+extern char *ident;
+extern int do_trace;
+
char *ns();
char *tc();
-char *qu();
char *get_word();
char *get_quoted_word();
char *path();
-char *raise();
+char *raisestr();
void moveifchanged();
+dev_t nametodev();
+char *devtoname();
+void init_dev __P((struct device *));
-int do_trace;
-#if MACHINE_VAX
-int seen_mba, seen_uba;
-#endif
-#if MACHINE_TAHOE
-int seen_vba;
-#endif
#if MACHINE_I386
-int seen_isa;
-int seen_scbus;
+extern int seen_isa;
+extern int seen_scbus;
#endif
-int seen_cd;
-struct device *connect();
-struct device *dtab;
-dev_t nametodev();
-char *devtoname();
+extern struct device *dtab;
-char errbuf[80];
-int yyline;
+extern char errbuf[80];
+extern int yyline;
-struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
+extern struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
-int profiling;
-int debugging;
+extern int profiling;
+extern int debugging;
-int maxusers;
-u_int loadaddress;
+extern int maxusers;
+extern u_int loadaddress;
extern int old_config_present; /* Old config/build directory still there */
diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y
index 0f50b8a..9abeb99 100644
--- a/usr.sbin/config/config.y
+++ b/usr.sbin/config/config.y
@@ -117,25 +117,37 @@
#include <sys/disklabel.h>
#include <sys/diskslice.h>
-#ifdef linux
-#include <sys/sysmacros.h>
-#endif
#include <ctype.h>
#include <err.h>
#include <stdio.h>
#include <string.h>
-struct device cur;
-struct device *curp = 0;
+static struct device cur;
+static struct device *curp = 0;
+
+struct device *dtab;
+char *ident;
+int yyline;
+struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
+char errbuf[80];
+int maxusers;
+int do_trace;
+
+#if MACHINE_I386
+int seen_isa;
+int seen_scbus;
+#endif
#define ns(s) strdup(s)
-int alreadychecked __P((dev_t, dev_t[], dev_t *));
-void deverror __P((char *, char *));
-int finddev __P((dev_t));
-void init_dev __P((struct device *));
-void verifycomp __P((struct file_list *));
+static int alreadychecked __P((dev_t, dev_t[], dev_t *));
+static void deverror __P((char *, char *));
+static int finddev __P((dev_t));
+static void verifycomp __P((struct file_list *));
+static struct device *connect __P((char *, int));
+static struct device *huhcon __P((char *));
+static dev_t *verifyswap __P((struct file_list *, dev_t *, dev_t *));
%}
%%
@@ -165,33 +177,12 @@ Spec:
Config_spec:
MACHINE Save_id
= {
- if (!strcmp($2, "vax")) {
- machine = MACHINE_VAX;
- machinename = "vax";
- } else if (!strcmp($2, "tahoe")) {
- machine = MACHINE_TAHOE;
- machinename = "tahoe";
- } else if (!strcmp($2, "hp300")) {
- machine = MACHINE_HP300;
- machinename = "hp300";
- } else if (!strcmp($2, "i386")) {
+ if (!strcmp($2, "i386")) {
machine = MACHINE_I386;
machinename = "i386";
} else if (!strcmp($2, "pc98")) {
machine = MACHINE_PC98;
machinename = "pc98";
- } else if (!strcmp($2, "mips")) {
- machine = MACHINE_MIPS;
- machinename = "mips";
- } else if (!strcmp($2, "pmax")) {
- machine = MACHINE_PMAX;
- machinename = "pmax";
- } else if (!strcmp($2, "luna68k")) {
- machine = MACHINE_LUNA68K;
- machinename = "luna68k";
- } else if (!strcmp($2, "news3400")) {
- machine = MACHINE_NEWS3400;
- machinename = "news3400";
} else if (!strcmp($2, "alpha")) {
machine = MACHINE_ALPHA;
machinename = "alpha";
@@ -501,7 +492,6 @@ Device_spec:
= {
if (!eq(cur.d_name, "cd"))
yyerror("improper spec for pseudo-device");
- seen_cd = 1;
cur.d_type = DEVICE;
verifycomp(*compp);
};
@@ -560,13 +550,7 @@ Dev_name:
Init_dev Dev NUMBER
= {
cur.d_name = $2;
- if (eq($2, "mba"))
- seen_mba = 1;
- else if (eq($2, "uba"))
- seen_uba = 1;
- else if (eq($2, "vba"))
- seen_vba = 1;
- else if (eq($2, "isa"))
+ if (eq($2, "isa"))
seen_isa = 1;
else if (eq($2, "scbus"))
seen_scbus = 1;
@@ -691,7 +675,7 @@ yyerror(s)
/*
* add a device to the list of devices
*/
-void
+static void
newdev(dp)
register struct device *dp;
{
@@ -711,7 +695,7 @@ newdev(dp)
/*
* note that a configuration should be made
*/
-void
+static void
mkconf(sysname)
char *sysname;
{
@@ -731,7 +715,7 @@ mkconf(sysname)
confp = flp;
}
-struct file_list *
+static struct file_list *
newflist(ftype)
u_char ftype;
{
@@ -750,7 +734,7 @@ newflist(ftype)
/*
* Add a swap device to the system's configuration
*/
-void
+static void
mkswap(system, fl, size, flag)
struct file_list *system, *fl;
int size, flag;
@@ -788,7 +772,7 @@ mkswap(system, fl, size, flag)
system->f_fn = ns(system->f_needs);
}
-void
+static void
mkcomp(dp)
register struct device *dp;
{
@@ -809,7 +793,7 @@ mkcomp(dp)
compp = flp;
}
-void
+static void
addcomp(compdev, fl)
struct file_list *compdev, *fl;
{
@@ -833,13 +817,12 @@ addcomp(compdev, fl)
* find the pointer to connect to the given device and number.
* returns 0 if no such device and prints an error message
*/
-struct device *
+static struct device *
connect(dev, num)
register char *dev;
register int num;
{
register struct device *dp;
- struct device *huhcon();
if (num == QUES)
return (huhcon(dev));
@@ -862,7 +845,7 @@ connect(dev, num)
/*
* connect to an unspecific thing
*/
-struct device *
+static struct device *
huhcon(dev)
register char *dev;
{
@@ -945,7 +928,7 @@ init_dev(dp)
/*
* make certain that this is a reasonable type of thing to connect to a nexus
*/
-void
+static void
check_nexus(dev, num)
register struct device *dev;
int num;
@@ -953,25 +936,6 @@ check_nexus(dev, num)
switch (machine) {
- case MACHINE_VAX:
- if (!eq(dev->d_name, "uba") && !eq(dev->d_name, "mba") &&
- !eq(dev->d_name, "bi"))
- yyerror("only uba's, mba's, and bi's should be connected to the nexus");
- if (num != QUES)
- yyerror("can't give specific nexus numbers");
- break;
-
- case MACHINE_TAHOE:
- if (!eq(dev->d_name, "vba"))
- yyerror("only vba's should be connected to the nexus");
- break;
-
- case MACHINE_HP300:
- case MACHINE_LUNA68K:
- if (num != QUES)
- dev->d_addr = num;
- break;
-
case MACHINE_I386:
case MACHINE_PC98:
#if 0
@@ -980,11 +944,6 @@ check_nexus(dev, num)
#endif
break;
- case MACHINE_NEWS3400:
- if (!eq(dev->d_name, "iop") && !eq(dev->d_name, "hb") &&
- !eq(dev->d_name, "vme"))
- yyerror("only iop's, hb's and vme's should be connected to the nexus");
- break;
}
}
@@ -992,7 +951,7 @@ check_nexus(dev, num)
* Check system specification and apply defaulting
* rules on root, argument, dump, and swap devices.
*/
-void
+static void
checksystemspec(fl)
register struct file_list *fl;
{
@@ -1060,11 +1019,11 @@ checksystemspec(fl)
* Verify all devices specified in the system specification
* are present in the device specifications.
*/
-void
+static void
verifysystemspecs()
{
register struct file_list *fl;
- dev_t checked[50], *verifyswap();
+ dev_t checked[50];
register dev_t *pchecked = checked;
for (fl = conf_list; fl; fl = fl->f_next) {
@@ -1085,7 +1044,7 @@ verifysystemspecs()
/*
* Do as above, but for swap devices.
*/
-dev_t *
+static dev_t *
verifyswap(fl, checked, pchecked)
register struct file_list *fl;
dev_t checked[];
@@ -1107,7 +1066,7 @@ verifyswap(fl, checked, pchecked)
/*
* Verify that components of a compound device have themselves been config'ed
*/
-void
+static void
verifycomp(fl)
register struct file_list *fl;
{
@@ -1124,7 +1083,7 @@ verifycomp(fl)
* Has a device already been checked
* for its existence in the configuration?
*/
-int
+static int
alreadychecked(dev, list, last)
dev_t dev, list[];
register dev_t *last;
@@ -1137,7 +1096,7 @@ alreadychecked(dev, list, last)
return (0);
}
-void
+static void
deverror(systemname, devtype)
char *systemname, *devtype;
{
@@ -1151,7 +1110,7 @@ deverror(systemname, devtype)
* take into account stuff wildcarded.
*/
/*ARGSUSED*/
-int
+static int
finddev(dev)
dev_t dev;
{
diff --git a/usr.sbin/config/lang.l b/usr.sbin/config/lang.l
index b3c0f8f..9c33cf8 100644
--- a/usr.sbin/config/lang.l
+++ b/usr.sbin/config/lang.l
@@ -101,9 +101,6 @@ struct kt {
{ "priority", PRIORITY },
{ "pseudo-device",PSEUDO_DEVICE },
{ "root", ROOT },
-#if MACHINE_HP300 || MACHINE_LUNA68K
- { "scode", NEXUS },
-#endif
{ "sequential", SEQUENTIAL },
{ "size", SIZE },
{ "slave", SLAVE },
diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c
index b190ab0..2a8a896 100644
--- a/usr.sbin/config/main.c
+++ b/usr.sbin/config/main.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: main.c,v 1.28 1999/04/10 14:03:38 ache Exp $";
+ "$Id: main.c,v 1.29 1999/04/11 03:40:10 grog Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -65,12 +65,15 @@ static const char rcsid[] =
#define FALSE (0)
#endif
-char *PREFIX;
+char * PREFIX;
static int no_config_clobber = TRUE;
-int old_config_present;
+int old_config_present;
+int debugging;
+int profiling;
+u_int loadaddress;
static void usage __P((void));
-void configfile __P((void));
+static void configfile __P((void));
/*
* Config builds a set of files for building a UNIX
@@ -148,35 +151,9 @@ main(argc, argv)
exit(3);
switch (machine) {
- case MACHINE_VAX:
- vax_ioconf(); /* Print ioconf.c */
- ubglue(); /* Create ubglue.s */
- break;
-
- case MACHINE_TAHOE:
- tahoe_ioconf();
- vbglue();
- break;
-
- case MACHINE_HP300:
- case MACHINE_LUNA68K:
- hp300_ioconf();
- hpglue();
- break;
-
case MACHINE_I386:
case MACHINE_PC98:
i386_ioconf(); /* Print ioconf.c */
- vector(); /* Create vector.s */
- break;
-
- case MACHINE_MIPS:
- case MACHINE_PMAX:
- pmax_ioconf();
- break;
-
- case MACHINE_NEWS3400:
- news_ioconf();
break;
case MACHINE_ALPHA:
@@ -343,7 +320,7 @@ path(file)
return (cp);
}
-void
+static void
configfile()
{
FILE *fi, *fo;
diff --git a/usr.sbin/config/mkglue.c b/usr.sbin/config/mkglue.c
deleted file mode 100644
index 9bfae60..0000000
--- a/usr.sbin/config/mkglue.c
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * Copyright (c) 1980, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)mkglue.c 8.1 (Berkeley) 6/6/93";
-#endif
-static const char rcsid[] =
- "$Id: mkglue.c,v 1.13 1997/09/21 22:12:49 gibbs Exp $";
-#endif /* not lint */
-
-/*
- * Make the bus adaptor interrupt glue files.
- */
-#include <ctype.h>
-#include <err.h>
-#include <stdio.h>
-#include "config.h"
-#include "y.tab.h"
-
-void vector_devtab __P((FILE *, char *, int *));
-void vector __P((void));
-void dump_ctrs __P((FILE *));
-void dump_intname __P((FILE *, char *, int));
-void dump_std __P((FILE *, FILE *));
-void dump_vbavec __P((FILE *, char *, int));
-void dump_ubavec __P((FILE *, char *, int));
-
-/*
- * Create the UNIBUS interrupt vector glue file.
- */
-void
-ubglue()
-{
- register FILE *fp, *gp;
- register struct device *dp, *mp;
-
- fp = fopen(path("ubglue.s"), "w");
- if (fp == 0)
- err(1, "%s", path("ubglue.s"));
- gp = fopen(path("ubvec.s"), "w");
- if (gp == 0)
- err(1, "%s", path("ubvec.s"));
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (mp != 0 && mp != (struct device *)-1 &&
- !eq(mp->d_name, "mba")) {
- struct idlst *id, *id2;
-
- for (id = dp->d_vec; id; id = id->id_next) {
- for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
- if (id2 == id) {
- dump_ubavec(fp, id->id,
- dp->d_unit);
- break;
- }
- if (!strcmp(id->id, id2->id))
- break;
- }
- }
- }
- }
- dump_std(fp, gp);
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (mp != 0 && mp != (struct device *)-1 &&
- !eq(mp->d_name, "mba")) {
- struct idlst *id, *id2;
-
- for (id = dp->d_vec; id; id = id->id_next) {
- for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
- if (id2 == id) {
- dump_intname(fp, id->id,
- dp->d_unit);
- break;
- }
- if (!strcmp(id->id, id2->id))
- break;
- }
- }
- }
- }
- dump_ctrs(fp);
- (void) fclose(fp);
- (void) fclose(gp);
-}
-
-static int cntcnt = 0; /* number of interrupt counters allocated */
-
-/*
- * Print a UNIBUS interrupt vector.
- */
-void
-dump_ubavec(fp, vector, number)
- register FILE *fp;
- char *vector;
- int number;
-{
- char nbuf[80];
- register char *v = nbuf;
-
- (void) sprintf(v, "%s%d", vector, number);
- fprintf(fp, "\t.globl\t_X%s\n\t.align\t2\n_X%s:\n\tpushr\t$0x3f\n",
- v, v);
- fprintf(fp, "\tincl\t_fltintrcnt+(4*%d)\n", cntcnt++);
- if (strncmp(vector, "dzx", 3) == 0)
- fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdzdma\n\n", number);
- else if (strncmp(vector, "dpx", 3) == 0)
- fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdpxdma\n\n", number);
- else if (strncmp(vector, "dpr", 3) == 0)
- fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdprdma\n\n", number);
- else {
- if (strncmp(vector, "uur", 3) == 0) {
- fprintf(fp, "#ifdef UUDMA\n");
- fprintf(fp, "\tmovl\t$%d,r0\n\tjsb\tuudma\n", number);
- fprintf(fp, "#endif\n");
- }
- fprintf(fp, "\tpushl\t$%d\n", number);
- fprintf(fp, "\tcalls\t$1,_%s\n\tpopr\t$0x3f\n", vector);
- fprintf(fp, "\tincl\t_cnt+V_INTR\n\trei\n\n");
- }
-}
-
-/*
- * Create the VERSAbus interrupt vector glue file.
- */
-void
-vbglue()
-{
- register FILE *fp, *gp;
- register struct device *dp, *mp;
-
- fp = fopen(path("vbglue.s"), "w");
- if (fp == 0)
- err(1, "%s", path("vbglue.s"));
- gp = fopen(path("vbvec.s"), "w");
- if (gp == 0)
- err(1, "%s", path("vbvec.s"));
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- struct idlst *id, *id2;
-
- mp = dp->d_conn;
- if (mp == 0 || mp == (struct device *)-1 ||
- eq(mp->d_name, "mba"))
- continue;
- for (id = dp->d_vec; id; id = id->id_next)
- for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
- if (id == id2) {
- dump_vbavec(fp, id->id, dp->d_unit);
- break;
- }
- if (eq(id->id, id2->id))
- break;
- }
- }
- dump_std(fp, gp);
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (mp != 0 && mp != (struct device *)-1 &&
- !eq(mp->d_name, "mba")) {
- struct idlst *id, *id2;
-
- for (id = dp->d_vec; id; id = id->id_next) {
- for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
- if (id2 == id) {
- dump_intname(fp, id->id,
- dp->d_unit);
- break;
- }
- if (eq(id->id, id2->id))
- break;
- }
- }
- }
- }
- dump_ctrs(fp);
- (void) fclose(fp);
- (void) fclose(gp);
-}
-
-/*
- * Print a VERSAbus interrupt vector
- */
-void
-dump_vbavec(fp, vector, number)
- register FILE *fp;
- char *vector;
- int number;
-{
- char nbuf[80];
- register char *v = nbuf;
-
- (void) sprintf(v, "%s%d", vector, number);
- fprintf(fp, "SCBVEC(%s):\n", v);
- fprintf(fp, "\tCHECK_SFE(4)\n");
- fprintf(fp, "\tSAVE_FPSTAT(4)\n");
- fprintf(fp, "\tPUSHR\n");
- fprintf(fp, "\tincl\t_fltintrcnt+(4*%d)\n", cntcnt++);
- fprintf(fp, "\tpushl\t$%d\n", number);
- fprintf(fp, "\tcallf\t$8,_%s\n", vector);
- fprintf(fp, "\tincl\t_cnt+V_INTR\n");
- fprintf(fp, "\tPOPR\n");
- fprintf(fp, "\tREST_FPSTAT\n");
- fprintf(fp, "\trei\n\n");
-}
-
-/*
- * HP9000/300 interrupts are auto-vectored.
- * Code is hardwired in locore.s
- */
-void
-hpglue() {}
-
-static char *vaxinames[] = {
- "clock", "cnr", "cnx", "tur", "tux",
- "mba0", "mba1", "mba2", "mba3",
- "uba0", "uba1", "uba2", "uba3"
-};
-static char *tahoeinames[] = {
- "clock", "cnr", "cnx", "rmtr", "rmtx", "buserr",
-};
-static struct stdintrs {
- char **si_names; /* list of standard interrupt names */
- int si_n; /* number of such names */
-} stdintrs[] = {
- { vaxinames, sizeof (vaxinames) / sizeof (vaxinames[0]) },
- { tahoeinames, (sizeof (tahoeinames) / sizeof (tahoeinames[0])) }
-};
-/*
- * Start the interrupt name table with the names
- * of the standard vectors not directly associated
- * with a bus. Also, dump the defines needed to
- * reference the associated counters into a separate
- * file which is prepended to locore.s.
- */
-void
-dump_std(fp, gp)
- register FILE *fp, *gp;
-{
- register struct stdintrs *si = &stdintrs[machine-1];
- register char **cpp;
- register int i;
-
- fprintf(fp, "\n\t.globl\t_intrnames\n");
- fprintf(fp, "\n\t.globl\t_eintrnames\n");
- fprintf(fp, "\t.data\n");
- fprintf(fp, "_intrnames:\n");
- cpp = si->si_names;
- for (i = 0; i < si->si_n; i++) {
- register char *cp, *tp;
- char buf[80];
-
- cp = *cpp;
- if (cp[0] == 'i' && cp[1] == 'n' && cp[2] == 't') {
- cp += 3;
- if (*cp == 'r')
- cp++;
- }
- for (tp = buf; *cp; cp++)
- if (islower(*cp))
- *tp++ = toupper(*cp);
- else
- *tp++ = *cp;
- *tp = '\0';
- fprintf(gp, "#define\tI_%s\t%d\n", buf, i*sizeof (long));
- fprintf(fp, "\t.asciz\t\"%s\"\n", *cpp);
- cpp++;
- }
-}
-
-void
-dump_intname(fp, vector, number)
- register FILE *fp;
- char *vector;
- int number;
-{
- register char *cp = vector;
-
- fprintf(fp, "\t.asciz\t\"");
- /*
- * Skip any "int" or "intr" in the name.
- */
- while (*cp)
- if (cp[0] == 'i' && cp[1] == 'n' && cp[2] == 't') {
- cp += 3;
- if (*cp == 'r')
- cp++;
- } else {
- putc(*cp, fp);
- cp++;
- }
- fprintf(fp, "%d\"\n", number);
-}
-
-/*
- * Reserve space for the interrupt counters.
- */
-void
-dump_ctrs(fp)
- register FILE *fp;
-{
- struct stdintrs *si = &stdintrs[machine-1];
-
- fprintf(fp, "_eintrnames:\n");
- fprintf(fp, "\n\t.globl\t_intrcnt\n");
- fprintf(fp, "\n\t.globl\t_eintrcnt\n");
- fprintf(fp, "\t.align 2\n");
- fprintf(fp, "_intrcnt:\n");
- fprintf(fp, "\t.space\t4 * %d\n", si->si_n);
- fprintf(fp, "_fltintrcnt:\n");
- fprintf(fp, "\t.space\t4 * %d\n", cntcnt);
- fprintf(fp, "_eintrcnt:\n\n");
- fprintf(fp, "\t.text\n");
-}
-
-/*
- * Create the ISA interrupt vector glue file.
- *
- * The interrupt handlers are hardwired into vector.s and are attached
- * at runtime depending on the data in ioconf.c and on the results of
- * probing. Here we only need to generate the names of the interrupt
- * handlers in an ancient form suitable for vmstat (the _eintrcnt label
- * can't be expressed in C). We give the names of all devices to
- * simplify the correspondence between devices and interrupt handlers.
- * The order must match that in mkioconf.c.
- */
-void
-vector()
-{
- int dev_id;
- FILE *fp;
-
- fp = fopen(path("vector.h.new"), "w");
- if (fp == NULL)
- err(1, "%s", path("vector.h.new"));
- fprintf(fp, "/*\n");
- fprintf(fp, " * vector.h\n");
- fprintf(fp, " * Macros for interrupt vector routines\n");
- fprintf(fp, " * Generated by config program\n");
- fprintf(fp, " */\n\n");
- fprintf(fp, "#define\tDEVICE_NAMES \"\\\n");
- fprintf(fp, "clk0 irqnn\\0\\\n");
- fprintf(fp, "rtc0 irqnn\\0\\\n");
- fprintf(fp, "pci irqnn\\0\\\n");
- fprintf(fp, "pci irqnn\\0\\\n");
- fprintf(fp, "pci irqnn\\0\\\n");
- fprintf(fp, "pci irqnn\\0\\\n");
- fprintf(fp, "ipi irqnn\\0\\\n");
- fprintf(fp, "ipi irqnn\\0\\\n");
- fprintf(fp, "ipi irqnn\\0\\\n");
- fprintf(fp, "ipi irqnn\\0\\\n");
- dev_id = 10;
- vector_devtab(fp, "bio", &dev_id);
- vector_devtab(fp, "tty", &dev_id);
- vector_devtab(fp, "net", &dev_id);
- vector_devtab(fp, "cam", &dev_id);
- vector_devtab(fp, "ha", &dev_id);
- vector_devtab(fp, "null", &dev_id);
- fprintf(fp, "\"\n\n");
- fprintf(fp, "#define\tNR_DEVICES\t%d\n", dev_id);
- (void) fclose(fp);
- moveifchanged(path("vector.h.new"), path("vector.h"));
-}
-
-void
-vector_devtab(fp, table, dev_idp)
- FILE *fp;
- char *table;
- int *dev_idp;
-{
- register struct device *dp, *mp;
-
- for (dp = dtab; dp != NULL; dp = dp->d_next) {
- if (dp->d_unit == QUES || !eq(dp->d_mask, table))
- continue;
- mp = dp->d_conn;
- if (mp == NULL || mp == TO_NEXUS || !eq(mp->d_name, "isa"))
- continue;
- fprintf(fp, "%s%d irqnn\\0\\\n", dp->d_name, dp->d_unit);
- (*dev_idp)++;
- }
-}
diff --git a/usr.sbin/config/mkheaders.c b/usr.sbin/config/mkheaders.c
index 74e92ee..2ddc809 100644
--- a/usr.sbin/config/mkheaders.c
+++ b/usr.sbin/config/mkheaders.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mkheaders.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: mkheaders.c,v 1.7 1997/10/28 07:21:02 joerg Exp $";
+ "$Id: mkheaders.c,v 1.8 1997/11/07 00:09:40 joerg Exp $";
#endif /* not lint */
/*
@@ -52,8 +52,10 @@ static const char rcsid[] =
#define ns(s) strdup(s)
-void do_header __P((char *, char *, int));
-void do_count __P((char *, char *, int));
+static void do_header __P((char *, char *, int));
+static void do_count __P((char *, char *, int));
+static char *toheader __P((char *));
+static char *tomacro __P((char *));
void
headers()
@@ -78,7 +80,7 @@ headers()
* count all the devices of a certain type and recurse to count
* whatever the device is connected to
*/
-void
+static void
do_count(dev, hname, search)
register char *dev, *hname;
int search;
@@ -119,12 +121,12 @@ do_count(dev, hname, search)
do_header(dev, hname, count > hicount ? count : hicount);
}
-void
+static void
do_header(dev, hname, count)
char *dev, *hname;
int count;
{
- char *file, *name, *inw, *toheader(), *tomacro();
+ char *file, *name, *inw;
struct file_list *fl, *fl_head, *tflp;
FILE *inf, *outf;
int inc, oldcount;
@@ -200,7 +202,7 @@ do_header(dev, hname, count)
/*
* convert a dev name to a .h file name
*/
-char *
+static char *
toheader(dev)
char *dev;
{
@@ -214,7 +216,8 @@ toheader(dev)
/*
* convert a dev name to a macro name
*/
-char *tomacro(dev)
+static char *
+tomacro(dev)
register char *dev;
{
static char mbuf[20];
diff --git a/usr.sbin/config/mkioconf.c b/usr.sbin/config/mkioconf.c
index 110902b..777bc93 100644
--- a/usr.sbin/config/mkioconf.c
+++ b/usr.sbin/config/mkioconf.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mkioconf.c 8.2 (Berkeley) 1/21/94";
#endif
static const char rcsid[] =
- "$Id: mkioconf.c,v 1.48 1999/02/05 16:58:22 bde Exp $";
+ "$Id: mkioconf.c,v 1.49 1999/04/16 21:28:10 peter Exp $";
#endif /* not lint */
#include <err.h>
@@ -47,19 +47,12 @@ static const char rcsid[] =
/*
* build the ioconf.c file
*/
-char *qu();
-char *intv();
-char *wnum();
-void pseudo_ioconf();
-void comp_config __P((FILE *));
+static char *qu();
+static char *intv();
+static char *wnum();
void scbus_devtab __P((FILE *, int *));
-void isa_devtab __P((FILE *, char *, int *));
-void isa_biotab __P((FILE *, char *));
void i386_ioconf __P((void));
-void hp300_ioconf __P((void));
-int hpbadslave __P((struct device *, struct device *));
-void tahoe_ioconf __P((void));
-void vax_ioconf __P((void));
+void alpha_ioconf __P((void));
static char *
devstr(struct device *dp)
@@ -175,554 +168,8 @@ write_devtab(FILE *fp)
fprintf(fp, "int devtab_count = %d;\n", count);
}
-#if MACHINE_VAX
-void
-vax_ioconf()
-{
- register struct device *dp, *mp, *np;
- register int uba_n, slave;
- FILE *fp;
-
- fp = fopen(path("ioconf.c"), "w");
- if (fp == 0)
- err(1, "%s", path("ioconf.c"));
- fprintf(fp, "#include <vax/include/pte.h>\n");
- fprintf(fp, "#include <sys/param.h>\n");
- fprintf(fp, "#include <sys/buf.h>\n");
- fprintf(fp, "\n");
- fprintf(fp, "#include <vax/mba/mbavar.h>\n");
- fprintf(fp, "#include <vax/uba/ubavar.h>\n\n");
- fprintf(fp, "\n");
- fprintf(fp, "#define C (caddr_t)\n\n");
- /*
- * First print the mba initialization structures
- */
- if (seen_mba) {
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (mp == 0 || mp == TO_NEXUS ||
- !eq(mp->d_name, "mba"))
- continue;
- fprintf(fp, "extern struct mba_driver %sdriver;\n",
- dp->d_name);
- }
- fprintf(fp, "\nstruct mba_device mbdinit[] = {\n");
- fprintf(fp, "\t/* Device, Unit, Mba, Drive, Dk */\n");
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (dp->d_unit == QUES || mp == 0 ||
- mp == TO_NEXUS || !eq(mp->d_name, "mba"))
- continue;
- if (dp->d_addr) {
- printf("can't specify csr address on mba for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_vec != 0) {
- printf("can't specify vector for %s%d on mba\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_drive == UNKNOWN) {
- printf("drive not specified for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_slave != UNKNOWN) {
- printf("can't specify slave number for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- fprintf(fp, "\t{ &%sdriver, %d, %s,",
- dp->d_name, dp->d_unit, qu(mp->d_unit));
- fprintf(fp, " %s, %d },\n",
- qu(dp->d_drive), dp->d_dk);
- }
- fprintf(fp, "\t0\n};\n\n");
- /*
- * Print the mbsinit structure
- * Driver Controller Unit Slave
- */
- fprintf(fp, "struct mba_slave mbsinit [] = {\n");
- fprintf(fp, "\t/* Driver, Ctlr, Unit, Slave */\n");
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- /*
- * All slaves are connected to something which
- * is connected to the massbus.
- */
- if ((mp = dp->d_conn) == 0 || mp == TO_NEXUS)
- continue;
- np = mp->d_conn;
- if (np == 0 || np == TO_NEXUS ||
- !eq(np->d_name, "mba"))
- continue;
- fprintf(fp, "\t{ &%sdriver, %s",
- mp->d_name, qu(mp->d_unit));
- fprintf(fp, ", %2d, %s },\n",
- dp->d_unit, qu(dp->d_slave));
- }
- fprintf(fp, "\t0\n};\n\n");
- }
- /*
- * Now generate interrupt vectors for the unibus
- */
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- if (dp->d_vec != 0) {
- struct idlst *ip;
- mp = dp->d_conn;
- if (mp == 0 || mp == TO_NEXUS ||
- (!eq(mp->d_name, "uba") && !eq(mp->d_name, "bi")))
- continue;
- fprintf(fp,
- "extern struct uba_driver %sdriver;\n",
- dp->d_name);
- fprintf(fp, "extern ");
- ip = dp->d_vec;
- for (;;) {
- fprintf(fp, "X%s%d()", ip->id, dp->d_unit);
- ip = ip->id_next;
- if (ip == 0)
- break;
- fprintf(fp, ", ");
- }
- fprintf(fp, ";\n");
- fprintf(fp, "int\t (*%sint%d[])() = { ", dp->d_name,
- dp->d_unit);
- ip = dp->d_vec;
- for (;;) {
- fprintf(fp, "X%s%d", ip->id, dp->d_unit);
- ip = ip->id_next;
- if (ip == 0)
- break;
- fprintf(fp, ", ");
- }
- fprintf(fp, ", 0 } ;\n");
- }
- }
- fprintf(fp, "\nstruct uba_ctlr ubminit[] = {\n");
- fprintf(fp, "/*\t driver,\tctlr,\tubanum,\talive,\tintr,\taddr */\n");
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (dp->d_type != CONTROLLER || mp == TO_NEXUS || mp == 0 ||
- !eq(mp->d_name, "uba"))
- continue;
- if (dp->d_vec == 0) {
- printf("must specify vector for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_addr == 0) {
- printf("must specify csr address for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_drive != UNKNOWN || dp->d_slave != UNKNOWN) {
- printf("drives need their own entries; dont ");
- printf("specify drive or slave for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_flags) {
- printf("controllers (e.g. %s%d) ",
- dp->d_name, dp->d_unit);
- printf("don't have flags, only devices do\n");
- continue;
- }
- fprintf(fp,
- "\t{ &%sdriver,\t%d,\t%s,\t0,\t%sint%d, C 0%o },\n",
- dp->d_name, dp->d_unit, qu(mp->d_unit),
- dp->d_name, dp->d_unit, dp->d_addr);
- }
- fprintf(fp, "\t0\n};\n");
-/* unibus devices */
- fprintf(fp, "\nstruct uba_device ubdinit[] = {\n");
- fprintf(fp,
-"\t/* driver, unit, ctlr, ubanum, slave, intr, addr, dk, flags*/\n");
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (dp->d_unit == QUES || dp->d_type != DEVICE || mp == 0 ||
- mp == TO_NEXUS || mp->d_type == MASTER ||
- eq(mp->d_name, "mba"))
- continue;
- np = mp->d_conn;
- if (np != 0 && np != TO_NEXUS && eq(np->d_name, "mba"))
- continue;
- np = 0;
- if (eq(mp->d_name, "uba")) {
- if (dp->d_vec == 0) {
- printf("must specify vector for device %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_addr == 0) {
- printf("must specify csr for device %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_drive != UNKNOWN || dp->d_slave != UNKNOWN) {
- printf("drives/slaves can be specified ");
- printf("only for controllers, ");
- printf("not for device %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- uba_n = mp->d_unit;
- slave = QUES;
- } else {
- if ((np = mp->d_conn) == 0) {
- printf("%s%d isn't connected to anything ",
- mp->d_name, mp->d_unit);
- printf(", so %s%d is unattached\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- uba_n = np->d_unit;
- if (dp->d_drive == UNKNOWN) {
- printf("must specify ``drive number'' ");
- printf("for %s%d\n", dp->d_name, dp->d_unit);
- continue;
- }
- /* NOTE THAT ON THE UNIBUS ``drive'' IS STORED IN */
- /* ``SLAVE'' AND WE DON'T WANT A SLAVE SPECIFIED */
- if (dp->d_slave != UNKNOWN) {
- printf("slave numbers should be given only ");
- printf("for massbus tapes, not for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_vec != 0) {
- printf("interrupt vectors should not be ");
- printf("given for drive %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_addr != 0) {
- printf("csr addresses should be given only ");
- printf("on controllers, not on %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- slave = dp->d_drive;
- }
- fprintf(fp, "\t{ &%sdriver, %2d, %s,",
- eq(mp->d_name, "uba") ? dp->d_name : mp->d_name, dp->d_unit,
- eq(mp->d_name, "uba") ? " -1" : qu(mp->d_unit));
- fprintf(fp, " %s, %2d, %s, C 0%-6o, %d, 0x%x },\n",
- qu(uba_n), slave, intv(dp), dp->d_addr, dp->d_dk,
- dp->d_flags);
- }
- fprintf(fp, "\t0\n};\n");
- pseudo_ioconf(fp);
- (void) fclose(fp);
-}
-#endif
-
-#if MACHINE_TAHOE
-void
-tahoe_ioconf()
-{
- register struct device *dp, *mp, *np;
- register int vba_n, slave;
- FILE *fp;
-
- fp = fopen(path("ioconf.c"), "w");
- if (fp == 0)
- err(1, "%s", path("ioconf.c"));
- fprintf(fp, "#include <sys/param.h>\n");
- fprintf(fp, "#include <tahoe/include/pte.h>\n");
- fprintf(fp, "#include <sys/buf.h>\n");
- fprintf(fp, "\n");
- fprintf(fp, "#include <tahoe/vba/vbavar.h>\n");
- fprintf(fp, "\n");
- fprintf(fp, "#define C (caddr_t)\n\n");
- /*
- * Now generate interrupt vectors for the versabus
- */
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (mp == 0 || mp == TO_NEXUS || !eq(mp->d_name, "vba"))
- continue;
- if (dp->d_vec != 0) {
- struct idlst *ip;
- fprintf(fp,
- "extern struct vba_driver %sdriver;\n",
- dp->d_name);
- fprintf(fp, "extern ");
- ip = dp->d_vec;
- for (;;) {
- fprintf(fp, "X%s%d()", ip->id, dp->d_unit);
- ip = ip->id_next;
- if (ip == 0)
- break;
- fprintf(fp, ", ");
- }
- fprintf(fp, ";\n");
- fprintf(fp, "int\t (*%sint%d[])() = { ", dp->d_name,
- dp->d_unit);
- ip = dp->d_vec;
- for (;;) {
- fprintf(fp, "X%s%d", ip->id, dp->d_unit);
- ip = ip->id_next;
- if (ip == 0)
- break;
- fprintf(fp, ", ");
- }
- fprintf(fp, ", 0 } ;\n");
- } else if (dp->d_type == DRIVER) /* devices w/o interrupts */
- fprintf(fp,
- "extern struct vba_driver %sdriver;\n",
- dp->d_name);
- }
- fprintf(fp, "\nstruct vba_ctlr vbminit[] = {\n");
- fprintf(fp, "/*\t driver,\tctlr,\tvbanum,\talive,\tintr,\taddr */\n");
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (dp->d_type != CONTROLLER || mp == TO_NEXUS || mp == 0 ||
- !eq(mp->d_name, "vba"))
- continue;
- if (dp->d_vec == 0) {
- printf("must specify vector for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_addr == 0) {
- printf("must specify csr address for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_drive != UNKNOWN || dp->d_slave != UNKNOWN) {
- printf("drives need their own entries; dont ");
- printf("specify drive or slave for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_flags) {
- printf("controllers (e.g. %s%d) ",
- dp->d_name, dp->d_unit);
- printf("don't have flags, only devices do\n");
- continue;
- }
- fprintf(fp,
- "\t{ &%sdriver,\t%d,\t%s,\t0,\t%sint%d, C 0x%x },\n",
- dp->d_name, dp->d_unit, qu(mp->d_unit),
- dp->d_name, dp->d_unit, dp->d_addr);
- }
- fprintf(fp, "\t0\n};\n");
-/* versabus devices */
- fprintf(fp, "\nstruct vba_device vbdinit[] = {\n");
- fprintf(fp,
-"\t/* driver, unit, ctlr, vbanum, slave, intr, addr, dk, flags*/\n");
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (dp->d_unit == QUES || dp->d_type != DEVICE || mp == 0 ||
- mp == TO_NEXUS || mp->d_type == MASTER ||
- eq(mp->d_name, "mba"))
- continue;
- np = mp->d_conn;
- if (np != 0 && np != TO_NEXUS && eq(np->d_name, "mba"))
- continue;
- np = 0;
- if (eq(mp->d_name, "vba")) {
- if (dp->d_vec == 0)
- printf(
- "Warning, no interrupt vector specified for device %s%d\n",
- dp->d_name, dp->d_unit);
- if (dp->d_addr == 0) {
- printf("must specify csr for device %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_drive != UNKNOWN || dp->d_slave != UNKNOWN) {
- printf("drives/slaves can be specified ");
- printf("only for controllers, ");
- printf("not for device %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- vba_n = mp->d_unit;
- slave = QUES;
- } else {
- if ((np = mp->d_conn) == 0) {
- printf("%s%d isn't connected to anything ",
- mp->d_name, mp->d_unit);
- printf(", so %s%d is unattached\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- vba_n = np->d_unit;
- if (dp->d_drive == UNKNOWN) {
- printf("must specify ``drive number'' ");
- printf("for %s%d\n", dp->d_name, dp->d_unit);
- continue;
- }
- /* NOTE THAT ON THE UNIBUS ``drive'' IS STORED IN */
- /* ``SLAVE'' AND WE DON'T WANT A SLAVE SPECIFIED */
- if (dp->d_slave != UNKNOWN) {
- printf("slave numbers should be given only ");
- printf("for massbus tapes, not for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_vec != 0) {
- printf("interrupt vectors should not be ");
- printf("given for drive %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_addr != 0) {
- printf("csr addresses should be given only ");
- printf("on controllers, not on %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- slave = dp->d_drive;
- }
- fprintf(fp, "\t{ &%sdriver, %2d, %s,",
- eq(mp->d_name, "vba") ? dp->d_name : mp->d_name, dp->d_unit,
- eq(mp->d_name, "vba") ? " -1" : qu(mp->d_unit));
- fprintf(fp, " %s, %2d, %s, C 0x%-6x, %d, 0x%x },\n",
- qu(vba_n), slave, intv(dp), dp->d_addr, dp->d_dk,
- dp->d_flags);
- }
- fprintf(fp, "\t0\n};\n");
- pseudo_ioconf(fp);
- (void) fclose(fp);
-}
-#endif
-
-#if MACHINE_HP300 || MACHINE_LUNA68K
-void
-hp300_ioconf()
-{
- register struct device *dp, *mp;
- register int hpib, slave;
- FILE *fp;
-
- fp = fopen(path("ioconf.c"), "w");
- if (fp == 0)
- err(1, "%s", path("ioconf.c"));
- fprintf(fp, "#include <sys/param.h>\n");
- fprintf(fp, "#include <sys/buf.h>\n");
- fprintf(fp, "\n");
- if (machine == MACHINE_HP300)
- fprintf(fp, "#include <hp/dev/device.h>\n\n");
- else
- fprintf(fp, "#include <luna68k/dev/device.h>\n\n");
- fprintf(fp, "\n");
- fprintf(fp, "#define C (caddr_t)\n");
- fprintf(fp, "#define D (struct driver *)\n\n");
- /*
- * First print the hpib controller initialization structures
- */
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (dp->d_unit == QUES || mp == 0)
- continue;
- fprintf(fp, "extern struct driver %sdriver;\n", dp->d_name);
- }
- fprintf(fp, "\nstruct hp_ctlr hp_cinit[] = {\n");
- fprintf(fp, "/*\tdriver,\t\tunit,\talive,\taddr,\tflags */\n");
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (dp->d_unit == QUES ||
- (dp->d_type != MASTER && dp->d_type != CONTROLLER))
- continue;
- if (mp != TO_NEXUS) {
- printf("%s%s must be attached to an sc (nexus)\n",
- dp->d_name, wnum(dp->d_unit));
- continue;
- }
- if (dp->d_drive != UNKNOWN || dp->d_slave != UNKNOWN) {
- printf("can't specify drive/slave for %s%s\n",
- dp->d_name, wnum(dp->d_unit));
- continue;
- }
- fprintf(fp,
- "\t{ &%sdriver,\t%d,\t0,\tC 0x%x,\t0x%x },\n",
- dp->d_name, dp->d_unit, dp->d_addr, dp->d_flags);
- }
- fprintf(fp, "\t0\n};\n");
-/* devices */
- fprintf(fp, "\nstruct hp_device hp_dinit[] = {\n");
- fprintf(fp,
- "/*driver,\tcdriver,\tunit,\tctlr,\tslave,\taddr,\tdk,\tflags*/\n");
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (mp == 0 || dp->d_type != DEVICE || hpbadslave(mp, dp))
- continue;
- if (mp == TO_NEXUS) {
- if (dp->d_drive != UNKNOWN || dp->d_slave != UNKNOWN) {
- printf("can't specify drive/slave for %s%s\n",
- dp->d_name, wnum(dp->d_unit));
- continue;
- }
- slave = QUES;
- hpib = QUES;
- } else {
- if (dp->d_addr != 0) {
- printf("can't specify sc for device %s%s\n",
- dp->d_name, wnum(dp->d_unit));
- continue;
- }
- if (mp->d_type == CONTROLLER) {
- if (dp->d_drive == UNKNOWN) {
- printf("must specify drive for %s%s\n",
- dp->d_name, wnum(dp->d_unit));
- continue;
- }
- slave = dp->d_drive;
- } else {
- if (dp->d_slave == UNKNOWN) {
- printf("must specify slave for %s%s\n",
- dp->d_name, wnum(dp->d_unit));
- continue;
- }
- slave = dp->d_slave;
- }
- hpib = mp->d_unit;
- }
- fprintf(fp, "{ &%sdriver,\t", dp->d_name);
- if (mp == TO_NEXUS)
- fprintf(fp, "D 0x0,\t");
- else
- fprintf(fp, "&%sdriver,", mp->d_name);
- fprintf(fp, "\t%d,\t%d,\t%d,\tC 0x%x,\t%d,\t0x%x },\n",
- dp->d_unit, hpib, slave,
- dp->d_addr, dp->d_dk, dp->d_flags);
- }
- fprintf(fp, "0\n};\n");
- pseudo_ioconf(fp);
- (void) fclose(fp);
-}
-
-#define ishpibdev(n) (eq(n,"rd") || eq(n,"ct") || eq(n,"mt") || eq(n,"ppi"))
-#define isscsidev(n) (eq(n,"sd") || eq(n,"st") || eq(n,"ac"))
-
-int
-hpbadslave(mp, dp)
- register struct device *dp, *mp;
-{
-
- if ((mp == TO_NEXUS && ishpibdev(dp->d_name)) ||
- (mp != TO_NEXUS && eq(mp->d_name, "hpib") &&
- !ishpibdev(dp->d_name))) {
- printf("%s%s must be attached to an hpib\n",
- dp->d_name, wnum(dp->d_unit));
- return (1);
- }
- if ((mp == TO_NEXUS && isscsidev(dp->d_name)) ||
- (mp != TO_NEXUS && eq(mp->d_name, "scsi") &&
- !isscsidev(dp->d_name))) {
- printf("%s%s must be attached to a scsi\n",
- dp->d_name, wnum(dp->d_unit));
- return (1);
- }
- return (0);
-}
-#endif
-
#if MACHINE_I386
-char *sirq();
+static char *sirq();
void
i386_ioconf()
@@ -745,60 +192,6 @@ i386_ioconf()
fprintf(fp, "\n");
fprintf(fp, "#define C (caddr_t)\n");
-#if 0
- /*
- * First print the isa initialization structures
- */
- if (seen_isa) {
- int seen_wdc = 0, seen_fdc = 0;
-
- fprintf(fp, "\n");
- fprintf(fp, "/*\n");
- fprintf(fp, " * ISA devices.\n");
- fprintf(fp, " */\n");
- fprintf(fp, "\n");
- fprintf(fp, "#include <i386/isa/icu.h>\n");
- if (machine == MACHINE_I386)
- fprintf(fp, "#include <i386/isa/isa.h>\n");
- else
- fprintf(fp, "#include <pc98/pc98/pc98.h>\n");
- fprintf(fp, "#include <i386/isa/isa_device.h>\n");
- fprintf(fp, "\n");
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (mp == 0 || mp == TO_NEXUS ||
- !eq(mp->d_name, "isa"))
- continue;
- if (old_d_name == NULL || !eq(dp->d_name, old_d_name)) {
- old_d_name = dp->d_name;
- fprintf(fp,
- "extern struct isa_driver %3sdriver;\n",
- old_d_name);
- }
- if (eq(dp->d_name, "wdc"))
- seen_wdc++;
- if (eq(dp->d_name, "fdc"))
- seen_fdc++;
- if ((dp->d_irq == 2) && (machine == MACHINE_I386)) {
- fprintf(stderr,
- "remapped irq 2 to irq 9, please update your config file\n");
- dp->d_irq = 9;
- }
- }
- dev_id = 10; /* XXX must match mkglue.c */
- isa_devtab(fp, "bio", &dev_id);
- if (seen_wdc)
- isa_biotab(fp, "wdc");
- if (seen_fdc)
- isa_biotab(fp, "fdc");
- isa_devtab(fp, "tty", &dev_id);
- isa_devtab(fp, "net", &dev_id);
- isa_devtab(fp, "cam", &dev_id);
- isa_devtab(fp, "ha", &dev_id);
- isa_devtab(fp, "null", &dev_id);
- }
-#endif
-
if (seen_scbus)
scbus_devtab(fp, &dev_id);
@@ -819,78 +212,6 @@ i386_ioconf()
moveifchanged(path("ioconf.c.new"), path("ioconf.c"));
}
-void
-isa_biotab(fp, table)
- FILE *fp;
- char *table;
-{
- register struct device *dp, *mp;
-
- fprintf(fp, "\n");
- fprintf(fp, "struct isa_device isa_biotab_%s[] = {\n", table);
- fprintf(fp, "\
-/* id driver iobase irq drq maddr msiz intr unit flags drive alive ri_flags reconfig enabled conflicts next */\n");
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (dp->d_unit == QUES || mp == 0 ||
- mp == TO_NEXUS || !eq(mp->d_name, table))
- continue;
- fprintf(fp, "{ -1, &%3sdriver, ",
- mp->d_name);
- if (mp->d_port)
- fprintf(fp, " %8s,", mp->d_port);
- else if (mp->d_portn == -1)
- fprintf(fp, " %d,", mp->d_portn);
- else
- fprintf(fp, " 0x%04x,", mp->d_portn);
- fprintf(fp, "%6s, %2d, C 0x%05X, %5d, {0}, %3d, 0x%04X, %5d, 0, 0, 0, %6d, %8d, 0 },\n",
- sirq(mp->d_irq), mp->d_drq, mp->d_maddr,
- mp->d_msize, dp->d_unit,
- dp->d_flags, dp->d_drive, !dp->d_disabled,
- dp->d_conflicts);
- }
- fprintf(fp, "{ 0 }\n};\n");
-}
-
-/*
- * Generized routine for isa bus device table, instead of repeating
- * all this 4 times, call this with the table argument.
- *
- * 4/26/93 rgrimes
- */
-void
-isa_devtab(fp, table, dev_idp)
- FILE *fp;
- char *table;
- int *dev_idp;
-{
- register struct device *dp, *mp;
-
- fprintf(fp, "\n");
- fprintf(fp, "struct isa_device isa_devtab_%s[] = {\n", table);
- fprintf(fp, "\
-/* id driver iobase irq drq maddr msiz intr unit flags scsiid alive ri_flags reconfig enabled conflicts next */\n");
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- if (dp->d_unit == QUES || !eq(dp->d_mask, table))
- continue;
- mp = dp->d_conn;
- if (mp == NULL || mp == TO_NEXUS || !eq(mp->d_name, "isa"))
- continue;
- fprintf(fp, "{ %2d, &%3sdriver,", (*dev_idp)++, dp->d_name);
- if (dp->d_port)
- fprintf(fp, " %8s,", dp->d_port);
- else if (dp->d_portn == -1)
- fprintf(fp, " %d,", dp->d_portn);
- else
- fprintf(fp, " 0x%04x,", dp->d_portn);
- fprintf(fp, "%6s, %2d, C 0x%05X, %5d, {0}, %3d, 0x%04X, 0, 0, 0, 0, %6d, %8d, 0 },\n",
- sirq(dp->d_irq), dp->d_drq, dp->d_maddr,
- dp->d_msize, dp->d_unit,
- dp->d_flags, !dp->d_disabled, dp->d_conflicts);
- }
- fprintf(fp, "{ 0 }\n};\n");
-}
-
static char *
id(int unit)
{
@@ -912,7 +233,8 @@ id(int unit)
return s;
}
-static void id_put(fp, unit, s)
+static void
+id_put(fp, unit, s)
FILE *fp;
int unit;
char *s;
@@ -1003,7 +325,7 @@ scbus_devtab(fp, dev_idp)
* little pieces of it.
*/
-char *
+static char *
sirq(num)
{
@@ -1014,241 +336,6 @@ sirq(num)
}
#endif
-#if MACHINE_PMAX
-void
-pmax_ioconf()
-{
- register struct device *dp, *mp;
- FILE *fp;
-
- fp = fopen(path("ioconf.c"), "w");
- if (fp == 0)
- err(1, "%s", path("ioconf.c"));
- fprintf(fp, "#include <sys/types.h>\n");
- fprintf(fp, "#include <sys/time.h>\n");
- fprintf(fp, "#include <pmax/dev/device.h>\n\n");
- fprintf(fp, "#define C (char *)\n\n");
-
- /* print controller initialization structures */
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- if (dp->d_type == PSEUDO_DEVICE)
- continue;
- fprintf(fp, "extern struct driver %sdriver;\n", dp->d_name);
- }
- fprintf(fp, "\nstruct pmax_ctlr pmax_cinit[] = {\n");
- fprintf(fp, "/*\tdriver,\t\tunit,\taddr,\t\tpri,\tflags */\n");
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- if (dp->d_type != CONTROLLER && dp->d_type != MASTER)
- continue;
- if (dp->d_conn != TO_NEXUS) {
- printf("%s%s must be attached to a nexus (internal bus)\n",
- dp->d_name, wnum(dp->d_unit));
- continue;
- }
- if (dp->d_drive != UNKNOWN || dp->d_slave != UNKNOWN) {
- printf("can't specify drive/slave for %s%s\n",
- dp->d_name, wnum(dp->d_unit));
- continue;
- }
- if (dp->d_unit == UNKNOWN || dp->d_unit == QUES)
- dp->d_unit = 0;
- fprintf(fp,
- "\t{ &%sdriver,\t%d,\tC 0x%x,\t%d,\t0x%x },\n",
- dp->d_name, dp->d_unit, dp->d_addr, dp->d_pri,
- dp->d_flags);
- }
- fprintf(fp, "\t0\n};\n");
-
- /* print devices connected to other controllers */
- fprintf(fp, "\nstruct scsi_device scsi_dinit[] = {\n");
- fprintf(fp,
- "/*driver,\tcdriver,\tunit,\tctlr,\tdrive,\tslave,\tdk,\tflags*/\n");
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- if (dp->d_type == CONTROLLER || dp->d_type == MASTER ||
- dp->d_type == PSEUDO_DEVICE)
- continue;
- mp = dp->d_conn;
- if (mp == 0 ||
- (!eq(mp->d_name, "asc") && !eq(mp->d_name, "sii"))) {
- printf("%s%s: devices must be attached to a SCSI (asc or sii) controller\n",
- dp->d_name, wnum(dp->d_unit));
- continue;
- }
- if ((unsigned)dp->d_drive > 6) {
- printf("%s%s: SCSI drive must be in the range 0..6\n",
- dp->d_name, wnum(dp->d_unit));
- continue;
- }
- /* may want to allow QUES later */
- if ((unsigned)dp->d_slave > 7) {
- printf("%s%s: SCSI slave (LUN) must be in the range 0..7\n",
- dp->d_name, wnum(dp->d_unit));
- continue;
- }
- fprintf(fp, "{ &%sdriver,\t&%sdriver,", dp->d_name, mp->d_name);
- fprintf(fp, "\t%d,\t%d,\t%d,\t%d,\t%d,\t0x%x },\n",
- dp->d_unit, mp->d_unit, dp->d_drive, dp->d_slave,
- dp->d_dk, dp->d_flags);
- }
- fprintf(fp, "0\n};\n");
- pseudo_ioconf(fp);
- (void) fclose(fp);
-}
-#endif
-
-#if MACHINE_NEWS3400
-int have_iop = 0;
-int have_hb = 0;
-int have_vme = 0;
-
-void
-news_ioconf()
-{
- register struct device *dp, *mp;
- register int slave;
- FILE *fp;
-
- fp = fopen(path("ioconf.c"), "w");
- if (fp == 0)
- err(1, "%s", path("ioconf.c"));
- fprintf(fp, "#include <sys/param.h>\n");
- fprintf(fp, "#include <sys/buf.h>\n");
- fprintf(fp, "#include <vm/vm.h>\n");
- fprintf(fp, "#include \"iop.h\"\n");
- fprintf(fp, "#include \"hb.h\"\n");
- fprintf(fp, "\n");
- fprintf(fp, "#if NIOP > 0\n");
- fprintf(fp, "#include <news3400/iop/iopvar.h>\n");
- fprintf(fp, "#endif\n");
- fprintf(fp, "#if NHB > 0\n");
- fprintf(fp, "#include <news3400/hbdev/hbvar.h>\n");
- fprintf(fp, "#endif\n");
- fprintf(fp, "\n");
- fprintf(fp, "#define C (caddr_t)\n\n");
- fprintf(fp, "\n");
-
-/* BEGIN HB */
- fprintf(fp, "#if NHB > 0\n");
- /*
- * Now generate interrupt vectors for the HYPER-BUS
- */
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- if (dp->d_pri >= 0) {
- mp = dp->d_conn;
- if (mp == 0 || mp == TO_NEXUS ||
- !eq(mp->d_name, "hb"))
- continue;
- fprintf(fp, "extern struct hb_driver %sdriver;\n",
- dp->d_name);
- have_hb++;
- }
- }
- /*
- * Now spew forth the hb_cinfo structure
- */
- fprintf(fp, "\nstruct hb_ctlr hminit[] = {\n");
- fprintf(fp, "/*\t driver,\tctlr,\talive,\taddr,\tintpri */\n");
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if ((dp->d_type != MASTER && dp->d_type != CONTROLLER)
- || mp == TO_NEXUS || mp == 0 ||
- !eq(mp->d_name, "hb"))
- continue;
- if (dp->d_pri < 0) {
- printf("must specify priority for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_drive != UNKNOWN || dp->d_slave != UNKNOWN) {
- printf("drives need their own entries; ");
- printf("dont specify drive or slave for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_flags) {
- printf(
- "controllers (e.g. %s%d) don't have flags, only devices do\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- fprintf(fp, "\t{ &%sdriver,\t%d,\t0,\tC 0x%x,\t%d },\n",
- dp->d_name, dp->d_unit, dp->d_addr, dp->d_pri);
- }
- fprintf(fp, "\t0\n};\n");
- /*
- * Now we go for the hb_device stuff
- */
- fprintf(fp, "\nstruct hb_device hdinit[] = {\n");
- fprintf(fp,
-"\t/* driver, unit, ctlr, slave, addr, pri, dk, flags*/\n");
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (dp->d_unit == QUES || dp->d_type != DEVICE || mp == 0 ||
- mp == TO_NEXUS || /* mp->d_type == MASTER || */
- eq(mp->d_name, "iop") || eq(mp->d_name, "vme"))
- continue;
- if (eq(mp->d_name, "hb")) {
- if (dp->d_pri < 0) {
- printf("must specify vector for device %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_drive != UNKNOWN || dp->d_slave != UNKNOWN) {
- printf("drives/slaves can be specified only ");
- printf("for controllers, not for device %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- slave = QUES;
- } else {
- if (mp->d_conn == 0) {
- printf("%s%d isn't connected to anything, ",
- mp->d_name, mp->d_unit);
- printf("so %s%d is unattached\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_drive == UNKNOWN) {
- printf("must specify ``drive number'' for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- /* NOTE THAT ON THE IOP ``drive'' IS STORED IN */
- /* ``SLAVE'' AND WE DON'T WANT A SLAVE SPECIFIED */
- if (dp->d_slave != UNKNOWN) {
- printf("slave numbers should be given only ");
- printf("for massbus tapes, not for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_pri >= 0) {
- printf("interrupt priority should not be ");
- printf("given for drive %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_addr != 0) {
- printf("csr addresses should be given only");
- printf("on controllers, not on %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- slave = dp->d_drive;
- }
- fprintf(fp,
-"\t{ &%sdriver, %2d, %s, %2d, C 0x%x, %d, %d, 0x%x },\n",
- eq(mp->d_name, "hb") ? dp->d_name : mp->d_name, dp->d_unit,
- eq(mp->d_name, "hb") ? " -1" : qu(mp->d_unit),
- slave, dp->d_addr, dp->d_pri, dp->d_dk, dp->d_flags);
- }
- fprintf(fp, "\t0\n};\n\n");
- fprintf(fp, "#endif\n\n");
-/* END HB */
- pseudo_ioconf(fp);
- (void) fclose(fp);
-}
-#endif
-
#if MACHINE_ALPHA
void
alpha_ioconf()
@@ -1280,7 +367,7 @@ alpha_ioconf()
#endif
-char *
+static char *
intv(dev)
register struct device *dev;
{
@@ -1292,7 +379,7 @@ intv(dev)
return (buf);
}
-char *
+static char *
qu(num)
{
@@ -1304,7 +391,7 @@ qu(num)
return (errbuf);
}
-char *
+static char *
wnum(num)
{
@@ -1313,81 +400,3 @@ wnum(num)
(void) sprintf(errbuf, "%d", num);
return (errbuf);
}
-
-void
-pseudo_ioconf(fp)
- register FILE *fp;
-{
- register struct device *dp;
-
- (void)fprintf(fp, "\n#include <sys/device.h>\n\n");
- for (dp = dtab; dp != NULL; dp = dp->d_next)
- if (dp->d_type == PSEUDO_DEVICE)
- (void)fprintf(fp, "extern void %sattach __P((int));\n",
- dp->d_name);
- /*
- * XXX concatonated disks are pseudo-devices but appear as DEVICEs
- * since they don't adhere to normal pseudo-device conventions
- * (i.e. one entry with total count in d_slave).
- */
- if (seen_cd)
- (void)fprintf(fp, "extern void cdattach __P((int));\n");
- /* XXX temporary for HP300, others */
- (void)fprintf(fp, "\n#include <sys/systm.h> /* XXX */\n");
- (void)fprintf(fp, "#define etherattach (void (*)__P((int)))nullop\n");
- (void)fprintf(fp, "#define iteattach (void (*) __P((int)))nullop\n");
- (void)fprintf(fp, "\nstruct pdevinit pdevinit[] = {\n");
- for (dp = dtab; dp != NULL; dp = dp->d_next)
- if (dp->d_type == PSEUDO_DEVICE)
- (void)fprintf(fp, "\t{ %sattach, %d },\n", dp->d_name,
- dp->d_slave > 0 ? dp->d_slave : 1);
- /*
- * XXX count up cds and put out an entry
- */
- if (seen_cd) {
- struct file_list *fl;
- int cdmax = -1;
-
- for (fl = comp_list; fl != NULL; fl = fl->f_next)
- if (fl->f_type == COMPDEVICE && fl->f_compinfo > cdmax)
- cdmax = fl->f_compinfo;
- (void)fprintf(fp, "\t{ cdattach, %d },\n", cdmax+1);
- }
- (void)fprintf(fp, "\t{ 0, 0 }\n};\n");
- if (seen_cd)
- comp_config(fp);
-}
-
-void
-comp_config(fp)
- FILE *fp;
-{
- register struct file_list *fl;
- register struct device *dp;
-
- fprintf(fp, "\n#include <dev/cdvar.h>\n");
- fprintf(fp, "\nstruct cddevice cddevice[] = {\n");
- fprintf(fp, "/*\tunit\tileave\tflags\tdk\tdevs\t\t\t\t*/\n");
-
- fl = comp_list;
- while (fl) {
- if (fl->f_type != COMPDEVICE) {
- fl = fl->f_next;
- continue;
- }
- for (dp = dtab; dp != 0; dp = dp->d_next)
- if (dp->d_type == DEVICE &&
- eq(dp->d_name, fl->f_fn) &&
- dp->d_unit == fl->f_compinfo)
- break;
- if (dp == 0)
- continue;
- fprintf(fp, "\t%d,\t%d,\t%d,\t%d,\t{",
- dp->d_unit, dp->d_pri < 0 ? 0 : dp->d_pri,
- dp->d_flags, 1);
- for (fl = fl->f_next; fl->f_type == COMPSPEC; fl = fl->f_next)
- fprintf(fp, " 0x%x,", fl->f_compdev);
- fprintf(fp, " NODEV },\n");
- }
- fprintf(fp, "\t-1,\t0,\t0,\t0,\t{ 0 },\n};\n");
-}
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index 77fcb46..cb7a300 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mkmakefile.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: mkmakefile.c,v 1.36 1999/04/11 03:40:10 grog Exp $";
+ "$Id: mkmakefile.c,v 1.37 1999/04/13 18:22:57 peter Exp $";
#endif /* not lint */
/*
@@ -70,27 +70,28 @@ static const char rcsid[] =
#define ns(s) strdup(s)
-static struct file_list *fcur;
-char *tail();
+static struct file_list *fcur;
extern int old_config_present;
-void do_swapspec __P((FILE *, char *));
-void do_clean __P((FILE *));
-void do_load __P((FILE *));
-void do_rules __P((FILE *));
-void do_sfiles __P((FILE *));
-void do_mfiles __P((FILE *));
-void do_cfiles __P((FILE *));
-void do_objs __P((FILE *));
-void do_before_depend __P((FILE *));
-int opteq __P((char *, char *));
-void read_files __P((void));
+static char *tail __P((char *));
+static void do_swapspec __P((FILE *, char *));
+static void do_clean __P((FILE *));
+static void do_load __P((FILE *));
+static void do_rules __P((FILE *));
+static void do_sfiles __P((FILE *));
+static void do_mfiles __P((FILE *));
+static void do_cfiles __P((FILE *));
+static void do_objs __P((FILE *));
+static void do_before_depend __P((FILE *));
+static struct file_list *do_systemspec __P((FILE *, struct file_list *, int));
+static int opteq __P((char *, char *));
+static void read_files __P((void));
void makefile __P((void));
/*
* Lookup a file, by name.
*/
-struct file_list *
+static struct file_list *
fl_lookup(file)
register char *file;
{
@@ -106,7 +107,7 @@ fl_lookup(file)
/*
* Lookup a file, by final component name.
*/
-struct file_list *
+static struct file_list *
fltail_lookup(file)
register char *file;
{
@@ -122,7 +123,7 @@ fltail_lookup(file)
/*
* Make a new file list entry
*/
-struct file_list *
+static struct file_list *
new_fent()
{
register struct file_list *fp;
@@ -158,7 +159,7 @@ makefile()
ofp = fopen(path("Makefile.new"), "w");
if (ofp == 0)
err(1, "%s", path("Makefile.new"));
- fprintf(ofp, "KERN_IDENT=%s\n", raise(ident));
+ fprintf(ofp, "KERN_IDENT=%s\n", raisestr(ident));
fprintf(ofp, "IDENT=");
if (profiling)
fprintf(ofp, " -DGPROF");
@@ -248,7 +249,7 @@ makefile()
* Read in the information about files used in making the system.
* Store it in the ftab linked list.
*/
-void
+static void
read_files()
{
FILE *fp;
@@ -288,7 +289,7 @@ next:
goto openit;
}
if (first == 2) {
- (void) snprintf(fname, sizeof fname, "files.%s", raise(ident));
+ (void) snprintf(fname, sizeof fname, "files.%s", raisestr(ident));
first++;
fp = fopen(fname, "r");
if (fp != 0)
@@ -508,7 +509,7 @@ save:
goto next;
}
-int
+static int
opteq(cp, dp)
char *cp, *dp;
{
@@ -526,7 +527,7 @@ opteq(cp, dp)
}
}
-void
+static void
do_before_depend(fp)
FILE *fp;
{
@@ -552,7 +553,7 @@ do_before_depend(fp)
putc('\n', fp);
}
-void
+static void
do_objs(fp)
FILE *fp;
{
@@ -591,7 +592,7 @@ cont:
putc('\n', fp);
}
-void
+static void
do_cfiles(fp)
FILE *fp;
{
@@ -635,7 +636,7 @@ do_cfiles(fp)
putc('\n', fp);
}
-void
+static void
do_mfiles(fp)
FILE *fp;
{
@@ -660,7 +661,7 @@ do_mfiles(fp)
putc('\n', fp);
}
-void
+static void
do_sfiles(fp)
FILE *fp;
{
@@ -686,7 +687,7 @@ do_sfiles(fp)
}
-char *
+static char *
tail(fn)
char *fn;
{
@@ -705,7 +706,7 @@ tail(fn)
* which avoids any problem areas with i/o addressing
* (e.g. for the VAX); assembler files are processed by as.
*/
-void
+static void
do_rules(f)
FILE *f;
{
@@ -776,13 +777,12 @@ do_rules(f)
/*
* Create the load strings
*/
-void
+static void
do_load(f)
register FILE *f;
{
register struct file_list *fl;
register int first;
- struct file_list *do_systemspec();
for (first = 1, fl = conf_list; fl; first = 0)
fl = fl->f_type == SYSTEMSPEC ?
@@ -794,7 +794,7 @@ do_load(f)
putc('\n', f);
}
-void
+static void
do_clean(fp)
FILE *fp;
{
@@ -817,7 +817,7 @@ do_clean(fp)
putc('\n', fp);
}
-struct file_list *
+static struct file_list *
do_systemspec(f, fl, first)
FILE *f;
register struct file_list *fl;
@@ -838,7 +838,7 @@ do_systemspec(f, fl, first)
return (fl);
}
-void
+static void
do_swapspec(f, name)
FILE *f;
register char *name;
@@ -853,7 +853,7 @@ do_swapspec(f, name)
}
char *
-raise(str)
+raisestr(str)
register char *str;
{
register char *cp = str;
diff --git a/usr.sbin/config/mkoptions.c b/usr.sbin/config/mkoptions.c
index e638f20..25519a2 100644
--- a/usr.sbin/config/mkoptions.c
+++ b/usr.sbin/config/mkoptions.c
@@ -37,7 +37,7 @@
static char sccsid[] = "@(#)mkheaders.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: mkoptions.c,v 1.7 1998/07/12 02:31:08 bde Exp $";
+ "$Id: mkoptions.c,v 1.8 1998/07/12 08:10:33 bde Exp $";
#endif /* not lint */
/*
@@ -58,22 +58,16 @@ static struct users {
int u_min;
int u_max;
} users[] = {
- { 8, 2, 512 }, /* MACHINE_VAX */
- { 8, 2, 512 }, /* MACHINE_TAHOE */
- { 8, 2, 512 }, /* MACHINE_HP300 */
{ 8, 2, 512 }, /* MACHINE_I386 */
- { 8, 2, 512 }, /* MACHINE_MIPS */
- { 8, 2, 512 }, /* MACHINE_PMAX */
- { 8, 2, 512 }, /* MACHINE_LUNA68K */
- { 8, 2, 512 }, /* MACHINE_NEWS3400 */
{ 8, 2, 512 }, /* MACHINE_PC98 */
{ 8, 2, 512 }, /* MACHINE_ALPHA */
};
#define NUSERS (sizeof (users) / sizeof (users[0]))
-static char *lower __P((char *));
-void read_options __P((void));
-void do_option __P((char *));
+static char *lower __P((char *));
+static void read_options __P((void));
+static void do_option __P((char *));
+static char *tooption __P((char *));
void
options()
@@ -96,7 +90,7 @@ options()
/* Initialize `maxusers'. */
if ((unsigned)machine > NUSERS) {
printf("maxusers config info isn't present, using vax\n");
- up = &users[MACHINE_VAX - 1];
+ up = &users[MACHINE_I386 - 1];
} else
up = &users[machine - 1];
if (maxusers == 0) {
@@ -126,11 +120,11 @@ options()
* Generate an <options>.h file
*/
-void
+static void
do_option(name)
char *name;
{
- char *file, *inw, *tooption();
+ char *file, *inw;
struct opt *op, *op_head, *topp;
FILE *inf, *outf;
char *value;
@@ -250,7 +244,7 @@ do_option(name)
/*
* Find the filename to store the option spec into.
*/
-char *
+static char *
tooption(name)
char *name;
{
@@ -275,7 +269,7 @@ tooption(name)
/*
* read the options and options.<machine> files
*/
-void
+static void
read_options()
{
FILE *fp;
@@ -306,7 +300,7 @@ next:
goto openit;
}
if (first == 2) {
- (void) snprintf(fname, sizeof fname, "options.%s", raise(ident));
+ (void) snprintf(fname, sizeof fname, "options.%s", raisestr(ident));
first++;
fp = fopen(fname, "r");
if (fp != 0)
diff --git a/usr.sbin/config/mkswapconf.c b/usr.sbin/config/mkswapconf.c
index 6ad8a19..f4195ef 100644
--- a/usr.sbin/config/mkswapconf.c
+++ b/usr.sbin/config/mkswapconf.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mkswapconf.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: mkswapconf.c,v 1.15 1998/06/09 14:02:08 dfr Exp $";
+ "$Id: mkswapconf.c,v 1.16 1999/04/15 14:52:22 bde Exp $";
#endif /* not lint */
/*
@@ -48,9 +48,6 @@ static const char rcsid[] =
#include <sys/disklabel.h>
#include <sys/diskslice.h>
-#ifdef linux
-#include <sys/sysmacros.h>
-#endif
#include <ctype.h>
#include <stdio.h>
@@ -58,13 +55,13 @@ static const char rcsid[] =
#define ns(s) strdup(s)
-void initdevtable __P((void));
+static void initdevtable __P((void));
+static struct file_list *do_swap __P((struct file_list *));
void
swapconf()
{
register struct file_list *fl;
- struct file_list *do_swap();
fl = conf_list;
while (fl) {
@@ -76,7 +73,7 @@ swapconf()
}
}
-struct file_list *
+static struct file_list *
do_swap(fl)
register struct file_list *fl;
{
@@ -234,7 +231,7 @@ devtoname(dev)
return (ns(buf));
}
-void
+static void
initdevtable()
{
char linebuf[256];
diff --git a/usr.sbin/config/mkubglue.c b/usr.sbin/config/mkubglue.c
deleted file mode 100644
index c72766b..0000000
--- a/usr.sbin/config/mkubglue.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/*-
- * Copyright (c) 1980, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)mkubglue.c 8.1 (Berkeley) 6/6/93";
-#endif
-static const char rcsid[] =
- "$Id$";
-#endif /* not lint */
-
-/*
- * Make the uba interrupt file ubglue.s
- */
-#include <stdio.h>
-#include "config.h"
-#include "y.tab.h"
-
-ubglue()
-{
- register FILE *fp;
- register struct device *dp, *mp;
-
- fp = fopen(path("ubglue.s"), "w");
- if (fp == 0)
- err(1, "%s", path("ubglue.s"));
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (mp != 0 && mp != (struct device *)-1 &&
- !eq(mp->d_name, "mba")) {
- struct idlst *id, *id2;
-
- for (id = dp->d_vec; id; id = id->id_next) {
- for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
- if (id2 == id) {
- dump_vec(fp, id->id, dp->d_unit);
- break;
- }
- if (!strcmp(id->id, id2->id))
- break;
- }
- }
- }
- }
- dump_std(fp);
- for (dp = dtab; dp != 0; dp = dp->d_next) {
- mp = dp->d_conn;
- if (mp != 0 && mp != (struct device *)-1 &&
- !eq(mp->d_name, "mba")) {
- struct idlst *id, *id2;
-
- for (id = dp->d_vec; id; id = id->id_next) {
- for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
- if (id2 == id) {
- dump_intname(fp, id->id,
- dp->d_unit);
- break;
- }
- if (!strcmp(id->id, id2->id))
- break;
- }
- }
- }
- }
- dump_ctrs(fp);
- (void) fclose(fp);
-}
-
-static int cntcnt = 0; /* number of interrupt counters allocated */
-
-/*
- * print an interrupt vector
- */
-dump_vec(fp, vector, number)
- register FILE *fp;
- char *vector;
- int number;
-{
- char nbuf[80];
- register char *v = nbuf;
-
- (void) sprintf(v, "%s%d", vector, number);
- fprintf(fp, "\t.globl\t_X%s\n\t.align\t2\n_X%s:\n\tpushr\t$0x3f\n",
- v, v);
- fprintf(fp, "\tincl\t_fltintrcnt+(4*%d)\n", cntcnt++);
- if (strncmp(vector, "dzx", 3) == 0)
- fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdzdma\n\n", number);
- else if (strncmp(vector, "dpx", 3) == 0)
- fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdpxdma\n\n", number);
- else if (strncmp(vector, "dpr", 3) == 0)
- fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdprdma\n\n", number);
- else {
- if (strncmp(vector, "uur", 3) == 0) {
- fprintf(fp, "#ifdef UUDMA\n");
- fprintf(fp, "\tmovl\t$%d,r0\n\tjsb\tuudma\n", number);
- fprintf(fp, "#endif\n");
- }
- fprintf(fp, "\tpushl\t$%d\n", number);
- fprintf(fp, "\tcalls\t$1,_%s\n\tpopr\t$0x3f\n", vector);
- fprintf(fp, "\tincl\t_cnt+V_INTR\n\trei\n\n");
- }
-}
-
-/*
- * Start the interrupt name table with the names
- * of the standard vectors not on the unibus.
- * The number and order of these names should correspond
- * with the definitions in scb.s.
- */
-dump_std(fp)
- register FILE *fp;
-{
- fprintf(fp, "\n\t.globl\t_intrnames\n");
- fprintf(fp, "\n\t.globl\t_eintrnames\n");
- fprintf(fp, "\t.data\n");
- fprintf(fp, "_intrnames:\n");
- fprintf(fp, "\t.asciz\t\"clock\"\n");
- fprintf(fp, "\t.asciz\t\"cnr\"\n");
- fprintf(fp, "\t.asciz\t\"cnx\"\n");
- fprintf(fp, "\t.asciz\t\"tur\"\n");
- fprintf(fp, "\t.asciz\t\"tux\"\n");
- fprintf(fp, "\t.asciz\t\"mba0\"\n");
- fprintf(fp, "\t.asciz\t\"mba1\"\n");
- fprintf(fp, "\t.asciz\t\"mba2\"\n");
- fprintf(fp, "\t.asciz\t\"mba3\"\n");
- fprintf(fp, "\t.asciz\t\"uba0\"\n");
- fprintf(fp, "\t.asciz\t\"uba1\"\n");
- fprintf(fp, "\t.asciz\t\"uba2\"\n");
- fprintf(fp, "\t.asciz\t\"uba3\"\n");
-#define I_FIXED 13 /* number of names above */
-}
-
-dump_intname(fp, vector, number)
- register FILE *fp;
- char *vector;
- int number;
-{
- register char *cp = vector;
-
- fprintf(fp, "\t.asciz\t\"");
- /*
- * Skip any "int" or "intr" in the name.
- */
- while (*cp)
- if (cp[0] == 'i' && cp[1] == 'n' && cp[2] == 't') {
- cp += 3;
- if (*cp == 'r')
- cp++;
- } else {
- putc(*cp, fp);
- cp++;
- }
- fprintf(fp, "%d\"\n", number);
-}
-
-dump_ctrs(fp)
- register FILE *fp;
-{
- fprintf(fp, "_eintrnames:\n");
- fprintf(fp, "\n\t.globl\t_intrcnt\n");
- fprintf(fp, "\n\t.globl\t_eintrcnt\n");
- fprintf(fp, "_intrcnt:\n", I_FIXED);
- fprintf(fp, "\t.space\t4 * %d\n", I_FIXED);
- fprintf(fp, "_fltintrcnt:\n", cntcnt);
- fprintf(fp, "\t.space\t4 * %d\n", cntcnt);
- fprintf(fp, "_eintrcnt:\n\n");
- fprintf(fp, "\t.text\n");
-}
OpenPOWER on IntegriCloud