Get out the blow torch and hack away all the unused stuff. Note that
I zapped the MACHINE_MIPS stuff, it isn't likely to be useful apart from recognition of the machine name. It would be reasonable to expect new ports would look something like the alpha/i386 from a config perspective.
This commit is contained in:
parent
a9013e8a77
commit
188334f6de
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=45744
@ -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}
|
||||
|
@ -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();
|
||||
|
||||
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;
|
||||
#endif
|
||||
int seen_cd;
|
||||
|
||||
struct device *connect();
|
||||
struct device *dtab;
|
||||
dev_t nametodev();
|
||||
char *devtoname();
|
||||
void init_dev __P((struct device *));
|
||||
|
||||
char errbuf[80];
|
||||
int yyline;
|
||||
|
||||
struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
|
||||
#if MACHINE_I386
|
||||
extern int seen_isa;
|
||||
extern int seen_scbus;
|
||||
#endif
|
||||
|
||||
int profiling;
|
||||
int debugging;
|
||||
extern struct device *dtab;
|
||||
|
||||
int maxusers;
|
||||
u_int loadaddress;
|
||||
extern char errbuf[80];
|
||||
extern int yyline;
|
||||
|
||||
extern struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
|
||||
|
||||
extern int profiling;
|
||||
extern int debugging;
|
||||
|
||||
extern int maxusers;
|
||||
extern u_int loadaddress;
|
||||
|
||||
extern int old_config_present; /* Old config/build directory still there */
|
||||
|
||||
|
@ -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;
|
||||
{
|
||||
|
@ -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 },
|
||||
|
@ -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;
|
||||
|
@ -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)++;
|
||||
}
|
||||
}
|
@ -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];
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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 @@ read_files()
|
||||
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 @@ read_files()
|
||||
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 @@ do_objs(fp)
|
||||
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;
|
||||
|
@ -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 @@ read_options()
|
||||
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)
|
||||
|
@ -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];
|
||||
|
@ -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");
|
||||
}
|
Loading…
Reference in New Issue
Block a user