|
|
1.1 ! root 1: ! 2: # line 1 "config.y" ! 3: typedef union { ! 4: char *str; ! 5: int val; ! 6: struct file_list *file; ! 7: struct idlst *lst; ! 8: } YYSTYPE; ! 9: # define AND 257 ! 10: # define ANY 258 ! 11: # define ARGS 259 ! 12: # define AT 260 ! 13: # define COMMA 261 ! 14: # define CONFIG 262 ! 15: # define CONTROLLER 263 ! 16: # define CPU 264 ! 17: # define CSR 265 ! 18: # define DEVICE 266 ! 19: # define DISK 267 ! 20: # define DRIVE 268 ! 21: # define DST 269 ! 22: # define DUMPS 270 ! 23: # define EQUALS 271 ! 24: # define FLAGS 272 ! 25: # define HZ 273 ! 26: # define IDENT 274 ! 27: # define MACHINE 275 ! 28: # define MAJOR 276 ! 29: # define MASTER 277 ! 30: # define MAXUSERS 278 ! 31: # define MBA 279 ! 32: # define MINOR 280 ! 33: # define MINUS 281 ! 34: # define NEXUS 282 ! 35: # define ON 283 ! 36: # define OPTIONS 284 ! 37: # define PRIORITY 285 ! 38: # define PSEUDO_DEVICE 286 ! 39: # define ROOT 287 ! 40: # define SEMICOLON 288 ! 41: # define SIZE 289 ! 42: # define SLAVE 290 ! 43: # define SWAP 291 ! 44: # define TIMEZONE 292 ! 45: # define TRACE 293 ! 46: # define UBA 294 ! 47: # define VBA 295 ! 48: # define VECTOR 296 ! 49: # define ID 297 ! 50: # define NUMBER 298 ! 51: # define FPNUMBER 299 ! 52: ! 53: # line 66 "config.y" ! 54: ! 55: /* config.y 1.18 83/05/18 */ ! 56: ! 57: #include "config.h" ! 58: #include <ctype.h> ! 59: #include <stdio.h> ! 60: ! 61: struct device cur; ! 62: struct device *curp = 0; ! 63: char *temp_id; ! 64: char *val_id; ! 65: char *malloc(); ! 66: ! 67: #define yyclearin yychar = -1 ! 68: #define yyerrok yyerrflag = 0 ! 69: extern int yychar; ! 70: extern short yyerrflag; ! 71: #ifndef YYMAXDEPTH ! 72: #define YYMAXDEPTH 150 ! 73: #endif ! 74: YYSTYPE yylval, yyval; ! 75: # define YYERRCODE 256 ! 76: ! 77: # line 460 "config.y" ! 78: ! 79: ! 80: yyerror(s) ! 81: char *s; ! 82: { ! 83: ! 84: fprintf(stderr, "config: line %d: %s\n", yyline, s); ! 85: } ! 86: ! 87: /* ! 88: * return the passed string in a new space ! 89: */ ! 90: char * ! 91: ns(str) ! 92: register char *str; ! 93: { ! 94: register char *cp; ! 95: ! 96: cp = malloc((unsigned)(strlen(str)+1)); ! 97: (void) strcpy(cp, str); ! 98: return (cp); ! 99: } ! 100: ! 101: /* ! 102: * add a device to the list of devices ! 103: */ ! 104: newdev(dp) ! 105: register struct device *dp; ! 106: { ! 107: register struct device *np; ! 108: ! 109: np = (struct device *) malloc(sizeof *np); ! 110: *np = *dp; ! 111: if (curp == 0) ! 112: dtab = np; ! 113: else ! 114: curp->d_next = np; ! 115: curp = np; ! 116: } ! 117: ! 118: /* ! 119: * note that a configuration should be made ! 120: */ ! 121: mkconf(sysname) ! 122: char *sysname; ! 123: { ! 124: register struct file_list *fl, **flp; ! 125: ! 126: fl = (struct file_list *) malloc(sizeof *fl); ! 127: fl->f_type = SYSTEMSPEC; ! 128: fl->f_needs = sysname; ! 129: fl->f_rootdev = NODEV; ! 130: fl->f_argdev = NODEV; ! 131: fl->f_dumpdev = NODEV; ! 132: fl->f_fn = 0; ! 133: fl->f_next = 0; ! 134: for (flp = confp; *flp; flp = &(*flp)->f_next) ! 135: ; ! 136: *flp = fl; ! 137: confp = flp; ! 138: } ! 139: ! 140: struct file_list * ! 141: newswap() ! 142: { ! 143: struct file_list *fl = (struct file_list *)malloc(sizeof (*fl)); ! 144: ! 145: fl->f_type = SWAPSPEC; ! 146: fl->f_next = 0; ! 147: fl->f_swapdev = NODEV; ! 148: fl->f_swapsize = 0; ! 149: fl->f_needs = 0; ! 150: fl->f_fn = 0; ! 151: return (fl); ! 152: } ! 153: ! 154: /* ! 155: * Add a swap device to the system's configuration ! 156: */ ! 157: mkswap(system, fl, size) ! 158: struct file_list *system, *fl; ! 159: int size; ! 160: { ! 161: register struct file_list **flp; ! 162: char *cp, name[80]; ! 163: ! 164: if (system == 0 || system->f_type != SYSTEMSPEC) { ! 165: yyerror("\"swap\" spec precedes \"config\" specification"); ! 166: return; ! 167: } ! 168: if (size < 0) { ! 169: yyerror("illegal swap partition size"); ! 170: return; ! 171: } ! 172: /* ! 173: * Append swap description to the end of the list. ! 174: */ ! 175: flp = &system->f_next; ! 176: for (; *flp && (*flp)->f_type == SWAPSPEC; flp = &(*flp)->f_next) ! 177: ; ! 178: fl->f_next = *flp; ! 179: *flp = fl; ! 180: /* ! 181: * If first swap device for this system, ! 182: * set up f_fn field to insure swap ! 183: * files are created with unique names. ! 184: */ ! 185: if (system->f_fn) ! 186: return; ! 187: if (eq(fl->f_fn, "generic")) ! 188: system->f_fn = ns(fl->f_fn); ! 189: else ! 190: system->f_fn = ns(system->f_needs); ! 191: } ! 192: ! 193: /* ! 194: * find the pointer to connect to the given device and number. ! 195: * returns 0 if no such device and prints an error message ! 196: */ ! 197: struct device * ! 198: connect(dev, num) ! 199: register char *dev; ! 200: register int num; ! 201: { ! 202: register struct device *dp; ! 203: struct device *huhcon(); ! 204: ! 205: if (num == QUES) ! 206: return (huhcon(dev)); ! 207: for (dp = dtab; dp != 0; dp = dp->d_next) { ! 208: if ((num != dp->d_unit) || !eq(dev, dp->d_name)) ! 209: continue; ! 210: if (dp->d_type != CONTROLLER && dp->d_type != MASTER) { ! 211: yyerror(sprintf(errbuf, ! 212: "%s connected to non-controller", dev)); ! 213: return (0); ! 214: } ! 215: return (dp); ! 216: } ! 217: yyerror(sprintf(errbuf, "%s %d not defined", dev, num)); ! 218: return (0); ! 219: } ! 220: ! 221: /* ! 222: * connect to an unspecific thing ! 223: */ ! 224: struct device * ! 225: huhcon(dev) ! 226: register char *dev; ! 227: { ! 228: register struct device *dp, *dcp; ! 229: struct device rdev; ! 230: int oldtype; ! 231: ! 232: /* ! 233: * First make certain that there are some of these to wildcard on ! 234: */ ! 235: for (dp = dtab; dp != 0; dp = dp->d_next) ! 236: if (eq(dp->d_name, dev)) ! 237: break; ! 238: if (dp == 0) { ! 239: yyerror(sprintf(errbuf, "no %s's to wildcard", dev)); ! 240: return (0); ! 241: } ! 242: oldtype = dp->d_type; ! 243: dcp = dp->d_conn; ! 244: /* ! 245: * Now see if there is already a wildcard entry for this device ! 246: * (e.g. Search for a "uba ?") ! 247: */ ! 248: for (; dp != 0; dp = dp->d_next) ! 249: if (eq(dev, dp->d_name) && dp->d_unit == -1) ! 250: break; ! 251: /* ! 252: * If there isn't, make one because everything needs to be connected ! 253: * to something. ! 254: */ ! 255: if (dp == 0) { ! 256: dp = &rdev; ! 257: init_dev(dp); ! 258: dp->d_unit = QUES; ! 259: dp->d_name = ns(dev); ! 260: dp->d_type = oldtype; ! 261: newdev(dp); ! 262: dp = curp; ! 263: /* ! 264: * Connect it to the same thing that other similar things are ! 265: * connected to, but make sure it is a wildcard unit ! 266: * (e.g. up connected to sc ?, here we make connect sc? to a ! 267: * uba?). If other things like this are on the NEXUS or ! 268: * if they aren't connected to anything, then make the same ! 269: * connection, else call ourself to connect to another ! 270: * unspecific device. ! 271: */ ! 272: if (dcp == TO_NEXUS || dcp == 0) ! 273: dp->d_conn = dcp; ! 274: else ! 275: dp->d_conn = connect(dcp->d_name, QUES); ! 276: } ! 277: return (dp); ! 278: } ! 279: ! 280: init_dev(dp) ! 281: register struct device *dp; ! 282: { ! 283: ! 284: dp->d_name = "OHNO!!!"; ! 285: dp->d_type = DEVICE; ! 286: dp->d_conn = 0; ! 287: dp->d_vec = 0; ! 288: dp->d_addr = dp->d_pri = dp->d_flags = dp->d_dk = 0; ! 289: dp->d_slave = dp->d_drive = dp->d_unit = UNKNOWN; ! 290: } ! 291: ! 292: /* ! 293: * make certain that this is a reasonable type of thing to connect to a nexus ! 294: */ ! 295: check_nexus(dev, num) ! 296: register struct device *dev; ! 297: int num; ! 298: { ! 299: ! 300: switch (machine) { ! 301: ! 302: case MACHINE_VAX: ! 303: if (!eq(dev->d_name, "uba") && !eq(dev->d_name, "mba")) ! 304: yyerror("only uba's and mba's should be connected to the nexus"); ! 305: if (num != QUES) ! 306: yyerror("can't give specific nexus numbers"); ! 307: break; ! 308: ! 309: case MACHINE_TAHOE: ! 310: if (!eq(dev->d_name, "vba")) ! 311: yyerror("only vba's should be connected to the nexus"); ! 312: break; ! 313: ! 314: case MACHINE_SUN: ! 315: if (!eq(dev->d_name, "mb")) ! 316: yyerror("only mb's should be connected to the nexus"); ! 317: break; ! 318: } ! 319: } ! 320: ! 321: /* ! 322: * Check the timezone to make certain it is sensible ! 323: */ ! 324: ! 325: check_tz() ! 326: { ! 327: if (abs(timezone) > 12 * 60) ! 328: yyerror("timezone is unreasonable"); ! 329: else ! 330: hadtz = 1; ! 331: } ! 332: ! 333: /* ! 334: * Check system specification and apply defaulting ! 335: * rules on root, argument, dump, and swap devices. ! 336: */ ! 337: checksystemspec(fl) ! 338: register struct file_list *fl; ! 339: { ! 340: char buf[BUFSIZ]; ! 341: register struct file_list *swap; ! 342: int generic; ! 343: ! 344: if (fl == 0 || fl->f_type != SYSTEMSPEC) { ! 345: yyerror("internal error, bad system specification"); ! 346: exit(1); ! 347: } ! 348: swap = fl->f_next; ! 349: generic = swap && swap->f_type == SWAPSPEC && eq(swap->f_fn, "generic"); ! 350: if (fl->f_rootdev == NODEV && !generic) { ! 351: yyerror("no root device specified"); ! 352: exit(1); ! 353: } ! 354: /* ! 355: * Default swap area to be in 'b' partition of root's ! 356: * device. If root specified to be other than on 'a' ! 357: * partition, give warning, something probably amiss. ! 358: */ ! 359: if (swap == 0 || swap->f_type != SWAPSPEC) { ! 360: dev_t dev; ! 361: ! 362: swap = newswap(); ! 363: dev = fl->f_rootdev; ! 364: if (minor(dev) & 07) { ! 365: sprintf(buf, ! 366: "Warning, swap defaulted to 'b' partition with root on '%c' partition", ! 367: (minor(dev) & 07) + 'a'); ! 368: yyerror(buf); ! 369: } ! 370: swap->f_swapdev = ! 371: makedev(major(dev), (minor(dev) &~ 07) | ('b' - 'a')); ! 372: swap->f_fn = devtoname(swap->f_swapdev); ! 373: mkswap(fl, swap, 0); ! 374: } ! 375: /* ! 376: * Make sure a generic swap isn't specified, along with ! 377: * other stuff (user must really be confused). ! 378: */ ! 379: if (generic) { ! 380: if (fl->f_rootdev != NODEV) ! 381: yyerror("root device specified with generic swap"); ! 382: if (fl->f_argdev != NODEV) ! 383: yyerror("arg device specified with generic swap"); ! 384: if (fl->f_dumpdev != NODEV) ! 385: yyerror("dump device specified with generic swap"); ! 386: return; ! 387: } ! 388: /* ! 389: * Default argument device and check for oddball arrangements. ! 390: */ ! 391: if (fl->f_argdev == NODEV) ! 392: fl->f_argdev = swap->f_swapdev; ! 393: if (fl->f_argdev != swap->f_swapdev) ! 394: yyerror("Warning, arg device different than primary swap"); ! 395: /* ! 396: * Default dump device and warn if place is not a ! 397: * swap area or the argument device partition. ! 398: */ ! 399: if (fl->f_dumpdev == NODEV) ! 400: fl->f_dumpdev = swap->f_swapdev; ! 401: if (fl->f_dumpdev != swap->f_swapdev && fl->f_dumpdev != fl->f_argdev) { ! 402: struct file_list *p = swap->f_next; ! 403: ! 404: for (; p && p->f_type == SWAPSPEC; p = p->f_next) ! 405: if (fl->f_dumpdev == p->f_swapdev) ! 406: return; ! 407: sprintf(buf, "Warning, orphaned dump device, %s", ! 408: "do you know what you're doing"); ! 409: yyerror(buf); ! 410: } ! 411: } ! 412: ! 413: /* ! 414: * Verify all devices specified in the system specification ! 415: * are present in the device specifications. ! 416: */ ! 417: verifysystemspecs() ! 418: { ! 419: register struct file_list *fl; ! 420: dev_t checked[50], *verifyswap(); ! 421: register dev_t *pchecked = checked; ! 422: ! 423: for (fl = conf_list; fl; fl = fl->f_next) { ! 424: if (fl->f_type != SYSTEMSPEC) ! 425: continue; ! 426: if (!finddev(fl->f_rootdev)) ! 427: deverror(fl->f_needs, "root"); ! 428: *pchecked++ = fl->f_rootdev; ! 429: pchecked = verifyswap(fl->f_next, checked, pchecked); ! 430: #define samedev(dev1, dev2) \ ! 431: ((minor(dev1) &~ 07) != (minor(dev2) &~ 07)) ! 432: if (!alreadychecked(fl->f_dumpdev, checked, pchecked)) { ! 433: if (!finddev(fl->f_dumpdev)) ! 434: deverror(fl->f_needs, "dump"); ! 435: *pchecked++ = fl->f_dumpdev; ! 436: } ! 437: if (!alreadychecked(fl->f_argdev, checked, pchecked)) { ! 438: if (!finddev(fl->f_argdev)) ! 439: deverror(fl->f_needs, "arg"); ! 440: *pchecked++ = fl->f_argdev; ! 441: } ! 442: } ! 443: } ! 444: ! 445: /* ! 446: * Do as above, but for swap devices. ! 447: */ ! 448: dev_t * ! 449: verifyswap(fl, checked, pchecked) ! 450: register struct file_list *fl; ! 451: dev_t checked[]; ! 452: register dev_t *pchecked; ! 453: { ! 454: ! 455: for (;fl && fl->f_type == SWAPSPEC; fl = fl->f_next) { ! 456: if (eq(fl->f_fn, "generic")) ! 457: continue; ! 458: if (alreadychecked(fl->f_swapdev, checked, pchecked)) ! 459: continue; ! 460: if (!finddev(fl->f_swapdev)) ! 461: fprintf(stderr, ! 462: "config: swap device %s not configured", fl->f_fn); ! 463: *pchecked++ = fl->f_swapdev; ! 464: } ! 465: return (pchecked); ! 466: } ! 467: ! 468: /* ! 469: * Has a device already been checked ! 470: * for it's existence in the configuration? ! 471: */ ! 472: alreadychecked(dev, list, last) ! 473: dev_t dev, list[]; ! 474: register dev_t *last; ! 475: { ! 476: register dev_t *p; ! 477: ! 478: for (p = list; p < last; p++) ! 479: if (samedev(*p, dev)) ! 480: return (1); ! 481: return (0); ! 482: } ! 483: ! 484: deverror(systemname, devtype) ! 485: char *systemname, *devtype; ! 486: { ! 487: ! 488: fprintf(stderr, "config: %s: %s device not configured\n", ! 489: systemname, devtype); ! 490: } ! 491: ! 492: /* ! 493: * Look for the device in the list of ! 494: * configured hardware devices. Must ! 495: * take into account stuff wildcarded. ! 496: */ ! 497: finddev(dev) ! 498: dev_t dev; ! 499: { ! 500: ! 501: /* punt on this right now */ ! 502: return (1); ! 503: } ! 504: short yyexca[] ={ ! 505: -1, 1, ! 506: 0, -1, ! 507: -2, 0, ! 508: }; ! 509: # define YYNPROD 93 ! 510: # define YYLAST 208 ! 511: short yyact[]={ ! 512: ! 513: 8, 73, 74, 94, 95, 142, 23, 12, 15, 63, ! 514: 9, 11, 86, 139, 106, 137, 44, 19, 17, 14, ! 515: 136, 10, 21, 135, 61, 62, 63, 64, 16, 134, ! 516: 13, 132, 7, 42, 43, 35, 20, 6, 131, 127, ! 517: 126, 61, 62, 125, 64, 83, 124, 118, 97, 96, ! 518: 91, 87, 45, 41, 140, 35, 82, 55, 40, 120, ! 519: 130, 27, 121, 26, 25, 24, 123, 77, 54, 141, ! 520: 70, 99, 98, 72, 71, 69, 59, 128, 101, 105, ! 521: 116, 38, 60, 76, 122, 53, 104, 81, 47, 52, ! 522: 103, 57, 119, 28, 34, 36, 39, 29, 84, 58, ! 523: 100, 51, 50, 56, 30, 31, 32, 49, 48, 46, ! 524: 22, 33, 18, 37, 5, 4, 68, 3, 2, 1, ! 525: 102, 110, 65, 66, 67, 107, 113, 129, 93, 0, ! 526: 0, 0, 0, 0, 0, 75, 0, 78, 79, 80, ! 527: 0, 0, 85, 0, 0, 0, 0, 0, 0, 39, ! 528: 0, 92, 0, 88, 89, 90, 0, 0, 0, 0, ! 529: 0, 0, 117, 0, 0, 109, 112, 115, 0, 108, ! 530: 111, 114, 0, 0, 0, 0, 0, 0, 0, 0, ! 531: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 532: 0, 0, 0, 0, 0, 0, 0, 117, 133, 0, ! 533: 0, 0, 0, 0, 0, 0, 0, 138 }; ! 534: short yypact[]={ ! 535: ! 536: -1000,-1000,-256,-1000,-223,-224,-225,-1000,-227,-1000, ! 537: -1000,-1000,-1000,-1000,-242,-242,-242,-239,-1000,-245, ! 538: -265,-246,-202,-242,-1000,-1000,-1000,-1000,-184,-253, ! 539: -184,-184,-184,-253,-1000,-1000,-1000,-186,-1000,-201, ! 540: -1000,-1000,-195,-196,-297,-1000,-202,-1000,-1000,-1000, ! 541: -1000,-1000,-216,-216,-216,-216,-1000,-240,-1000,-270, ! 542: -247,-1000,-1000,-1000,-1000,-240,-240,-240,-248,-242, ! 543: -294,-249,-250,-197,-198,-1000,-262,-1000,-262,-262, ! 544: -262,-1000,-242,-251,-206,-252,-255,-1000,-1000,-1000, ! 545: -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-258,-259, ! 546: -180,-1000,-229,-1000,-1000,-260,-267,-1000,-1000,-1000, ! 547: -1000,-1000,-1000,-1000,-1000,-1000,-1000,-242,-1000,-1000, ! 548: -269,-275,-278,-283,-1000,-1000,-1000,-1000,-262,-1000, ! 549: -285,-243,-211,-1000,-1000,-1000,-1000,-1000,-1000,-1000, ! 550: -1000,-293,-1000 }; ! 551: short yypgo[]={ ! 552: ! 553: 0, 79, 128, 82, 80, 127, 90, 86, 126, 125, ! 554: 121, 120, 119, 118, 117, 115, 114, 113, 112, 110, ! 555: 109, 88, 108, 107, 102, 101, 83, 100, 78, 81, ! 556: 93, 91, 87, 97, 99, 98, 92 }; ! 557: short yyr1[]={ ! 558: ! 559: 0, 12, 13, 13, 14, 14, 14, 14, 14, 16, ! 560: 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, ! 561: 16, 16, 16, 16, 16, 16, 16, 16, 18, 19, ! 562: 20, 20, 21, 21, 21, 21, 22, 27, 27, 28, ! 563: 11, 11, 23, 9, 9, 24, 10, 10, 25, 8, ! 564: 8, 7, 26, 26, 5, 5, 6, 6, 6, 17, ! 565: 17, 29, 29, 2, 2, 1, 3, 3, 3, 3, ! 566: 15, 15, 15, 15, 15, 15, 30, 33, 31, 31, ! 567: 34, 34, 35, 35, 36, 36, 36, 36, 32, 32, ! 568: 32, 4, 4 }; ! 569: short yyr2[]={ ! 570: ! 571: 0, 1, 2, 0, 2, 2, 2, 1, 2, 2, ! 572: 2, 2, 2, 1, 2, 2, 4, 3, 2, 4, ! 573: 3, 3, 5, 4, 3, 5, 4, 2, 2, 2, ! 574: 2, 1, 1, 1, 1, 1, 3, 3, 1, 2, ! 575: 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, ! 576: 1, 4, 1, 0, 2, 0, 1, 2, 3, 3, ! 577: 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, ! 578: 4, 4, 4, 4, 3, 4, 3, 0, 2, 0, ! 579: 3, 3, 2, 0, 2, 2, 2, 2, 2, 2, ! 580: 0, 1, 2 }; ! 581: short yychk[]={ ! 582: ! 583: -1000, -12, -13, -14, -15, -16, 293, 288, 256, 266, ! 584: 277, 267, 263, 286, 275, 264, 284, 274, -18, 273, ! 585: 292, 278, -19, 262, 288, 288, 288, 288, -30, -33, ! 586: -30, -30, -30, -33, -1, 297, -1, -17, -29, -1, ! 587: 297, 298, 298, 299, 281, 298, -20, -21, -22, -23, ! 588: -24, -25, 291, 287, 270, 259, -1, -31, -34, 260, ! 589: -3, 294, 295, 279, 297, -31, -31, -31, -3, 261, ! 590: 271, 269, 269, 298, 299, -21, -26, 283, -26, -26, ! 591: -26, -32, 296, 285, -35, -3, 282, 298, -32, -32, ! 592: -32, 298, -29, -2, 297, 298, 298, 298, 269, 269, ! 593: -27, -28, -11, -6, -7, -1, 276, -9, -6, -7, ! 594: -10, -6, -7, -8, -6, -7, -4, -1, 298, -36, ! 595: 265, 268, 290, 272, 298, 298, 298, 298, 257, -5, ! 596: 289, 298, 298, -4, 298, 298, 298, 298, -28, 298, ! 597: 297, 280, 298 }; ! 598: short yydef[]={ ! 599: ! 600: 3, -2, 1, 2, 0, 0, 0, 7, 0, 77, ! 601: 77, 77, 77, 77, 0, 0, 0, 0, 13, 0, ! 602: 0, 0, 0, 0, 4, 5, 6, 8, 79, 0, ! 603: 79, 79, 79, 0, 9, 65, 10, 11, 60, 61, ! 604: 12, 14, 15, 18, 0, 27, 28, 31, 32, 33, ! 605: 34, 35, 53, 53, 53, 53, 29, 90, 83, 0, ! 606: 0, 66, 67, 68, 69, 90, 90, 90, 74, 0, ! 607: 0, 17, 20, 21, 24, 30, 0, 52, 0, 0, ! 608: 0, 70, 0, 0, 78, 0, 0, 76, 71, 72, ! 609: 73, 75, 59, 62, 63, 64, 16, 19, 23, 26, ! 610: 36, 38, 55, 40, 41, 56, 0, 42, 43, 44, ! 611: 45, 46, 47, 48, 49, 50, 88, 91, 89, 82, ! 612: 0, 0, 0, 0, 80, 81, 22, 25, 0, 39, ! 613: 0, 57, 0, 92, 84, 85, 86, 87, 37, 54, ! 614: 58, 0, 51 }; ! 615: #ifndef lint ! 616: static char yaccpar_sccsid[] = "@(#)yaccpar 4.1 (Berkeley) 2/11/83"; ! 617: #endif not lint ! 618: ! 619: # ! 620: # define YYFLAG -1000 ! 621: # define YYERROR goto yyerrlab ! 622: # define YYACCEPT return(0) ! 623: # define YYABORT return(1) ! 624: ! 625: /* parser for yacc output */ ! 626: ! 627: #ifdef YYDEBUG ! 628: int yydebug = 0; /* 1 for debugging */ ! 629: #endif ! 630: YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */ ! 631: int yychar = -1; /* current input token number */ ! 632: int yynerrs = 0; /* number of errors */ ! 633: short yyerrflag = 0; /* error recovery flag */ ! 634: ! 635: yyparse() { ! 636: ! 637: short yys[YYMAXDEPTH]; ! 638: short yyj, yym; ! 639: register YYSTYPE *yypvt; ! 640: register short yystate, *yyps, yyn; ! 641: register YYSTYPE *yypv; ! 642: register short *yyxi; ! 643: ! 644: yystate = 0; ! 645: yychar = -1; ! 646: yynerrs = 0; ! 647: yyerrflag = 0; ! 648: yyps= &yys[-1]; ! 649: yypv= &yyv[-1]; ! 650: ! 651: yystack: /* put a state and value onto the stack */ ! 652: ! 653: #ifdef YYDEBUG ! 654: if( yydebug ) printf( "state %d, char 0%o\n", yystate, yychar ); ! 655: #endif ! 656: if( ++yyps> &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); } ! 657: *yyps = yystate; ! 658: ++yypv; ! 659: *yypv = yyval; ! 660: ! 661: yynewstate: ! 662: ! 663: yyn = yypact[yystate]; ! 664: ! 665: if( yyn<= YYFLAG ) goto yydefault; /* simple state */ ! 666: ! 667: if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0; ! 668: if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault; ! 669: ! 670: if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */ ! 671: yychar = -1; ! 672: yyval = yylval; ! 673: yystate = yyn; ! 674: if( yyerrflag > 0 ) --yyerrflag; ! 675: goto yystack; ! 676: } ! 677: ! 678: yydefault: ! 679: /* default state action */ ! 680: ! 681: if( (yyn=yydef[yystate]) == -2 ) { ! 682: if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0; ! 683: /* look through exception table */ ! 684: ! 685: for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */ ! 686: ! 687: while( *(yyxi+=2) >= 0 ){ ! 688: if( *yyxi == yychar ) break; ! 689: } ! 690: if( (yyn = yyxi[1]) < 0 ) return(0); /* accept */ ! 691: } ! 692: ! 693: if( yyn == 0 ){ /* error */ ! 694: /* error ... attempt to resume parsing */ ! 695: ! 696: switch( yyerrflag ){ ! 697: ! 698: case 0: /* brand new error */ ! 699: ! 700: yyerror( "syntax error" ); ! 701: yyerrlab: ! 702: ++yynerrs; ! 703: ! 704: case 1: ! 705: case 2: /* incompletely recovered error ... try again */ ! 706: ! 707: yyerrflag = 3; ! 708: ! 709: /* find a state where "error" is a legal shift action */ ! 710: ! 711: while ( yyps >= yys ) { ! 712: yyn = yypact[*yyps] + YYERRCODE; ! 713: if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){ ! 714: yystate = yyact[yyn]; /* simulate a shift of "error" */ ! 715: goto yystack; ! 716: } ! 717: yyn = yypact[*yyps]; ! 718: ! 719: /* the current yyps has no shift onn "error", pop stack */ ! 720: ! 721: #ifdef YYDEBUG ! 722: if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] ); ! 723: #endif ! 724: --yyps; ! 725: --yypv; ! 726: } ! 727: ! 728: /* there is no state on the stack with an error shift ... abort */ ! 729: ! 730: yyabort: ! 731: return(1); ! 732: ! 733: ! 734: case 3: /* no shift yet; clobber input char */ ! 735: ! 736: #ifdef YYDEBUG ! 737: if( yydebug ) printf( "error recovery discards char %d\n", yychar ); ! 738: #endif ! 739: ! 740: if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */ ! 741: yychar = -1; ! 742: goto yynewstate; /* try again in the same state */ ! 743: ! 744: } ! 745: ! 746: } ! 747: ! 748: /* reduction by production yyn */ ! 749: ! 750: #ifdef YYDEBUG ! 751: if( yydebug ) printf("reduce %d\n",yyn); ! 752: #endif ! 753: yyps -= yyr2[yyn]; ! 754: yypvt = yypv; ! 755: yypv -= yyr2[yyn]; ! 756: yyval = yypv[1]; ! 757: yym=yyn; ! 758: /* consult goto table to find next state */ ! 759: yyn = yyr1[yyn]; ! 760: yyj = yypgo[yyn] + *yyps + 1; ! 761: if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]]; ! 762: switch(yym){ ! 763: ! 764: case 1: ! 765: # line 83 "config.y" ! 766: { verifysystemspecs(); } break; ! 767: case 4: ! 768: # line 94 "config.y" ! 769: { newdev(&cur); } break; ! 770: case 6: ! 771: # line 98 "config.y" ! 772: { do_trace = !do_trace; } break; ! 773: case 9: ! 774: # line 106 "config.y" ! 775: { ! 776: if (!strcmp(yypvt[-0].str, "vax")) { ! 777: machine = MACHINE_VAX; ! 778: machinename = "vax"; ! 779: } else if (!strcmp(yypvt[-0].str, "sun")) { ! 780: machine = MACHINE_SUN; ! 781: machinename = "sun"; ! 782: } else if (!strcmp(yypvt[-0].str, "tahoe")) { ! 783: machine = MACHINE_TAHOE; ! 784: machinename = "tahoe"; ! 785: } else ! 786: yyerror("Unknown machine type"); ! 787: } break; ! 788: case 10: ! 789: # line 120 "config.y" ! 790: { ! 791: struct cputype *cp = ! 792: (struct cputype *)malloc(sizeof (struct cputype)); ! 793: cp->cpu_name = ns(yypvt[-0].str); ! 794: cp->cpu_next = cputype; ! 795: cputype = cp; ! 796: free(temp_id); ! 797: } break; ! 798: case 12: ! 799: # line 131 "config.y" ! 800: { ident = ns(yypvt[-0].str); } break; ! 801: case 14: ! 802: # line 135 "config.y" ! 803: { hz = yypvt[-0].val; } break; ! 804: case 15: ! 805: # line 137 "config.y" ! 806: { timezone = 60 * yypvt[-0].val; check_tz(); } break; ! 807: case 16: ! 808: # line 139 "config.y" ! 809: { timezone = 60 * yypvt[-2].val; dst = yypvt[-0].val; check_tz(); } break; ! 810: case 17: ! 811: # line 141 "config.y" ! 812: { timezone = 60 * yypvt[-1].val; dst = 1; check_tz(); } break; ! 813: case 18: ! 814: # line 143 "config.y" ! 815: { timezone = yypvt[-0].val; check_tz(); } break; ! 816: case 19: ! 817: # line 145 "config.y" ! 818: { timezone = yypvt[-2].val; dst = yypvt[-0].val; check_tz(); } break; ! 819: case 20: ! 820: # line 147 "config.y" ! 821: { timezone = yypvt[-1].val; dst = 1; check_tz(); } break; ! 822: case 21: ! 823: # line 149 "config.y" ! 824: { timezone = -60 * yypvt[-0].val; check_tz(); } break; ! 825: case 22: ! 826: # line 151 "config.y" ! 827: { timezone = -60 * yypvt[-2].val; dst = yypvt[-0].val; check_tz(); } break; ! 828: case 23: ! 829: # line 153 "config.y" ! 830: { timezone = -60 * yypvt[-1].val; dst = 1; check_tz(); } break; ! 831: case 24: ! 832: # line 155 "config.y" ! 833: { timezone = -yypvt[-0].val; check_tz(); } break; ! 834: case 25: ! 835: # line 157 "config.y" ! 836: { timezone = -yypvt[-2].val; dst = yypvt[-0].val; check_tz(); } break; ! 837: case 26: ! 838: # line 159 "config.y" ! 839: { timezone = -yypvt[-1].val; dst = 1; check_tz(); } break; ! 840: case 27: ! 841: # line 161 "config.y" ! 842: { maxusers = yypvt[-0].val; } break; ! 843: case 28: ! 844: # line 165 "config.y" ! 845: { checksystemspec(*confp); } break; ! 846: case 29: ! 847: # line 170 "config.y" ! 848: { mkconf(yypvt[-0].str); } break; ! 849: case 39: ! 850: # line 196 "config.y" ! 851: { mkswap(*confp, yypvt[-1].file, yypvt[-0].val); } break; ! 852: case 40: ! 853: # line 201 "config.y" ! 854: { ! 855: struct file_list *fl = newswap(); ! 856: ! 857: if (eq(yypvt[-0].str, "generic")) ! 858: fl->f_fn = yypvt[-0].str; ! 859: else { ! 860: fl->f_swapdev = nametodev(yypvt[-0].str, 0, 'b'); ! 861: fl->f_fn = devtoname(fl->f_swapdev); ! 862: } ! 863: yyval.file = fl; ! 864: } break; ! 865: case 41: ! 866: # line 213 "config.y" ! 867: { ! 868: struct file_list *fl = newswap(); ! 869: ! 870: fl->f_swapdev = yypvt[-0].val; ! 871: fl->f_fn = devtoname(yypvt[-0].val); ! 872: yyval.file = fl; ! 873: } break; ! 874: case 42: ! 875: # line 224 "config.y" ! 876: { ! 877: struct file_list *fl = *confp; ! 878: ! 879: if (fl && fl->f_rootdev != NODEV) ! 880: yyerror("extraneous root device specification"); ! 881: else ! 882: fl->f_rootdev = yypvt[-0].val; ! 883: } break; ! 884: case 43: ! 885: # line 236 "config.y" ! 886: { yyval.val = nametodev(yypvt[-0].str, 0, 'a'); } break; ! 887: case 45: ! 888: # line 242 "config.y" ! 889: { ! 890: struct file_list *fl = *confp; ! 891: ! 892: if (fl && fl->f_dumpdev != NODEV) ! 893: yyerror("extraneous dump device specification"); ! 894: else ! 895: fl->f_dumpdev = yypvt[-0].val; ! 896: } break; ! 897: case 46: ! 898: # line 255 "config.y" ! 899: { yyval.val = nametodev(yypvt[-0].str, 0, 'b'); } break; ! 900: case 48: ! 901: # line 261 "config.y" ! 902: { ! 903: struct file_list *fl = *confp; ! 904: ! 905: if (fl && fl->f_argdev != NODEV) ! 906: yyerror("extraneous arg device specification"); ! 907: else ! 908: fl->f_argdev = yypvt[-0].val; ! 909: } break; ! 910: case 49: ! 911: # line 273 "config.y" ! 912: { yyval.val = nametodev(yypvt[-0].str, 0, 'b'); } break; ! 913: case 51: ! 914: # line 279 "config.y" ! 915: { yyval.val = makedev(yypvt[-2].val, yypvt[-0].val); } break; ! 916: case 54: ! 917: # line 289 "config.y" ! 918: { yyval.val = yypvt[-0].val; } break; ! 919: case 55: ! 920: # line 291 "config.y" ! 921: { yyval.val = 0; } break; ! 922: case 56: ! 923: # line 296 "config.y" ! 924: { yyval.str = yypvt[-0].str; } break; ! 925: case 57: ! 926: # line 298 "config.y" ! 927: { ! 928: char buf[80]; ! 929: ! 930: (void) sprintf(buf, "%s%d", yypvt[-1].str, yypvt[-0].val); ! 931: yyval.str = ns(buf); free(yypvt[-1].str); ! 932: } break; ! 933: case 58: ! 934: # line 305 "config.y" ! 935: { ! 936: char buf[80]; ! 937: ! 938: (void) sprintf(buf, "%s%d%s", yypvt[-2].str, yypvt[-1].val, yypvt[-0].str); ! 939: yyval.str = ns(buf); free(yypvt[-2].str); ! 940: } break; ! 941: case 61: ! 942: # line 321 "config.y" ! 943: { ! 944: struct opt *op = (struct opt *)malloc(sizeof (struct opt)); ! 945: op->op_name = ns(yypvt[-0].str); ! 946: op->op_next = opt; ! 947: op->op_value = 0; ! 948: opt = op; ! 949: free(temp_id); ! 950: } break; ! 951: case 62: ! 952: # line 330 "config.y" ! 953: { ! 954: struct opt *op = (struct opt *)malloc(sizeof (struct opt)); ! 955: op->op_name = ns(yypvt[-2].str); ! 956: op->op_next = opt; ! 957: op->op_value = ns(yypvt[-0].str); ! 958: opt = op; ! 959: free(temp_id); ! 960: free(val_id); ! 961: } break; ! 962: case 63: ! 963: # line 342 "config.y" ! 964: { yyval.str = val_id = ns(yypvt[-0].str); } break; ! 965: case 64: ! 966: # line 344 "config.y" ! 967: { char nb[16]; yyval.str = val_id = ns(sprintf(nb, "%d", yypvt[-0].val)); } break; ! 968: case 65: ! 969: # line 349 "config.y" ! 970: { yyval.str = temp_id = ns(yypvt[-0].str); } break; ! 971: case 66: ! 972: # line 354 "config.y" ! 973: { yyval.str = ns("uba"); } break; ! 974: case 67: ! 975: # line 356 "config.y" ! 976: { yyval.str = ns("vba"); } break; ! 977: case 68: ! 978: # line 358 "config.y" ! 979: { yyval.str = ns("mba"); } break; ! 980: case 69: ! 981: # line 360 "config.y" ! 982: { yyval.str = ns(yypvt[-0].str); } break; ! 983: case 70: ! 984: # line 365 "config.y" ! 985: { cur.d_type = DEVICE; } break; ! 986: case 71: ! 987: # line 367 "config.y" ! 988: { cur.d_type = MASTER; } break; ! 989: case 72: ! 990: # line 369 "config.y" ! 991: { cur.d_dk = 1; cur.d_type = DEVICE; } break; ! 992: case 73: ! 993: # line 371 "config.y" ! 994: { cur.d_type = CONTROLLER; } break; ! 995: case 74: ! 996: # line 373 "config.y" ! 997: { ! 998: cur.d_name = yypvt[-0].str; ! 999: cur.d_type = PSEUDO_DEVICE; ! 1000: } break; ! 1001: case 75: ! 1002: # line 378 "config.y" ! 1003: { ! 1004: cur.d_name = yypvt[-1].str; ! 1005: cur.d_type = PSEUDO_DEVICE; ! 1006: cur.d_slave = yypvt[-0].val; ! 1007: } break; ! 1008: case 76: ! 1009: # line 386 "config.y" ! 1010: { ! 1011: cur.d_name = yypvt[-1].str; ! 1012: if (eq(yypvt[-1].str, "mba")) ! 1013: seen_mba = 1; ! 1014: else if (eq(yypvt[-1].str, "uba")) ! 1015: seen_uba = 1; ! 1016: else if (eq(yypvt[-1].str, "vba")) ! 1017: seen_vba = 1; ! 1018: cur.d_unit = yypvt[-0].val; ! 1019: } break; ! 1020: case 77: ! 1021: # line 399 "config.y" ! 1022: { init_dev(&cur); } break; ! 1023: case 80: ! 1024: # line 409 "config.y" ! 1025: { ! 1026: if (eq(cur.d_name, "mba") || eq(cur.d_name, "uba")) ! 1027: yyerror(sprintf(errbuf, ! 1028: "%s must be connected to a nexus", cur.d_name)); ! 1029: cur.d_conn = connect(yypvt[-1].str, yypvt[-0].val); ! 1030: } break; ! 1031: case 81: ! 1032: # line 416 "config.y" ! 1033: { check_nexus(&cur, yypvt[-0].val); cur.d_conn = TO_NEXUS; } break; ! 1034: case 84: ! 1035: # line 426 "config.y" ! 1036: { cur.d_addr = yypvt[-0].val; } break; ! 1037: case 85: ! 1038: # line 428 "config.y" ! 1039: { cur.d_drive = yypvt[-0].val; } break; ! 1040: case 86: ! 1041: # line 430 "config.y" ! 1042: { ! 1043: if (cur.d_conn != 0 && cur.d_conn != TO_NEXUS && ! 1044: cur.d_conn->d_type == MASTER) ! 1045: cur.d_slave = yypvt[-0].val; ! 1046: else ! 1047: yyerror("can't specify slave--not to master"); ! 1048: } break; ! 1049: case 87: ! 1050: # line 438 "config.y" ! 1051: { cur.d_flags = yypvt[-0].val; } break; ! 1052: case 88: ! 1053: # line 442 "config.y" ! 1054: { cur.d_vec = yypvt[-0].lst; } break; ! 1055: case 89: ! 1056: # line 444 "config.y" ! 1057: { cur.d_pri = yypvt[-0].val; } break; ! 1058: case 91: ! 1059: # line 450 "config.y" ! 1060: { ! 1061: struct idlst *a = (struct idlst *)malloc(sizeof(struct idlst)); ! 1062: a->id = yypvt[-0].str; a->id_next = 0; yyval.lst = a; ! 1063: } break; ! 1064: case 92: ! 1065: # line 454 "config.y" ! 1066: ! 1067: { ! 1068: struct idlst *a = (struct idlst *)malloc(sizeof(struct idlst)); ! 1069: a->id = yypvt[-1].str; a->id_next = yypvt[-0].lst; yyval.lst = a; ! 1070: } break; ! 1071: } ! 1072: goto yystack; /* stack new state and value */ ! 1073: ! 1074: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.