BSD 4_3_Net_2 release
[unix-history] / usr / src / usr.sbin / config / config.y
index 72de671..76aa58e 100644 (file)
@@ -9,6 +9,7 @@
 %token ANY
 %token ARGS
 %token AT
 %token ANY
 %token ARGS
 %token AT
+%token BIO
 %token COMMA
 %token CONFIG
 %token CONTROLLER
 %token COMMA
 %token CONFIG
 %token CONTROLLER
 %token DEVICE
 %token DISK
 %token DRIVE
 %token DEVICE
 %token DISK
 %token DRIVE
+%token DRQ
 %token DST
 %token DUMPS
 %token EQUALS
 %token FLAGS
 %token HZ
 %token IDENT
 %token DST
 %token DUMPS
 %token EQUALS
 %token FLAGS
 %token HZ
 %token IDENT
+%token IOMEM
+%token IOSIZ
+%token IRQ
 %token MACHINE
 %token MAJOR
 %token MASTER
 %token MAXUSERS
 %token MINOR
 %token MINUS
 %token MACHINE
 %token MAJOR
 %token MASTER
 %token MAXUSERS
 %token MINOR
 %token MINUS
+%token NET
 %token NEXUS
 %token ON
 %token OPTIONS
 %token MAKEOPTIONS
 %token NEXUS
 %token ON
 %token OPTIONS
 %token MAKEOPTIONS
+%token PORT
 %token PRIORITY
 %token PSEUDO_DEVICE
 %token ROOT
 %token PRIORITY
 %token PSEUDO_DEVICE
 %token ROOT
@@ -41,6 +48,7 @@
 %token SLAVE
 %token SWAP
 %token TIMEZONE
 %token SLAVE
 %token SWAP
 %token TIMEZONE
+%token TTY
 %token TRACE
 %token VECTOR
 
 %token TRACE
 %token VECTOR
 
  * Copyright (c) 1988 Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1988 Regents of the University of California.
  * All rights reserved.
  *
- * Redistribution and use in source and binary forms are permitted provided
- * that: (1) source distributions retain this entire copyright notice and
- * comment, and (2) distributions including binaries display the following
- * acknowledgement:  ``This product includes software developed by the
- * University of California, Berkeley and its contributors'' in the
- * documentation or other materials provided with the distribution and in
- * all advertising materials mentioning features or use of this software.
- * 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * 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.
  *
  *
- *     @(#)config.y    5.10 (Berkeley) 6/1/90
+ * 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.
+ *
+ *     @(#)config.y    5.14 (Berkeley) 7/1/91
  */
 
 #include "config.h"
  */
 
 #include "config.h"
@@ -91,7 +113,6 @@ struct       device cur;
 struct device *curp = 0;
 char   *temp_id;
 char   *val_id;
 struct device *curp = 0;
 char   *temp_id;
 char   *val_id;
-char   *malloc();
 
 %}
 %%
 
 %}
 %%
@@ -130,6 +151,9 @@ Config_spec:
                } else if (!strcmp($2, "hp300")) {
                        machine = MACHINE_HP300;
                        machinename = "hp300";
                } else if (!strcmp($2, "hp300")) {
                        machine = MACHINE_HP300;
                        machinename = "hp300";
+               } else if (!strcmp($2, "i386")) {
+                       machine = MACHINE_I386;
+                       machinename = "i386";
                } else
                        yyerror("Unknown machine type");
              } |
                } else
                        yyerror("Unknown machine type");
              } |
@@ -153,29 +177,29 @@ Config_spec:
        HZ NUMBER
              = { yyerror("HZ specification obsolete; delete"); } |
        TIMEZONE NUMBER
        HZ NUMBER
              = { yyerror("HZ specification obsolete; delete"); } |
        TIMEZONE NUMBER
-             = { timezone = 60 * $2; check_tz(); } |
+             = { zone = 60 * $2; check_tz(); } |
        TIMEZONE NUMBER DST NUMBER
        TIMEZONE NUMBER DST NUMBER
-             = { timezone = 60 * $2; dst = $4; check_tz(); } |
+             = { zone = 60 * $2; dst = $4; check_tz(); } |
        TIMEZONE NUMBER DST
        TIMEZONE NUMBER DST
-             = { timezone = 60 * $2; dst = 1; check_tz(); } |
+             = { zone = 60 * $2; dst = 1; check_tz(); } |
        TIMEZONE FPNUMBER
        TIMEZONE FPNUMBER
