#include "sconfig.h"
-struct device *cur_parent, *cur_bus;
+static struct device *cur_parent, *cur_bus;
IRQ = 274,
DRQ = 275,
IO = 276,
- NUMBER = 277
+ NUMBER = 277,
+ SUBSYSTEMID = 278,
+ INHERIT = 279
};
#endif
#endif
/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 9
+#define YYFINAL 3
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 23
+#define YYLAST 34
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 23
+#define YYNTOKENS 25
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 11
+#define YYNNTS 12
/* YYNRULES -- Number of rules. */
-#define YYNRULES 16
+#define YYNRULES 20
/* YYNRULES -- Number of states. */
-#define YYNSTATES 30
+#define YYNSTATES 36
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
-#define YYMAXUTOK 277
+#define YYMAXUTOK 279
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24
};
#if YYDEBUG
YYRHS. */
static const yytype_uint8 yyprhs[] =
{
- 0, 0, 3, 5, 7, 9, 12, 15, 16, 19,
- 22, 23, 24, 30, 31, 39, 44
+ 0, 0, 3, 4, 7, 10, 13, 16, 17, 20,
+ 23, 26, 29, 30, 31, 37, 38, 46, 51, 56,
+ 60
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yytype_int8 yyrhs[] =
{
- 24, 0, -1, 25, -1, 28, -1, 30, -1, 26,
- 25, -1, 26, 33, -1, -1, 27, 25, -1, 27,
- 32, -1, -1, -1, 3, 12, 29, 26, 9, -1,
- -1, 4, 7, 22, 6, 31, 27, 9, -1, 8,
- 22, 10, 22, -1, 5, 12, 10, 12, -1
+ 26, 0, -1, -1, 27, 30, -1, 28, 32, -1,
+ 28, 30, -1, 28, 35, -1, -1, 29, 32, -1,
+ 29, 30, -1, 29, 34, -1, 29, 36, -1, -1,
+ -1, 3, 12, 31, 28, 9, -1, -1, 4, 7,
+ 22, 6, 33, 29, 9, -1, 8, 22, 10, 22,
+ -1, 5, 12, 10, 12, -1, 23, 22, 22, -1,
+ 23, 22, 22, 24, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
- 0, 34, 34, 36, 36, 38, 38, 38, 40, 40,
- 40, 42, 42, 52, 52, 64, 67
+ 0, 35, 35, 35, 37, 37, 37, 37, 39, 39,
+ 39, 39, 39, 41, 41, 51, 51, 63, 66, 69,
+ 72
};
#endif
"$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
"BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI", "PNP", "I2C",
"APIC", "APIC_CLUSTER", "PCI_DOMAIN", "IRQ", "DRQ", "IO", "NUMBER",
- "$accept", "devtree", "devchip", "devices", "devicesorresources", "chip",
- "@1", "device", "@2", "resource", "registers", 0
+ "SUBSYSTEMID", "INHERIT", "$accept", "devtree", "$@1", "chipchildren",
+ "devicechildren", "chip", "@2", "device", "@3", "resource", "registers",
+ "subsystemid", 0
};
#endif
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277
+ 275, 276, 277, 278, 279
};
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
- 0, 23, 24, 25, 25, 26, 26, 26, 27, 27,
- 27, 29, 28, 31, 30, 32, 33
+ 0, 25, 27, 26, 28, 28, 28, 28, 29, 29,
+ 29, 29, 29, 31, 30, 33, 32, 34, 35, 36,
+ 36
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
- 0, 2, 1, 1, 1, 2, 2, 0, 2, 2,
- 0, 0, 5, 0, 7, 4, 4
+ 0, 2, 0, 2, 2, 2, 2, 0, 2, 2,
+ 2, 2, 0, 0, 5, 0, 7, 4, 4, 3,
+ 4
};
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
- 0, 0, 0, 0, 2, 3, 4, 11, 0, 1,
- 7, 0, 0, 13, 0, 12, 5, 6, 10, 0,
- 0, 0, 0, 14, 8, 9, 16, 0, 0, 15
+ 2, 0, 0, 1, 0, 3, 13, 7, 0, 0,
+ 0, 14, 5, 4, 6, 0, 0, 0, 0, 15,
+ 18, 12, 0, 0, 16, 0, 9, 8, 10, 11,
+ 0, 0, 0, 19, 17, 20
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int8 yydefgoto[] =
{
- -1, 3, 4, 12, 20, 5, 10, 6, 18, 25,
- 17
+ -1, 1, 2, 8, 22, 5, 7, 13, 21, 28,
+ 14, 29
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
-#define YYPACT_NINF -13
+#define YYPACT_NINF -9
static const yytype_int8 yypact[] =
{
- 8, -6, 6, 14, -13, -13, -13, -13, -7, -13,
- -13, 10, -2, -13, 5, -13, -13, -13, -13, 9,
- 1, 11, -4, -13, -13, -13, -13, 12, -1, -13
+ -9, 3, 1, -9, -2, -9, -9, -9, 4, 5,
+ -1, -9, -9, -9, -9, -8, 7, 9, 6, -9,
+ -9, -9, -3, 0, -9, 2, -9, -9, -9, -9,
+ 11, 8, 10, -5, -9, -9
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
- -13, -13, -12, -13, -13, -13, -13, -13, -13, -13,
- -13
+ -9, -9, -9, -9, -9, -6, -9, 12, -9, -9,
+ -9, -9
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
#define YYTABLE_NINF -1
static const yytype_uint8 yytable[] =
{
- 16, 1, 2, 14, 1, 2, 7, 15, 24, 22,
- 23, 1, 2, 8, 9, 11, 13, 19, 27, 21,
- 0, 29, 28, 26
+ 4, 9, 12, 3, 4, 23, 24, 4, 9, 10,
+ 6, 16, 15, 11, 17, 19, 26, 18, 20, 35,
+ 25, 32, 30, 0, 31, 0, 0, 0, 0, 0,
+ 33, 0, 34, 0, 27
};
static const yytype_int8 yycheck[] =
{
- 12, 3, 4, 5, 3, 4, 12, 9, 20, 8,
- 9, 3, 4, 7, 0, 22, 6, 12, 22, 10,
- -1, 22, 10, 12
+ 3, 4, 8, 0, 3, 8, 9, 3, 4, 5,
+ 12, 12, 7, 9, 22, 6, 22, 10, 12, 24,
+ 23, 10, 22, -1, 22, -1, -1, -1, -1, -1,
+ 22, -1, 22, -1, 22
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
- 0, 3, 4, 24, 25, 28, 30, 12, 7, 0,
- 29, 22, 26, 6, 5, 9, 25, 33, 31, 12,
- 27, 10, 8, 9, 25, 32, 12, 22, 10, 22
+ 0, 26, 27, 0, 3, 30, 12, 31, 28, 4,
+ 5, 9, 30, 32, 35, 7, 12, 22, 10, 6,
+ 12, 33, 29, 8, 9, 23, 30, 32, 34, 36,
+ 22, 22, 10, 22, 22, 24
};
#define yyerrok (yyerrstatus = 0)
{
case 2:
+ { cur_parent = cur_bus = head; ;}
+ break;
+
+ case 3:
+
{ postprocess_devtree(); ;}
break;
- case 11:
+ case 13:
{
- (yyval.device) = new_chip((yyvsp[(2) - (2)].string));
+ (yyval.device) = new_chip(cur_parent, cur_bus, (yyvsp[(2) - (2)].string));
cur_parent = (yyval.device);
;}
break;
- case 12:
+ case 14:
{
cur_parent = (yyvsp[(3) - (5)].device)->parent;
;}
break;
- case 13:
+ case 15:
{
- (yyval.device) = new_device((yyvsp[(2) - (4)].number), (yyvsp[(3) - (4)].string), (yyvsp[(4) - (4)].number));
+ (yyval.device) = new_device(cur_parent, cur_bus, (yyvsp[(2) - (4)].number), (yyvsp[(3) - (4)].string), (yyvsp[(4) - (4)].number));
cur_parent = (yyval.device);
cur_bus = (yyval.device);
;}
break;
- case 14:
+ case 16:
{
cur_parent = (yyvsp[(5) - (7)].device)->parent;
;}
break;
- case 15:
+ case 17:
- { add_resource((yyvsp[(1) - (4)].number), strtol((yyvsp[(2) - (4)].string), NULL, 0), strtol((yyvsp[(4) - (4)].string), NULL, 0)); ;}
+ { add_resource(cur_parent, (yyvsp[(1) - (4)].number), strtol((yyvsp[(2) - (4)].string), NULL, 0), strtol((yyvsp[(4) - (4)].string), NULL, 0)); ;}
break;
- case 16:
+ case 18:
+
+ { add_register(cur_parent, (yyvsp[(2) - (4)].string), (yyvsp[(4) - (4)].string)); ;}
+ break;
+
+ case 19:
+
+ { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[(2) - (3)].string), NULL, 16), strtol((yyvsp[(3) - (3)].string), NULL, 16), 0); ;}
+ break;
+
+ case 20:
- { add_register((yyvsp[(2) - (4)].string), (yyvsp[(4) - (4)].string)); ;}
+ { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[(2) - (4)].string), NULL, 16), strtol((yyvsp[(3) - (4)].string), NULL, 16), 1); ;}
break;