summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1998-06-09 14:02:08 +0000
committerdfr <dfr@FreeBSD.org>1998-06-09 14:02:08 +0000
commit9d3db765ca348dc273a136848d1d42795119d828 (patch)
treeb46c3f8bab6df5cdaff202789c82b429c5a15e13 /usr.sbin
parenta89f496cbf1aff49309b74d4f717d397d95dd30b (diff)
downloadFreeBSD-src-9d3db765ca348dc273a136848d1d42795119d828.zip
FreeBSD-src-9d3db765ca348dc273a136848d1d42795119d828.tar.gz
Add (mostly stub) alpha support. Incidentally, it doesn't build on stable
unless I manually construct y.tab.h. Is this normal?
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/config/config.h1
-rw-r--r--usr.sbin/config/config.y6
-rw-r--r--usr.sbin/config/main.c9
-rw-r--r--usr.sbin/config/mkioconf.c105
-rw-r--r--usr.sbin/config/mkmakefile.c3
-rw-r--r--usr.sbin/config/mkswapconf.c5
6 files changed, 125 insertions, 4 deletions
diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h
index fd4d6dc..d60ad1a 100644
--- a/usr.sbin/config/config.h
+++ b/usr.sbin/config/config.h
@@ -160,6 +160,7 @@ char *machinename;
#define MACHINE_LUNA68K 7
#define MACHINE_NEWS3400 8
#define MACHINE_PC98 9
+#define MACHINE_ALPHA 10
/*
* For each machine, a set of CPU's may be specified as supported.
diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y
index 9ad7b0d..845ee65 100644
--- a/usr.sbin/config/config.y
+++ b/usr.sbin/config/config.y
@@ -117,6 +117,9 @@
#include <sys/disklabel.h>
#include <sys/diskslice.h>
+#ifdef linux
+#include <sys/sysmacros.h>
+#endif
#include <ctype.h>
#include <err.h>
@@ -189,6 +192,9 @@ Config_spec:
} else if (!strcmp($2, "news3400")) {
machine = MACHINE_NEWS3400;
machinename = "news3400";
+ } else if (!strcmp($2, "alpha")) {
+ machine = MACHINE_ALPHA;
+ machinename = "alpha";
} else
yyerror("Unknown machine type");
} |
diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c
index 4ff0ca5..7fd3bfc 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.23 1998/04/23 16:37:06 bde Exp $";
+ "$Id: main.c,v 1.24 1998/05/02 01:57:38 kato Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -179,6 +179,10 @@ main(argc, argv)
news_ioconf();
break;
+ case MACHINE_ALPHA:
+ alpha_ioconf();
+ break;
+
default:
printf("Specify machine type, e.g. ``machine vax''\n");
exit(1);
@@ -409,6 +413,9 @@ moveifchanged(const char *from_name, const char *to_name)
if (!changed) {
p = mmap(NULL, tsize, PROT_READ, MAP_SHARED, from_fd, (off_t)0);
+#ifndef MAP_FAILED
+#define MAP_FAILED ((caddr_t) -1)
+#endif
if (p == MAP_FAILED)
err(EX_OSERR, "mmap %s", from_name);
q = mmap(NULL, tsize, PROT_READ, MAP_SHARED, to_fd, (off_t)0);
diff --git a/usr.sbin/config/mkioconf.c b/usr.sbin/config/mkioconf.c
index b7053a0..6bb4b92 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.34 1998/04/02 04:25:41 eivind Exp $";
+ "$Id: mkioconf.c,v 1.35 1998/05/02 01:57:39 kato Exp $";
#endif /* not lint */
#include <err.h>
@@ -1218,6 +1218,109 @@ news_ioconf()
}
#endif
+#if MACHINE_ALPHA
+void
+alpha_ioconf()
+{
+ register struct device *dp, *mp;
+ FILE *fp;
+ FILE *fp1;
+ int dev_id = 10;
+
+ fp = fopen(path("ioconf.c.new"), "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 <ioconf.h>\n\n");
+ fprintf(fp, "#define C (char *)\n\n");
+ fp1 = fopen(path("ioconf.h.new"), "w");
+ if (fp1 == 0)
+ err(1, "%s", path("ioconf.h.new"));
+ fprintf(fp1, "/*\n");
+ fprintf(fp1, " * Extern declarations for I/O configuration.\n");
+ fprintf(fp1, " * DO NOT EDIT-- this file is automatically generated.\n");
+ fprintf(fp1, " */\n");
+ fprintf(fp1, "\n");
+ fprintf(fp1, "#ifndef IOCONF_H\n");
+ fprintf(fp1, "#define\tIOCONF_H\n");
+
+#if 0
+ /* 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 alpha_ctlr alpha_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");
+#endif
+ if (seen_scbus)
+ scbus_devtab(fp, fp1, &dev_id);
+
+ (void) fclose(fp);
+ fprintf(fp1, "#endif\n");
+ (void) fclose(fp1);
+ moveifchanged(path("ioconf.c.new"), path("ioconf.c"));
+ moveifchanged(path("ioconf.h.new"), path("ioconf.h"));
+}
+
+#endif
+
char *
intv(dev)
register struct device *dev;
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index 603be31..b42292e 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.28 1998/03/16 11:15:45 eivind Exp $";
+ "$Id: mkmakefile.c,v 1.29 1998/05/02 01:57:39 kato Exp $";
#endif /* not lint */
/*
@@ -150,6 +150,7 @@ static struct users {
{ 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]))
diff --git a/usr.sbin/config/mkswapconf.c b/usr.sbin/config/mkswapconf.c
index e563968..d276099 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.13 1997/09/15 06:37:10 charnier Exp $";
+ "$Id: mkswapconf.c,v 1.14 1997/09/17 06:20:45 charnier Exp $";
#endif /* not lint */
/*
@@ -48,6 +48,9 @@ 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>
OpenPOWER on IntegriCloud