-             = { timezone = $2; check_tz(); } |
+             = { zone = $2; check_tz(); } |
        TIMEZONE FPNUMBER DST NUMBER
        TIMEZONE FPNUMBER DST NUMBER
-             = { timezone = $2; dst = $4; check_tz(); } |
+             = { zone = $2; dst = $4; check_tz(); } |
        TIMEZONE FPNUMBER DST
        TIMEZONE FPNUMBER DST
-             = { timezone = $2; dst = 1; check_tz(); } |
+             = { zone = $2; dst = 1; check_tz(); } |
        TIMEZONE MINUS NUMBER
        TIMEZONE MINUS NUMBER
-             = { timezone = -60 * $3; check_tz(); } |
+             = { zone = -60 * $3; check_tz(); } |
        TIMEZONE MINUS NUMBER DST NUMBER
        TIMEZONE MINUS NUMBER DST NUMBER
-             = { timezone = -60 * $3; dst = $5; check_tz(); } |
+             = { zone = -60 * $3; dst = $5; check_tz(); } |
        TIMEZONE MINUS NUMBER DST
        TIMEZONE MINUS NUMBER DST
-             = { timezone = -60 * $3; dst = 1; check_tz(); } |
+             = { zone = -60 * $3; dst = 1; check_tz(); } |
        TIMEZONE MINUS FPNUMBER
        TIMEZONE MINUS FPNUMBER
-             = { timezone = -$3; check_tz(); } |
+             = { zone = -$3; check_tz(); } |
        TIMEZONE MINUS FPNUMBER DST NUMBER
        TIMEZONE MINUS FPNUMBER DST NUMBER
-             = { timezone = -$3; dst = $5; check_tz(); } |
+             = { zone = -$3; dst = $5; check_tz(); } |
        TIMEZONE MINUS FPNUMBER DST
        TIMEZONE MINUS FPNUMBER DST
-             = { timezone = -$3; dst = 1; check_tz(); } |
+             = { zone = -$3; dst = 1; check_tz(); } |
        MAXUSERS NUMBER
              = { maxusers = $2; };
 
        MAXUSERS NUMBER
              = { maxusers = $2; };
 
@@ -277,14 +301,7 @@ dump_device_spec:
 
 arg_spec:
          ARGS optional_on arg_device_spec
 
 arg_spec:
          ARGS optional_on arg_device_spec
-               = {
-                       struct file_list *fl = *confp;
-
-                       if (fl && fl->f_argdev != NODEV)
-                               yyerror("extraneous arg device specification");
-                       else
-                               fl->f_argdev = $3;
-               }
+               = { yyerror("arg device specification obsolete, ignored"); }
        ;
 
 arg_device_spec:
        ;
 
 arg_device_spec:
@@ -426,6 +443,8 @@ Dev_name:
                        seen_uba = 1;
                else if (eq($2, "vba"))
                        seen_vba = 1;
                        seen_uba = 1;
                else if (eq($2, "vba"))
                        seen_vba = 1;
+               else if (eq($2, "isa"))
+                       seen_isa = 1;
                cur.d_unit = $3;
                };
 
                cur.d_unit = $3;
                };
 
@@ -471,6 +490,24 @@ Info:
                else
                        yyerror("can't specify slave--not to master");
                } |
                else
                        yyerror("can't specify slave--not to master");
                } |
+       IRQ NUMBER
+             = { cur.d_irq = $2; } |
+       DRQ NUMBER
+             = { cur.d_drq = $2; } |
+       IOMEM NUMBER
+             = { cur.d_maddr = $2; } |
+       IOSIZ NUMBER
+             = { cur.d_msize = $2; } |
+       PORT device_name
+             = { cur.d_port = ns($2); } |
+       PORT NUMBER
+             = { cur.d_portn = $2; } |
+       TTY 
+             = { cur.d_mask = "tty"; } |
+       BIO 
+             = { cur.d_mask = "bio"; } |
+       NET 
+             = { cur.d_mask = "net"; } |
        FLAGS NUMBER
              = { cur.d_flags = $2; };
 
        FLAGS NUMBER
              = { cur.d_flags = $2; };
 
@@ -547,7 +584,6 @@ mkconf(sysname)
        fl->f_type = SYSTEMSPEC;
        fl->f_needs = sysname;
        fl->f_rootdev = NODEV;
        fl->f_type = SYSTEMSPEC;
        fl->f_needs = sysname;
        fl->f_rootdev = NODEV;
