BSD 4_3_Tahoe release
[unix-history] / usr / src / etc / config / config.y
index 03cd591..ae1d32c 100644 (file)
@@ -27,7 +27,6 @@
 %token MAJOR
 %token MASTER
 %token MAXUSERS
 %token MAJOR
 %token MASTER
 %token MAXUSERS
-%token MBA
 %token MINOR
 %token MINUS
 %token NEXUS
 %token MINOR
 %token MINUS
 %token NEXUS
@@ -43,7 +42,6 @@
 %token SWAP
 %token TIMEZONE
 %token TRACE
 %token SWAP
 %token TIMEZONE
 %token TRACE
-%token UBA
 %token VECTOR
 
 %token <str>   ID
 %token VECTOR
 
 %token <str>   ID
 %{
 
 /*
 %{
 
 /*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * Copyright (c) 1988 Regents of the University of California.
+ * All rights reserved.
  *
  *
- *     @(#)config.y    5.2 (Berkeley) 4/18/86
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *     @(#)config.y    5.8 (Berkeley) 6/18/88
  */
 
 #include "config.h"
  */
 
 #include "config.h"
@@ -113,9 +122,9 @@ Config_spec:
                if (!strcmp($2, "vax")) {
                        machine = MACHINE_VAX;
                        machinename = "vax";
                if (!strcmp($2, "vax")) {
                        machine = MACHINE_VAX;
                        machinename = "vax";
-               } else if (!strcmp($2, "sun")) {
-                       machine = MACHINE_SUN;
-                       machinename = "sun";
+               } else if (!strcmp($2, "tahoe")) {
+                       machine = MACHINE_TAHOE;
+                       machinename = "tahoe";
                } else
                        yyerror("Unknown machine type");
              } |
                } else
                        yyerror("Unknown machine type");
              } |
@@ -346,7 +355,11 @@ Opt_value:
        ID
              = { $$ = val_id = ns($1); } |
        NUMBER
        ID
              = { $$ = val_id = ns($1); } |
        NUMBER
-             = { char nb[16]; $$ = val_id = ns(sprintf(nb, "%d", $1)); };
+             = {
+               char nb[16];
+               (void) sprintf(nb, "%d", $1);
+               $$ = val_id = ns(nb);
+             } ;
 
 
 Save_id:
 
 
 Save_id:
@@ -373,10 +386,6 @@ Mkoption:
              } ;
 
 Dev:
              } ;
 
 Dev:
-       UBA
-             = { $$ = ns("uba"); } |
-       MBA
-             = { $$ = ns("mba"); } |
        ID
              = { $$ = ns($1); }
        ;
        ID
              = { $$ = ns($1); }
        ;
@@ -410,6 +419,8 @@ Dev_name:
                        seen_mba = 1;
                else if (eq($2, "uba"))
                        seen_uba = 1;
                        seen_mba = 1;
                else if (eq($2, "uba"))
                        seen_uba = 1;
+               else if (eq($2, "vba"))
+                       seen_vba = 1;
                cur.d_unit = $3;
                };
 
                cur.d_unit = $3;
                };
 
@@ -426,9 +437,11 @@ Dev_info:
 Con_info:
        AT Dev NUMBER
              = {
 Con_info:
        AT Dev NUMBER
              = {
-               if (eq(cur.d_name, "mba") || eq(cur.d_name, "uba"))
-                       yyerror(sprintf(errbuf,
-                           "%s must be connected to a nexus", cur.d_name));
+               if (eq(cur.d_name, "mba") || eq(cur.d_name, "uba")) {
+                       (void) sprintf(errbuf,
+                               "%s must be connected to a nexus", cur.d_name);
+                       yyerror(errbuf);
+               }
                cur.d_conn = connect($2, $3);
                } |
        AT NEXUS NUMBER
                cur.d_conn = connect($2, $3);
                } |
        AT NEXUS NUMBER
