51 #define YYBISON_VERSION "3.3.2" 54 #define YYSKELETON_NAME "yacc.c" 80 extern int yylex(
void);
89 #define NIL (struct dev_ent *)0x00 91 #define CONFC "conf.c" 92 #define CONFH "conf.h" 93 #define CONFHREF "<conf.h>" 94 #define INFILE "Configuration" 107 char *
doing =
"device type declarations";
138 "/* Device table entry */",
143 "\tdevcall (*dvinit) (struct dentry *);",
144 "\tdevcall (*dvopen) (struct dentry *, char *, char *);",
145 "\tdevcall (*dvclose)(struct dentry *);",
146 "\tdevcall (*dvread) (struct dentry *, void *, uint32);",
147 "\tdevcall (*dvwrite)(struct dentry *, void *, uint32);",
148 "\tdevcall (*dvseek) (struct dentry *, int32);",
149 "\tdevcall (*dvgetc) (struct dentry *);",
150 "\tdevcall (*dvputc) (struct dentry *, char);",
151 "\tdevcall (*dvcntl) (struct dentry *, int32, int32, int32);",
153 "\tvoid (*dvintr)(void);",
156 "extern struct dentry devtab[]; /* one entry per device */",
182 # if defined __cplusplus 183 # if 201103L <= __cplusplus 184 # define YY_NULLPTR nullptr 186 # define YY_NULLPTR 0 189 # define YY_NULLPTR ((void*)0) 194 #ifdef YYERROR_VERBOSE 195 # undef YYERROR_VERBOSE 196 # define YYERROR_VERBOSE 1 198 # define YYERROR_VERBOSE 0 260 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 262 # define YYSTYPE_IS_TRIVIAL 1 263 # define YYSTYPE_IS_DECLARED 1 304 # ifdef __SIZE_TYPE__ 305 # define YYSIZE_T __SIZE_TYPE__ 306 # elif defined size_t 307 # define YYSIZE_T size_t 308 # elif ! defined YYSIZE_T 310 # define YYSIZE_T size_t 312 # define YYSIZE_T unsigned 316 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 319 # if defined YYENABLE_NLS && YYENABLE_NLS 321 # include <libintl.h> 322 # define YY_(Msgid) dgettext ("bison-runtime", Msgid) 326 # define YY_(Msgid) Msgid 331 # if (defined __GNUC__ \ 332 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ 333 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 334 # define YY_ATTRIBUTE(Spec) __attribute__(Spec) 336 # define YY_ATTRIBUTE(Spec) 340 #ifndef YY_ATTRIBUTE_PURE 341 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) 344 #ifndef YY_ATTRIBUTE_UNUSED 345 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 349 #if ! defined lint || defined __GNUC__ 350 # define YYUSE(E) ((void) (E)) 355 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 357 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 358 _Pragma ("GCC diagnostic push") \ 359 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 360 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 361 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 362 _Pragma ("GCC diagnostic pop") 364 # define YY_INITIAL_VALUE(Value) Value 366 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 367 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 368 # define YY_IGNORE_MAYBE_UNINITIALIZED_END 370 #ifndef YY_INITIAL_VALUE 371 # define YY_INITIAL_VALUE(Value) 375 #if ! defined yyoverflow || YYERROR_VERBOSE 379 # ifdef YYSTACK_USE_ALLOCA 380 # if YYSTACK_USE_ALLOCA 382 # define YYSTACK_ALLOC __builtin_alloca 383 # elif defined __BUILTIN_VA_ARG_INCR 386 # define YYSTACK_ALLOC __alloca 387 # elif defined _MSC_VER 389 # define alloca _alloca 391 # define YYSTACK_ALLOC alloca 392 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 395 # ifndef EXIT_SUCCESS 396 # define EXIT_SUCCESS 0 403 # ifdef YYSTACK_ALLOC 405 # define YYSTACK_FREE(Ptr) do { ; } while (0) 406 # ifndef YYSTACK_ALLOC_MAXIMUM 411 # define YYSTACK_ALLOC_MAXIMUM 4032 414 # define YYSTACK_ALLOC YYMALLOC 415 # define YYSTACK_FREE YYFREE 416 # ifndef YYSTACK_ALLOC_MAXIMUM 417 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 419 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 420 && ! ((defined YYMALLOC || defined malloc) \ 421 && (defined YYFREE || defined free))) 423 # ifndef EXIT_SUCCESS 424 # define EXIT_SUCCESS 0 428 # define YYMALLOC malloc 429 # if ! defined malloc && ! defined EXIT_SUCCESS 435 # if ! defined free && ! defined EXIT_SUCCESS 443 #if (! defined yyoverflow \ 444 && (! defined __cplusplus \ 445 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 455 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 459 # define YYSTACK_BYTES(N) \ 460 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 461 + YYSTACK_GAP_MAXIMUM) 463 # define YYCOPY_NEEDED 1 470 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 473 YYSIZE_T yynewbytes; \ 474 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 475 Stack = &yyptr->Stack_alloc; \ 476 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 477 yyptr += yynewbytes / sizeof (*yyptr); \ 483 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 487 # if defined __GNUC__ && 1 < __GNUC__ 488 # define YYCOPY(Dst, Src, Count) \ 489 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 491 # define YYCOPY(Dst, Src, Count) \ 495 for (yyi = 0; yyi < (Count); yyi++) \ 496 (Dst)[yyi] = (Src)[yyi]; \ 518 #define YYMAXUTOK 277 522 #define YYTRANSLATE(YYX) \ 523 ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 529 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
531 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
533 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
534 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
535 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
554 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
555 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
556 15, 16, 17, 18, 19, 20, 21, 22
563 0, 133, 133, 142, 143, 146, 149, 152, 153, 156,
564 159, 162, 163, 166, 167, 168, 169, 170, 171, 172,
565 173, 174, 175, 176, 177, 180, 183, 193, 194, 197,
566 200, 203, 206, 209, 212, 215
570 #if YYDEBUG || YYERROR_VERBOSE || 0 573 static const char *
const yytname[] =
575 "$end",
"error",
"$undefined",
"DEFBRK",
"IFBRK",
"COLON",
"OCTAL",
576 "INTEGER",
"IDENT",
"CSR",
"IRQ",
"INTR",
"INIT",
"OPEN",
"CLOSE",
577 "READ",
"WRITE",
"SEEK",
"CONTROL",
"IS",
"ON",
"GETC",
"PUTC",
578 "$accept",
"configuration",
"devtypes",
"devtype",
"tname",
"dev_tlist",
579 "theader",
"tonid",
"attr_list",
"attr",
"id",
"number",
"devices",
580 "device",
"dheader",
"dname",
"devis",
"devisid",
"devon",
"devonid",
YY_NULLPTR 589 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
590 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
595 #define YYPACT_NINF -14 597 #define yypact_value_is_default(Yystate) \ 598 (!!((Yystate) == (-14))) 600 #define YYTABLE_NINF -1 602 #define yytable_value_is_error(Yytable_value) \ 609 -14, 10, 22, -14, -14, -14, -14, 6, 16, 8,
610 -14, -14, -14, 12, 18, 8, -14, -9, 19, 13,
611 -14, -14, -14, -9, 25, 25, 26, 26, 26, 26,
612 26, 26, 26, 26, 26, 26, -14, -14, -14, 27,
613 -14, -9, -14, -14, -14, -14, -14, -14, -14, -14,
614 -14, -14, -14, -14, -14, -14, -14, -14
622 3, 0, 0, 1, 27, 6, 4, 0, 2, 0,
623 31, 28, 11, 0, 0, 5, 11, 29, 0, 0,
624 10, 9, 11, 7, 0, 0, 0, 0, 0, 0,
625 0, 0, 0, 0, 0, 0, 12, 33, 32, 0,
626 30, 8, 26, 13, 14, 25, 15, 18, 16, 17,
627 21, 22, 23, 24, 19, 20, 35, 34
633 -14, -14, -14, -14, -14, -14, 21, -14, 7, -14,
634 -13, 14, -14, -14, -14, -14, -14, -14, -14, -14
640 -1, 1, 2, 6, 7, 15, 16, 21, 17, 36,
641 46, 43, 8, 11, 12, 13, 19, 38, 40, 57
649 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
650 3, 9, 34, 35, 47, 48, 49, 50, 51, 52,
651 53, 54, 55, 23, 10, 4, 20, 37, 14, 41,
652 5, 18, 42, 39, 45, 56, 22, 0, 0, 44
657 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
658 0, 5, 21, 22, 27, 28, 29, 30, 31, 32,
659 33, 34, 35, 16, 8, 3, 8, 8, 20, 22,
660 8, 19, 7, 20, 8, 8, 15, -1, -1, 25
667 0, 24, 25, 0, 3, 8, 26, 27, 35, 5,
668 8, 36, 37, 38, 20, 28, 29, 31, 19, 39,
669 8, 30, 29, 31, 9, 10, 11, 12, 13, 14,
670 15, 16, 17, 18, 21, 22, 32, 8, 40, 20,
671 41, 31, 7, 34, 34, 8, 33, 33, 33, 33,
672 33, 33, 33, 33, 33, 33, 8, 42
678 0, 23, 24, 25, 25, 26, 27, 28, 28, 29,
679 30, 31, 31, 32, 32, 32, 32, 32, 32, 32,
680 32, 32, 32, 32, 32, 33, 34, 35, 35, 36,
681 37, 38, 39, 40, 41, 42
687 0, 2, 3, 0, 2, 3, 1, 2, 3, 2,
688 1, 0, 2, 2, 2, 2, 2, 2, 2, 2,
689 2, 2, 2, 2, 2, 1, 1, 0, 2, 2,
694 #define yyerrok (yyerrstatus = 0) 695 #define yyclearin (yychar = YYEMPTY) 699 #define YYACCEPT goto yyacceptlab 700 #define YYABORT goto yyabortlab 701 #define YYERROR goto yyerrorlab 704 #define YYRECOVERING() (!!yyerrstatus) 706 #define YYBACKUP(Token, Value) \ 708 if (yychar == YYEMPTY) \ 712 YYPOPSTACK (yylen); \ 718 yyerror (YY_("syntax error: cannot back up")); \ 725 #define YYERRCODE 256 734 # define YYFPRINTF fprintf 737 # define YYDPRINTF(Args) \ 744 #ifndef YY_LOCATION_PRINT 745 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 749 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 753 YYFPRINTF (stderr, "%s ", Title); \ 754 yy_symbol_print (stderr, \ 756 YYFPRINTF (stderr, "\n"); \ 766 yy_symbol_value_print (FILE *yyo,
int yytype,
YYSTYPE const *
const yyvaluep)
768 FILE *yyoutput = yyo;
774 YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
785 yy_symbol_print (FILE *yyo,
int yytype,
YYSTYPE const *
const yyvaluep)
787 YYFPRINTF (yyo,
"%s %s (",
788 yytype <
YYNTOKENS ?
"token" :
"nterm", yytname[yytype]);
790 yy_symbol_value_print (yyo, yytype, yyvaluep);
791 YYFPRINTF (yyo,
")");
802 YYFPRINTF (
stderr,
"Stack now");
803 for (; yybottom <= yytop; yybottom++)
805 int yybot = *yybottom;
806 YYFPRINTF (
stderr,
" %d", yybot);
811 # define YY_STACK_PRINT(Bottom, Top) \ 814 yy_stack_print ((Bottom), (Top)); \ 825 unsigned long yylno = yyrline[yyrule];
826 int yynrhs =
yyr2[yyrule];
828 YYFPRINTF (
stderr,
"Reducing stack by rule %d (line %lu):\n",
831 for (yyi = 0; yyi < yynrhs; yyi++)
833 YYFPRINTF (
stderr,
" $%d = ", yyi + 1);
835 yystos[yyssp[yyi + 1 - yynrhs]],
836 &yyvsp[(yyi + 1) - (yynrhs)]
842 # define YY_REDUCE_PRINT(Rule) \ 845 yy_reduce_print (yyssp, yyvsp, Rule); \ 852 # define YYDPRINTF(Args) 853 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 854 # define YY_STACK_PRINT(Bottom, Top) 855 # define YY_REDUCE_PRINT(Rule) 861 # define YYINITDEPTH 200 872 # define YYMAXDEPTH 10000 879 # if defined __GLIBC__ && defined _STRING_H 880 # define yystrlen strlen 884 yystrlen (
const char *yystr)
887 for (yylen = 0; yystr[yylen]; yylen++)
895 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 896 # define yystpcpy stpcpy 901 yystpcpy (
char *yydest,
const char *yysrc)
904 const char *yys = yysrc;
906 while ((*yyd++ = *yys++) !=
'\0')
923 yytnamerr (
char *yyres,
const char *yystr)
928 char const *yyp = yystr;
935 goto do_not_strip_quotes;
939 goto do_not_strip_quotes;
955 do_not_strip_quotes: ;
959 return yystrlen (yystr);
961 return (
YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
974 yysyntax_error (
YYSIZE_T *yymsg_alloc,
char **yymsg,
979 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
983 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1013 int yyn =
yypact[*yyssp];
1014 yyarg[yycount++] = yytname[yytoken];
1020 int yyxbegin = yyn < 0 ? -yyn : 0;
1022 int yychecklim =
YYLAST - yyn + 1;
1026 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1030 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1036 yyarg[yycount++] = yytname[yyx];
1050 # define YYCASE_(N, S) \ 1055 YYCASE_(0,
YY_(
"syntax error"));
1056 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1057 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1058 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1059 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1060 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1065 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1072 if (*yymsg_alloc < yysize)
1074 *yymsg_alloc = 2 * yysize;
1075 if (! (yysize <= *yymsg_alloc
1087 while ((*yyp = *yyformat) !=
'\0')
1088 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1090 yyp += yytnamerr (yyp, yyarg[yyi++]);
1173 char *yymsg = yymsgbuf;
1174 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1177 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1183 yyssp = yyss = yyssa;
1184 yyvsp = yyvs = yyvsa;
1211 if (yyss + yystacksize - 1 <= yyssp)
1212 #if !defined yyoverflow && !defined YYSTACK_RELOCATE 1213 goto yyexhaustedlab;
1219 # if defined yyoverflow 1231 yyoverflow (
YY_(
"memory exhausted"),
1232 &yyss1, yysize *
sizeof (*yyssp),
1233 &yyvs1, yysize *
sizeof (*yyvsp),
1241 goto yyexhaustedlab;
1251 goto yyexhaustedlab;
1254 # undef YYSTACK_RELOCATE 1260 yyssp = yyss + yysize - 1;
1261 yyvsp = yyvs + yysize - 1;
1264 (
unsigned long) yystacksize));
1266 if (yyss + yystacksize - 1 <= yyssp)
1369 yyval = yyvsp[1-yylen];
1376 #line 142 "config.y" 1377 {
doing =
"device definitions"; }
1378 #line 1379 "y.tab.c" 1382 #line 149 "config.y" 1384 #line 1385 "y.tab.c" 1388 #line 156 "config.y" 1389 { yyval = yyvsp[0]; }
1390 #line 1391 "y.tab.c" 1394 #line 159 "config.y" 1396 #line 1397 "y.tab.c" 1400 #line 166 "config.y" 1402 #line 1403 "y.tab.c" 1406 #line 167 "config.y" 1408 #line 1409 "y.tab.c" 1412 #line 168 "config.y" 1414 #line 1415 "y.tab.c" 1418 #line 169 "config.y" 1420 #line 1421 "y.tab.c" 1424 #line 170 "config.y" 1426 #line 1427 "y.tab.c" 1430 #line 171 "config.y" 1432 #line 1433 "y.tab.c" 1436 #line 172 "config.y" 1438 #line 1439 "y.tab.c" 1442 #line 173 "config.y" 1444 #line 1445 "y.tab.c" 1448 #line 174 "config.y" 1450 #line 1451 "y.tab.c" 1454 #line 175 "config.y" 1456 #line 1457 "y.tab.c" 1460 #line 176 "config.y" 1462 #line 1463 "y.tab.c" 1466 #line 177 "config.y" 1468 #line 1469 "y.tab.c" 1472 #line 180 "config.y" 1474 #line 1475 "y.tab.c" 1478 #line 183 "config.y" 1480 #line 1481 "y.tab.c" 1484 #line 193 "config.y" 1485 {
doing =
"interface types"; }
1486 #line 1487 "y.tab.c" 1490 #line 203 "config.y" 1492 #line 1493 "y.tab.c" 1496 #line 209 "config.y" 1498 #line 1499 "y.tab.c" 1502 #line 215 "config.y" 1504 #line 1505 "y.tab.c" 1508 #line 1509 "y.tab.c" 1535 const int yyi =
yypgoto[yylhs] + *yyssp;
1536 yystate = (0 <= yyi && yyi <=
YYLAST &&
yycheck[yyi] == *yyssp
1556 #if ! YYERROR_VERBOSE 1559 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 1562 char const *yymsgp =
YY_(
"syntax error");
1563 int yysyntax_error_status;
1564 yysyntax_error_status = YYSYNTAX_ERROR;
1565 if (yysyntax_error_status == 0)
1567 else if (yysyntax_error_status == 1)
1569 if (yymsg != yymsgbuf)
1575 yymsg_alloc =
sizeof yymsgbuf;
1576 yysyntax_error_status = 2;
1580 yysyntax_error_status = YYSYNTAX_ERROR;
1585 if (yysyntax_error_status == 2)
1586 goto yyexhaustedlab;
1588 # undef YYSYNTAX_ERROR 1594 if (yyerrstatus == 3)
1696 #if !defined yyoverflow || YYERROR_VERBOSE 1723 while (yyssp != yyss)
1734 if (yymsg != yymsgbuf)
1739 #line 218 "config.y" 1754 int n, i, j, l, fcount;
1760 if ( argc > 1 && (
strncmp(
"-v", argv[1], 2) == 0) ) {
1767 fprintf(
stderr,
"use: config [-v] [input_file] [conf.c] [conf.h]\n");
1771 if (verbose) {
printf(
"Opening input file...\n"); }
1774 if (freopen(argv[1],
"r",
stdin) ==
NULL) {
1793 if (verbose) {
printf(
"Parsing configuration specs...\n"); }
1799 if (verbose) {
printf(
"Opening output files...\n"); }
1802 if ( (
confc = fopen(argv[2],
"w") ) ==
NULL) {
1815 if ( (
confh = fopen(argv[3],
"w") ) ==
NULL) {
1834 fprintf(
confh,
"/* conf.h (GENERATED FILE; DO NOT EDIT) */\n\n");
1836 if (verbose) {
printf(
"Writing output...\n"); }
1838 fprintf(
confh,
"/* Device switch table declarations */\n\n");
1849 for (i = 0; i<
ndevs; i++) {
1859 for (i = 0; i <
ntypes; i++) {
1869 if (ndevs > 0) {
fprintf(
confh,
"#define NDEVS %d\n", ndevs); }
1878 while ( (c =
input()) > 0) {
1892 fprintf(
confc,
"/* conf.c (GENERATED FILE; DO NOT EDIT) */\n\n");
1900 fprintf(
confc,
"/* Device independent I/O switch */\n\n");
1906 " * Format of entries is:",
1907 " * dev-number, minor-number, dev-name,",
1908 " * init, open, close,",
1909 " * read, write, seek,",
1910 " * getc, putc, control,",
1911 " * dev-csr-address, intr-handler, irq",
1915 for (i=0; i<
ndevs; i++) {
1919 fprintf(
confc,
"\t (void *)%s, (void *)%s, (void *)%s,\n",
1921 fprintf(
confc,
"\t (void *)%s, (void *)%s, (void *)%s,\n",
1923 fprintf(
confc,
"\t (void *)%s, (void *)%s, (void *)%s,\n",
1940 printf(
"Configuration complete. Number of devs=%d:\n", ndevs);
1941 for (i=0; i<
ndevs; i++) {
1944 printf(
" csr=0x%04x, irq=0x%04x, minor=%d\n",
1971 case CSR: s->
csr = val;
break;
1972 case IRQ: s->
irq = val;
break;
2023 if (*p ==
'x' || *p ==
'X')
2039 for (; len > 0; ++p, --len)
2042 if (
isdigit(*p)) { rv += *p -
'0'; }
2043 else if (
isupper(*p)) { rv += *p -
'A' + 10; }
2044 else { rv += *p -
'a' + 10; }
2067 for (i=0; i<
ntypes; i++) {
2077 currdev =
ndevs - 1;
2108 currdev =
ndevs - 1;
2109 dptr = &
devs[currdev];
2115 for (i=0; i<
ntypes; i++) {
2125 bcopy (tptr, dptr,
sizeof(
struct dev_ent));
2148 fprintf(
stderr,
"atribute string %s is too long on line %d\n",
2180 for (i=0; i<
ndevs; i++) {
2193 strcpy(dptr->name, name);
2222 for (i=0; i<
ntypes; i++) {
2235 strcpy(dptr->tname, name);
2236 strncpy(dptr->intr,
"ioerr", 5);
2237 strncpy(dptr->init,
"ioerr", 5);
2238 strncpy(dptr->open,
"ioerr", 5);
2239 strncpy(dptr->close,
"ioerr", 5);
2240 strncpy(dptr->read,
"ioerr", 5);
2241 strncpy(dptr->write,
"ioerr", 5);
2242 strncpy(dptr->control,
"ioerr", 5);
2243 strncpy(dptr->seek,
"ioerr", 5);
2244 strncpy(dptr->getc,
"ioerr", 5);
2245 strncpy(dptr->putc,
"ioerr", 5);
static const yytype_uint8 yystos[]
#define NULL
連結リスト用のNULLポインタ
static const yytype_uint8 yytable[]
int32 strncmp(const char *, const char *, int32)
char * strncpy(char *, const char *, int32)
文字列s1に文字列s2をN文字(Byte)分コピーする。
#define YYSTACK_ALLOC_MAXIMUM
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
static const yytype_int8 yycheck[]
#define isdigit(c)
文字が10進数の数字かどうかをチェックするマクロ
#define isupper(c)
文字がアルファベットの大文字かどうかをチェックするマクロ
「文字種類の判定」や「文字変換」を行う関数マクロを提供する。
int strlen(char *str)
NULL終端された文字列の長さを返す。NULL終端は長さに含まない。
static const yytype_uint8 yytranslate[]
unsigned char yytype_uint8
int32 printf(const char *,...)
static const yytype_int8 yydefgoto[]
void exit(void)
現在実行中のプロセスを終了させる。
int config_atoi(char *, int)
unsigned short yytype_uint16
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
int main(int argc, char **argv)
#define YY_REDUCE_PRINT(Rule)
static const yytype_uint8 yydefact[]
static const yytype_uint8 yyr1[]
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
static const yytype_int8 yypgoto[]
#define YY_STACK_PRINT(Bottom, Top)
int strcpy(char *tar, char *src)
文字列Aに文字列B(NULL終端を含めて)をコピーする。
#define yypact_value_is_default(Yystate)
void bzero(void *, int)
Byteブロック領域の先頭N bytesを数値ゼロで埋める。
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
int32 fprintf(int, char *,...)
static const yytype_uint8 yyr2[]
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
#define yytable_value_is_error(Yytable_value)
static const yytype_int8 yypact[]
struct dev_ent dtypes[NTYPES]
struct dev_ent devs[NDEVS]
int strcmp(char *str1, char *str2)
二つの文字列を比較し、その結果を返す。