-       fl->f_argdev = NODEV;
        fl->f_dumpdev = NODEV;
        fl->f_fn = 0;
        fl->f_next = 0;
        fl->f_dumpdev = NODEV;
        fl->f_fn = 0;
        fl->f_next = 0;
@@ -711,6 +747,13 @@ init_dev(dp)
        dp->d_vec = 0;
        dp->d_addr = dp->d_pri = dp->d_flags = dp->d_dk = 0;
        dp->d_slave = dp->d_drive = dp->d_unit = UNKNOWN;
        dp->d_vec = 0;
        dp->d_addr = dp->d_pri = dp->d_flags = dp->d_dk = 0;
        dp->d_slave = dp->d_drive = dp->d_unit = UNKNOWN;
+       dp->d_port = (char *)0;
+       dp->d_portn = 0;
+       dp->d_irq = -1;
+       dp->d_drq = -1;
+       dp->d_maddr = 0;
+       dp->d_msize = 0;
+       dp->d_mask = "null";
 }
 
 /*
 }
 
 /*
@@ -740,6 +783,11 @@ check_nexus(dev, num)
                if (num != QUES)
                        dev->d_addr = num;
                break;
                if (num != QUES)
                        dev->d_addr = num;
                break;
+
+       case MACHINE_I386:
+               if (!eq(dev->d_name, "isa"))
+                       yyerror("only isa's should be connected to the nexus");
+               break;
        }
 }
 
        }
 }
 
@@ -749,7 +797,7 @@ check_nexus(dev, num)
 
 check_tz()
 {
 
 check_tz()
 {
-       if (abs(timezone) > 12 * 60)
+       if (abs(zone) > 12 * 60)
                yyerror("timezone is unreasonable");
        else
                hadtz = 1;
                yyerror("timezone is unreasonable");
        else
                hadtz = 1;
@@ -804,33 +852,24 @@ checksystemspec(fl)
        if (generic) {
                if (fl->f_rootdev != NODEV)
                        yyerror("root device specified with generic swap");
        if (generic) {
                if (fl->f_rootdev != NODEV)
                        yyerror("root device specified with generic swap");
-               if (fl->f_argdev != NODEV)
-                       yyerror("arg device specified with generic swap");
                if (fl->f_dumpdev != NODEV)
                        yyerror("dump device specified with generic swap");
                return;
        }
                if (fl->f_dumpdev != NODEV)
                        yyerror("dump device specified with generic swap");
                return;
        }
-       /*
-        * Default argument device and check for oddball arrangements.
-        */
-       if (fl->f_argdev == NODEV)
-               fl->f_argdev = swap->f_swapdev;
-       if (fl->f_argdev != swap->f_swapdev)
-               yyerror("Warning, arg device different than primary swap");
        /*
         * Default dump device and warn if place is not a
        /*
         * Default dump device and warn if place is not a
-        * swap area or the argument device partition.
+        * swap area.
         */
        if (fl->f_dumpdev == NODEV)
                fl->f_dumpdev = swap->f_swapdev;
         */
        if (fl->f_dumpdev == NODEV)
                fl->f_dumpdev = swap->f_swapdev;
-       if (fl->f_dumpdev != swap->f_swapdev && fl->f_dumpdev != fl->f_argdev) {
+       if (fl->f_dumpdev != swap->f_swapdev) {
                struct file_list *p = swap->f_next;
 
                for (; p && p->f_type == SWAPSPEC; p = p->f_next)
                        if (fl->f_dumpdev == p->f_swapdev)
                                return;
                struct file_list *p = swap->f_next;
 
                for (; p && p->f_type == SWAPSPEC; p = p->f_next)
                        if (fl->f_dumpdev == p->f_swapdev)
                                return;
-               (void) sprintf(buf, "Warning, orphaned dump device, %s",
-                       "do you know what you're doing");
+               (void) sprintf(buf,
+                   "Warning: dump device is not a swap partition");
                yyerror(buf);
        }
 }
                yyerror(buf);
        }
 }
@@ -859,11 +898,6 @@ verifysystemspecs()
                                deverror(fl->f_needs, "dump");
                        *pchecked++ = fl->f_dumpdev;
                }
                                deverror(fl->f_needs, "dump");
                        *pchecked++ = fl->f_dumpdev;
                }
-               if (!alreadychecked(fl->f_argdev, checked, pchecked)) {
-                       if (!finddev(fl->f_argdev))
-                               deverror(fl->f_needs, "arg");
-                       *pchecked++ = fl->f_argdev;
-               }
        }
 }
 
        }
 }