@@ -482,7 +495,7 @@ yyerror(s)
        char *s;
 {
 
        char *s;
 {
 
-       fprintf(stderr, "config: line %d: %s\n", yyline, s);
+       fprintf(stderr, "config: line %d: %s\n", yyline + 1, s);
 }
 
 /*
 }
 
 /*
@@ -509,6 +522,7 @@ newdev(dp)
 
        np = (struct device *) malloc(sizeof *np);
        *np = *dp;
 
        np = (struct device *) malloc(sizeof *np);
        *np = *dp;
+       np->d_next = 0;
        if (curp == 0)
                dtab = np;
        else
        if (curp == 0)
                dtab = np;
        else
@@ -560,7 +574,7 @@ mkswap(system, fl, size)
        int size;
 {
        register struct file_list **flp;
        int size;
 {
        register struct file_list **flp;
-       char *cp, name[80];
+       char name[80];
 
        if (system == 0 || system->f_type != SYSTEMSPEC) {
                yyerror("\"swap\" spec precedes \"config\" specification");
 
        if (system == 0 || system->f_type != SYSTEMSPEC) {
                yyerror("\"swap\" spec precedes \"config\" specification");
@@ -610,13 +624,15 @@ connect(dev, num)
                if ((num != dp->d_unit) || !eq(dev, dp->d_name))
                        continue;
                if (dp->d_type != CONTROLLER && dp->d_type != MASTER) {
                if ((num != dp->d_unit) || !eq(dev, dp->d_name))
                        continue;
                if (dp->d_type != CONTROLLER && dp->d_type != MASTER) {
-                       yyerror(sprintf(errbuf,
-                           "%s connected to non-controller", dev));
+                       (void) sprintf(errbuf,
+                           "%s connected to non-controller", dev);
+                       yyerror(errbuf);
                        return (0);
                }
                return (dp);
        }
                        return (0);
                }
                return (dp);
        }
-       yyerror(sprintf(errbuf, "%s %d not defined", dev, num));
+       (void) sprintf(errbuf, "%s %d not defined", dev, num);
+       yyerror(errbuf);
        return (0);
 }
 
        return (0);
 }
 
@@ -638,7 +654,8 @@ huhcon(dev)
                if (eq(dp->d_name, dev))
                        break;
        if (dp == 0) {
                if (eq(dp->d_name, dev))
                        break;
        if (dp == 0) {
-               yyerror(sprintf(errbuf, "no %s's to wildcard", dev));
+               (void) sprintf(errbuf, "no %s's to wildcard", dev);
+               yyerror(errbuf);
                return (0);
        }
        oldtype = dp->d_type;
                return (0);
        }
        oldtype = dp->d_type;
@@ -702,15 +719,16 @@ check_nexus(dev, num)
        switch (machine) {
 
        case MACHINE_VAX:
        switch (machine) {
 
        case MACHINE_VAX:
-               if (!eq(dev->d_name, "uba") && !eq(dev->d_name, "mba"))
-                       yyerror("only uba's and mba's should be connected to the nexus");
+               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;
 
                if (num != QUES)
                        yyerror("can't give specific nexus numbers");
                break;
 
-       case MACHINE_SUN:
-               if (!eq(dev->d_name, "mb"))
-                       yyerror("only mb's should be connected to the nexus");
+       case MACHINE_TAHOE:
+               if (!eq(dev->d_name, "vba")) 
+                       yyerror("only vba's should be connected to the nexus");
                break;
        }
 }
                break;
        }
 }
@@ -759,7 +777,7 @@ checksystemspec(fl)
                swap = newswap();
                dev = fl->f_rootdev;
                if (minor(dev) & 07) {
                swap = newswap();
                dev = fl->f_rootdev;
                if (minor(dev) & 07) {
-                       sprintf(buf, 
+                       (void) sprintf(buf, 
 "Warning, swap defaulted to 'b' partition with root on '%c' partition",
                                (minor(dev) & 07) + 'a');
                        yyerror(buf);
 "Warning, swap defaulted to 'b' partition with root on '%c' partition",
                                (minor(dev) & 07) + 'a');
                        yyerror(buf);
@@ -801,7 +819,7 @@ checksystemspec(fl)
                for (; p && p->f_type == SWAPSPEC; p = p->f_next)
                        if (fl->f_dumpdev == p->f_swapdev)
                                return;
                for (; p && p->f_type == SWAPSPEC; p = p->f_next)
                        if (fl->f_dumpdev == p->f_swapdev)
                                return;
-               sprintf(buf, "Warning, orphaned dump device, %s",
+               (void) sprintf(buf, "Warning, orphaned dump device, %s",
                        "do you know what you're doing");
                yyerror(buf);
        }
                        "do you know what you're doing");
                yyerror(buf);
        }
@@ -891,6 +909,7 @@ deverror(systemname, devtype)
  * configured hardware devices.  Must
  * take into account stuff wildcarded.
  */
  * configured hardware devices.  Must
  * take into account stuff wildcarded.
  */
+/*ARGSUSED*/
 finddev(dev)
        dev_t dev;
 {
 finddev(dev)
        dev_t dev;
 {