Hung-Te Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31708
Change subject: cbfstool: Support all FMAP flags for FMD ......................................................................
cbfstool: Support all FMAP flags for FMD
The FMAP area_flag also supports STATIC, RO, COMPRESSED and we do want to allow them all in FMD.
BUG=chromium:936768 TEST=make; boots an x86 image. Manually added RO, STATIC, COMPRESSED to FMD entries and verified output.
Change-Id: I7b84ce55c0a120061b285b69c51f37e6663fdb66 Signed-off-by: Hung-Te Lin hungte@chromium.org --- M util/cbfstool/fmap_from_fmd.c M util/cbfstool/fmd.h M util/cbfstool/fmd_parser.c_shipped M util/cbfstool/fmd_parser.h_shipped M util/cbfstool/fmd_parser.y M util/cbfstool/fmd_scanner.c_shipped M util/cbfstool/fmd_scanner.h_shipped M util/cbfstool/fmd_scanner.l 8 files changed, 243 insertions(+), 162 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/31708/1
diff --git a/util/cbfstool/fmap_from_fmd.c b/util/cbfstool/fmap_from_fmd.c index 374667a..aa598ddf 100644 --- a/util/cbfstool/fmap_from_fmd.c +++ b/util/cbfstool/fmap_from_fmd.c @@ -32,6 +32,12 @@
absolute_watermark += section->offset;
+ if (section->flags.f.is_static) + flags |= FMAP_AREA_STATIC; + if (section->flags.f.compressed) + flags |= FMAP_AREA_COMPRESSED; + if (section->flags.f.read_only) + flags |= FMAP_AREA_RO; if (section->flags.f.preserve) flags |= FMAP_AREA_PRESERVE;
diff --git a/util/cbfstool/fmd.h b/util/cbfstool/fmd.h index f7d0954..73fa218 100644 --- a/util/cbfstool/fmd.h +++ b/util/cbfstool/fmd.h @@ -26,6 +26,9 @@ union flashmap_flags { struct { int cbfs: 1; + int is_static: 1; + int compressed: 1; + int read_only: 1; int preserve: 1; } f; int v; diff --git a/util/cbfstool/fmd_parser.c_shipped b/util/cbfstool/fmd_parser.c_shipped index e905ea3..53601ce 100644 --- a/util/cbfstool/fmd_parser.c_shipped +++ b/util/cbfstool/fmd_parser.c_shipped @@ -137,7 +137,10 @@ OCTAL = 259, STRING = 260, FLAG_CBFS = 261, - FLAG_PRESERVE = 262 + FLAG_STATIC = 262, + FLAG_COMPRESSED = 263, + FLAG_RO = 264, + FLAG_PRESERVE = 265 }; #endif /* Tokens. */ @@ -145,7 +148,10 @@ #define OCTAL 259 #define STRING 260 #define FLAG_CBFS 261 -#define FLAG_PRESERVE 262 +#define FLAG_STATIC 262 +#define FLAG_COMPRESSED 263 +#define FLAG_RO 264 +#define FLAG_PRESERVE 265
/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED @@ -161,7 +167,7 @@ union flashmap_flags flags; struct descriptor_list region_listhdr;
-#line 165 "y.tab.c" /* yacc.c:355 */ +#line 171 "y.tab.c" /* yacc.c:355 */ };
typedef union YYSTYPE YYSTYPE; @@ -178,7 +184,7 @@
/* Copy the second part of user declarations. */
-#line 182 "y.tab.c" /* yacc.c:358 */ +#line 188 "y.tab.c" /* yacc.c:358 */
#ifdef short # undef short @@ -420,21 +426,21 @@ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 4 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 23 +#define YYLAST 24
/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 13 +#define YYNTOKENS 16 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 14 /* YYNRULES -- Number of rules. */ -#define YYNRULES 21 +#define YYNRULES 24 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 31 +#define YYNSTATES 34
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 262 +#define YYMAXUTOK 265
#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -447,15 +453,15 @@ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 8, 9, 2, 2, 2, 2, 2, 2, 2, 2, + 11, 12, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 10, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 11, 2, 12, 2, 2, 2, 2, + 2, 2, 2, 14, 2, 15, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -469,16 +475,16 @@ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7 + 5, 6, 7, 8, 9, 10 };
#if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 80, 80, 86, 100, 107, 108, 109, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 119, 123, 124, - 125, 136 + 0, 83, 83, 89, 103, 110, 111, 112, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 125, 129, 130, 131, 142 }; #endif
@@ -488,11 +494,12 @@ static const char *const yytname[] = { "$end", "error", "$undefined", "INTEGER", "OCTAL", "STRING", - "FLAG_CBFS", "FLAG_PRESERVE", "'('", "')'", "'@'", "'{'", "'}'", - "$accept", "flash_chip", "flash_region", "region_name", - "region_flags_opt", "region_flags", "region_flag", "region_offset_opt", - "region_offset", "region_size_opt", "region_size", "region_list_opt", - "region_list", "region_list_entries", YY_NULLPTR + "FLAG_CBFS", "FLAG_STATIC", "FLAG_COMPRESSED", "FLAG_RO", + "FLAG_PRESERVE", "'('", "')'", "'@'", "'{'", "'}'", "$accept", + "flash_chip", "flash_region", "region_name", "region_flags_opt", + "region_flags", "region_flag", "region_offset_opt", "region_offset", + "region_size_opt", "region_size", "region_list_opt", "region_list", + "region_list_entries", YY_NULLPTR }; #endif
@@ -501,15 +508,15 @@ (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { - 0, 256, 257, 258, 259, 260, 261, 262, 40, 41, - 64, 123, 125 + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 40, 41, 64, 123, 125 }; # endif
-#define YYPACT_NINF -12 +#define YYPACT_NINF -14
#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-12))) + (!!((Yystate) == (-14)))
#define YYTABLE_NINF -1
@@ -520,10 +527,10 @@ STATE-NUM. */ static const yytype_int8 yypact[] = { - -1, -12, 1, -2, -12, 2, 3, -12, -12, -12, - 0, -1, -12, -12, 4, -5, -4, -2, -12, -12, - -12, -12, 5, -4, 3, -12, -12, 0, -12, -12, - -12 + 2, -14, 1, -2, -14, 5, 6, -14, -14, -14, + -1, 2, -14, -14, 3, -5, -4, -2, -14, -14, + -14, -14, -14, -14, -14, 0, -4, 6, -14, -14, + -1, -14, -14, -14 };
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -531,24 +538,24 @@ means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 4, 0, 11, 1, 0, 0, 12, 13, 16, - 0, 0, 2, 20, 5, 0, 0, 11, 19, 21, - 9, 10, 0, 7, 14, 6, 8, 17, 15, 3, - 18 + 0, 4, 0, 14, 1, 0, 0, 15, 16, 19, + 0, 0, 2, 23, 5, 0, 0, 14, 22, 24, + 9, 10, 11, 12, 13, 0, 7, 17, 6, 8, + 20, 18, 3, 21 };
/* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -12, -12, -6, 10, -12, -10, -12, 6, -12, -12, - -9, -12, -11, -12 + -14, -14, 4, 15, -14, -10, -14, 7, -14, -14, + -9, -14, -13, -14 };
/* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 2, 13, 14, 17, 22, 23, 6, 7, 27, - 10, 29, 12, 15 + -1, 2, 13, 14, 17, 25, 26, 6, 7, 30, + 10, 32, 12, 15 };
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -556,42 +563,42 @@ number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { - 1, 4, 20, 21, 1, 8, 9, 18, 5, 19, - 3, 11, 16, 26, 25, 28, 30, 0, 0, 0, - 0, 0, 0, 24 + 1, 4, 20, 21, 22, 23, 24, 1, 8, 9, + 18, 5, 28, 11, 16, 3, 29, 33, 31, 19, + 0, 0, 0, 0, 27 };
static const yytype_int8 yycheck[] = { - 5, 0, 6, 7, 5, 3, 3, 12, 10, 15, - 0, 11, 8, 23, 9, 24, 27, -1, -1, -1, - -1, -1, -1, 17 + 5, 0, 6, 7, 8, 9, 10, 5, 3, 3, + 15, 13, 12, 14, 11, 0, 26, 30, 27, 15, + -1, -1, -1, -1, 17 };
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 5, 14, 16, 0, 10, 20, 21, 3, 3, - 23, 11, 25, 15, 16, 26, 8, 17, 12, 15, - 6, 7, 18, 19, 20, 9, 18, 22, 23, 24, - 25 + 0, 5, 17, 19, 0, 13, 23, 24, 3, 3, + 26, 14, 28, 18, 19, 29, 11, 20, 15, 18, + 6, 7, 8, 9, 10, 21, 22, 23, 12, 21, + 25, 26, 27, 28 };
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 13, 14, 15, 16, 17, 17, 18, 18, 19, - 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, - 26, 26 + 0, 16, 17, 18, 19, 20, 20, 21, 21, 22, + 22, 22, 22, 22, 23, 23, 24, 25, 25, 26, + 27, 27, 28, 29, 29 };
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 4, 5, 1, 0, 3, 1, 2, 1, - 1, 0, 1, 2, 0, 1, 1, 0, 1, 3, - 1, 2 + 1, 1, 1, 1, 0, 1, 2, 0, 1, 1, + 0, 1, 3, 1, 2 };
@@ -1268,17 +1275,17 @@ switch (yyn) { case 2: -#line 81 "fmd_parser.y" /* yacc.c:1646 */ +#line 84 "fmd_parser.y" /* yacc.c:1646 */ { union flashmap_flags flags = {0}; if (!(res = parse_descriptor((yyvsp[-3].strval), flags, (yyvsp[-2].maybe_intval), (yyvsp[-1].maybe_intval), (yyvsp[0].region_listhdr)))) YYABORT; } -#line 1278 "y.tab.c" /* yacc.c:1646 */ +#line 1285 "y.tab.c" /* yacc.c:1646 */ break;
case 3: -#line 88 "fmd_parser.y" /* yacc.c:1646 */ +#line 91 "fmd_parser.y" /* yacc.c:1646 */ { struct flashmap_descriptor *node = parse_descriptor((yyvsp[-4].strval), (yyvsp[-3].flags), (yyvsp[-2].maybe_intval), (yyvsp[-1].maybe_intval), (yyvsp[0].region_listhdr)); if (!node) @@ -1291,91 +1298,109 @@
(yyval.region_ptr) = node; } -#line 1295 "y.tab.c" /* yacc.c:1646 */ +#line 1302 "y.tab.c" /* yacc.c:1646 */ break;
case 4: -#line 101 "fmd_parser.y" /* yacc.c:1646 */ +#line 104 "fmd_parser.y" /* yacc.c:1646 */ { if (!(yyvsp[0].strval)) { perror("E: While allocating section name"); YYABORT; } } -#line 1306 "y.tab.c" /* yacc.c:1646 */ +#line 1313 "y.tab.c" /* yacc.c:1646 */ break;
case 5: -#line 107 "fmd_parser.y" /* yacc.c:1646 */ +#line 110 "fmd_parser.y" /* yacc.c:1646 */ { (yyval.flags) = (union flashmap_flags){0}; } -#line 1312 "y.tab.c" /* yacc.c:1646 */ +#line 1319 "y.tab.c" /* yacc.c:1646 */ break;
case 6: -#line 108 "fmd_parser.y" /* yacc.c:1646 */ +#line 111 "fmd_parser.y" /* yacc.c:1646 */ { (yyval.flags) = (yyvsp[-1].flags); } -#line 1318 "y.tab.c" /* yacc.c:1646 */ +#line 1325 "y.tab.c" /* yacc.c:1646 */ break;
case 8: -#line 109 "fmd_parser.y" /* yacc.c:1646 */ +#line 112 "fmd_parser.y" /* yacc.c:1646 */ { (yyval.flags).v = (yyvsp[-1].flags).v | (yyvsp[0].flags).v; } -#line 1324 "y.tab.c" /* yacc.c:1646 */ +#line 1331 "y.tab.c" /* yacc.c:1646 */ break;
case 9: -#line 110 "fmd_parser.y" /* yacc.c:1646 */ +#line 113 "fmd_parser.y" /* yacc.c:1646 */ { (yyval.flags) = (union flashmap_flags){ .f.cbfs = 1 }; } -#line 1330 "y.tab.c" /* yacc.c:1646 */ +#line 1337 "y.tab.c" /* yacc.c:1646 */ break;
case 10: -#line 111 "fmd_parser.y" /* yacc.c:1646 */ - { (yyval.flags) = (union flashmap_flags){ .f.preserve = 1 }; } -#line 1336 "y.tab.c" /* yacc.c:1646 */ +#line 114 "fmd_parser.y" /* yacc.c:1646 */ + { (yyval.flags) = (union flashmap_flags){ .f.is_static = 1 }; } +#line 1343 "y.tab.c" /* yacc.c:1646 */ break;
case 11: -#line 112 "fmd_parser.y" /* yacc.c:1646 */ - { (yyval.maybe_intval) = (struct unsigned_option){false, 0}; } -#line 1342 "y.tab.c" /* yacc.c:1646 */ +#line 115 "fmd_parser.y" /* yacc.c:1646 */ + { (yyval.flags) = (union flashmap_flags){ .f.compressed = 1 }; } +#line 1349 "y.tab.c" /* yacc.c:1646 */ + break; + + case 12: +#line 116 "fmd_parser.y" /* yacc.c:1646 */ + { (yyval.flags) = (union flashmap_flags){ .f.read_only = 1 }; } +#line 1355 "y.tab.c" /* yacc.c:1646 */ break;
case 13: -#line 114 "fmd_parser.y" /* yacc.c:1646 */ - { (yyval.maybe_intval) = (struct unsigned_option){true, (yyvsp[0].intval)}; } -#line 1348 "y.tab.c" /* yacc.c:1646 */ +#line 117 "fmd_parser.y" /* yacc.c:1646 */ + { (yyval.flags) = (union flashmap_flags){ .f.preserve = 1 }; } +#line 1361 "y.tab.c" /* yacc.c:1646 */ break;
case 14: -#line 115 "fmd_parser.y" /* yacc.c:1646 */ +#line 118 "fmd_parser.y" /* yacc.c:1646 */ { (yyval.maybe_intval) = (struct unsigned_option){false, 0}; } -#line 1354 "y.tab.c" /* yacc.c:1646 */ +#line 1367 "y.tab.c" /* yacc.c:1646 */ break;
case 16: -#line 117 "fmd_parser.y" /* yacc.c:1646 */ +#line 120 "fmd_parser.y" /* yacc.c:1646 */ { (yyval.maybe_intval) = (struct unsigned_option){true, (yyvsp[0].intval)}; } -#line 1360 "y.tab.c" /* yacc.c:1646 */ +#line 1373 "y.tab.c" /* yacc.c:1646 */ break;
case 17: -#line 119 "fmd_parser.y" /* yacc.c:1646 */ +#line 121 "fmd_parser.y" /* yacc.c:1646 */ + { (yyval.maybe_intval) = (struct unsigned_option){false, 0}; } +#line 1379 "y.tab.c" /* yacc.c:1646 */ + break; + + case 19: +#line 123 "fmd_parser.y" /* yacc.c:1646 */ + { (yyval.maybe_intval) = (struct unsigned_option){true, (yyvsp[0].intval)}; } +#line 1385 "y.tab.c" /* yacc.c:1646 */ + break; + + case 20: +#line 125 "fmd_parser.y" /* yacc.c:1646 */ { (yyval.region_listhdr) = (struct descriptor_list) {.len = 0, .head = NULL, .tail = NULL}; } -#line 1369 "y.tab.c" /* yacc.c:1646 */ +#line 1394 "y.tab.c" /* yacc.c:1646 */ break;
- case 19: -#line 124 "fmd_parser.y" /* yacc.c:1646 */ + case 22: +#line 130 "fmd_parser.y" /* yacc.c:1646 */ { (yyval.region_listhdr) = (yyvsp[-1].region_listhdr); } -#line 1375 "y.tab.c" /* yacc.c:1646 */ +#line 1400 "y.tab.c" /* yacc.c:1646 */ break;
- case 20: -#line 126 "fmd_parser.y" /* yacc.c:1646 */ + case 23: +#line 132 "fmd_parser.y" /* yacc.c:1646 */ { struct descriptor_node *node = malloc(sizeof(*node)); if (!node) { @@ -1386,11 +1411,11 @@ node->next = NULL; (yyval.region_listhdr) = (struct descriptor_list){.len = 1, .head = node, .tail = node}; } -#line 1390 "y.tab.c" /* yacc.c:1646 */ +#line 1415 "y.tab.c" /* yacc.c:1646 */ break;
- case 21: -#line 137 "fmd_parser.y" /* yacc.c:1646 */ + case 24: +#line 143 "fmd_parser.y" /* yacc.c:1646 */ { struct descriptor_node *node = malloc(sizeof(*node)); if (!node) { @@ -1404,11 +1429,11 @@ (yyval.region_listhdr) = (struct descriptor_list) {.len = (yyvsp[-1].region_listhdr).len + 1, .head = (yyvsp[-1].region_listhdr).head, .tail = node}; } -#line 1408 "y.tab.c" /* yacc.c:1646 */ +#line 1433 "y.tab.c" /* yacc.c:1646 */ break;
-#line 1412 "y.tab.c" /* yacc.c:1646 */ +#line 1437 "y.tab.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1636,7 +1661,7 @@ #endif return yyresult; } -#line 151 "fmd_parser.y" /* yacc.c:1906 */ +#line 157 "fmd_parser.y" /* yacc.c:1906 */
struct flashmap_descriptor *parse_descriptor( diff --git a/util/cbfstool/fmd_parser.h_shipped b/util/cbfstool/fmd_parser.h_shipped index 07c0259..b887753 100644 --- a/util/cbfstool/fmd_parser.h_shipped +++ b/util/cbfstool/fmd_parser.h_shipped @@ -76,7 +76,10 @@ OCTAL = 259, STRING = 260, FLAG_CBFS = 261, - FLAG_PRESERVE = 262 + FLAG_STATIC = 262, + FLAG_COMPRESSED = 263, + FLAG_RO = 264, + FLAG_PRESERVE = 265 }; #endif /* Tokens. */ @@ -84,7 +87,10 @@ #define OCTAL 259 #define STRING 260 #define FLAG_CBFS 261 -#define FLAG_PRESERVE 262 +#define FLAG_STATIC 262 +#define FLAG_COMPRESSED 263 +#define FLAG_RO 264 +#define FLAG_PRESERVE 265
/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED @@ -100,7 +106,7 @@ union flashmap_flags flags; struct descriptor_list region_listhdr;
-#line 104 "y.tab.h" /* yacc.c:1909 */ +#line 110 "y.tab.h" /* yacc.c:1909 */ };
typedef union YYSTYPE YYSTYPE; diff --git a/util/cbfstool/fmd_parser.y b/util/cbfstool/fmd_parser.y index 11652c8..f06836e 100644 --- a/util/cbfstool/fmd_parser.y +++ b/util/cbfstool/fmd_parser.y @@ -60,6 +60,9 @@ %token OCTAL %token <strval> STRING %token FLAG_CBFS +%token FLAG_STATIC +%token FLAG_COMPRESSED +%token FLAG_RO %token FLAG_PRESERVE
%type <region_ptr> flash_region @@ -108,6 +111,9 @@ | '(' region_flags ')' { $$ = $2; }; region_flags: region_flag | region_flag region_flags { $$.v = $1.v | $2.v; }; region_flag: FLAG_CBFS { $$ = (union flashmap_flags){ .f.cbfs = 1 }; }; +region_flag: FLAG_STATIC { $$ = (union flashmap_flags){ .f.is_static = 1 }; }; +region_flag: FLAG_COMPRESSED { $$ = (union flashmap_flags){ .f.compressed = 1 }; }; +region_flag: FLAG_RO { $$ = (union flashmap_flags){ .f.read_only = 1 }; }; region_flag: FLAG_PRESERVE { $$ = (union flashmap_flags){ .f.preserve = 1 }; }; region_offset_opt: { $$ = (struct unsigned_option){false, 0}; } | region_offset; diff --git a/util/cbfstool/fmd_scanner.c_shipped b/util/cbfstool/fmd_scanner.c_shipped index 71d541d..8521adc 100644 --- a/util/cbfstool/fmd_scanner.c_shipped +++ b/util/cbfstool/fmd_scanner.c_shipped @@ -363,8 +363,8 @@ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp;
-#define YY_NUM_RULES 13 -#define YY_END_OF_BUFFER 14 +#define YY_NUM_RULES 16 +#define YY_END_OF_BUFFER 17 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -372,12 +372,14 @@ flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[40] = +static yyconst flex_int16_t yy_accept[57] = { 0, - 11, 11, 11, 11, 14, 11, 1, 1, 12, 3, - 12, 7, 8, 4, 11, 11, 11, 1, 0, 2, - 9, 7, 11, 8, 8, 11, 11, 9, 10, 11, - 11, 10, 5, 11, 11, 11, 11, 6, 0 + 14, 14, 14, 14, 17, 14, 1, 1, 15, 3, + 15, 10, 11, 4, 14, 14, 14, 14, 14, 1, + 0, 2, 12, 10, 14, 11, 11, 14, 14, 14, + 8, 14, 12, 13, 14, 14, 14, 14, 13, 5, + 14, 14, 14, 14, 14, 14, 14, 14, 6, 14, + 14, 14, 9, 14, 7, 0 } ;
static yyconst YY_CHAR yy_ec[256] = @@ -388,13 +390,13 @@ 1, 2, 1, 1, 4, 1, 1, 1, 1, 5, 6, 1, 1, 1, 1, 1, 1, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, - 1, 1, 1, 9, 10, 11, 12, 10, 13, 14, - 15, 1, 1, 1, 15, 1, 15, 1, 1, 16, - 1, 17, 18, 1, 1, 19, 1, 20, 1, 1, - 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, + 1, 1, 1, 9, 10, 11, 12, 13, 14, 15, + 16, 1, 17, 1, 16, 1, 18, 1, 19, 20, + 1, 21, 22, 23, 1, 24, 1, 25, 1, 1, + 1, 1, 1, 1, 1, 1, 26, 26, 26, 26,
- 10, 10, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 20, + 26, 26, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 25, 1, 1, 9, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -412,54 +414,69 @@ 1, 1, 1, 1, 1 } ;
-static yyconst YY_CHAR yy_meta[21] = +static yyconst YY_CHAR yy_meta[27] = { 0, 1, 2, 2, 2, 2, 2, 1, 1, 2, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1 } ;
-static yyconst flex_uint16_t yy_base[43] = +static yyconst flex_uint16_t yy_base[60] = { 0, - 0, 8, 12, 13, 63, 0, 18, 20, 59, 64, - 64, 23, 19, 64, 50, 43, 0, 30, 56, 64, - 20, 0, 37, 0, 0, 44, 44, 0, 41, 28, - 24, 0, 0, 28, 22, 18, 23, 0, 64, 51, - 0, 53 + 0, 8, 12, 29, 73, 0, 17, 19, 66, 107, + 107, 45, 64, 107, 12, 47, 48, 43, 0, 23, + 62, 107, 11, 0, 76, 0, 0, 49, 44, 46, + 0, 49, 0, 12, 36, 37, 34, 32, 0, 0, + 33, 34, 30, 32, 24, 32, 21, 18, 0, 18, + 25, 24, 0, 24, 0, 107, 102, 0, 104 } ;
-static yyconst flex_int16_t yy_def[43] = +static yyconst flex_int16_t yy_def[60] = { 0, - 40, 40, 2, 2, 39, 41, 39, 39, 42, 39, - 39, 41, 41, 39, 41, 41, 41, 39, 42, 39, - 12, 41, 41, 13, 41, 41, 41, 41, 23, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 0, 39, - 39, 39 + 57, 57, 2, 2, 56, 58, 56, 56, 59, 56, + 56, 58, 58, 56, 58, 58, 58, 58, 58, 56, + 59, 56, 12, 58, 58, 13, 58, 58, 58, 58, + 58, 58, 58, 25, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 0, 56, 56, 56 } ;
-static yyconst flex_uint16_t yy_nxt[85] = +static yyconst flex_uint16_t yy_nxt[134] = { 0, - 17, 7, 8, 9, 10, 11, 12, 13, 11, 7, - 8, 9, 10, 11, 12, 13, 11, 14, 14, 18, - 18, 18, 18, 15, 15, 24, 24, 16, 16, 21, - 21, 18, 18, 25, 28, 38, 37, 22, 36, 17, - 35, 34, 23, 29, 29, 33, 29, 29, 29, 29, - 29, 6, 6, 19, 19, 32, 31, 30, 20, 27, - 26, 20, 39, 5, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39 + 19, 7, 8, 9, 10, 11, 12, 13, 11, 7, + 8, 9, 10, 11, 12, 13, 11, 14, 20, 20, + 20, 20, 28, 15, 20, 20, 33, 39, 33, 39, + 29, 16, 17, 18, 14, 19, 55, 54, 53, 52, + 15, 51, 50, 49, 48, 47, 46, 45, 16, 17, + 18, 23, 23, 44, 43, 42, 41, 40, 38, 37, + 24, 36, 24, 35, 22, 32, 31, 30, 22, 25, + 26, 26, 56, 56, 56, 56, 56, 56, 56, 27, + 56, 27, 34, 34, 56, 34, 34, 34, 34, 34, + 34, 56, 56, 56, 56, 56, 56, 56, 56, 56, + + 56, 34, 6, 6, 21, 21, 5, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56 } ;
-static yyconst flex_int16_t yy_chk[85] = +static yyconst flex_int16_t yy_chk[134] = { 0, - 41, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 3, 4, 7, - 7, 8, 8, 3, 4, 13, 13, 3, 4, 12, - 12, 18, 18, 13, 21, 37, 36, 12, 35, 21, - 34, 31, 12, 23, 23, 30, 23, 23, 23, 23, - 23, 40, 40, 42, 42, 29, 27, 26, 19, 16, - 15, 9, 5, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39 + 58, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 2, 2, 3, 7, 7, + 8, 8, 15, 3, 20, 20, 23, 34, 23, 34, + 15, 3, 3, 3, 4, 23, 54, 52, 51, 50, + 4, 48, 47, 46, 45, 44, 43, 42, 4, 4, + 4, 12, 12, 41, 38, 37, 36, 35, 32, 30, + 12, 29, 12, 28, 21, 18, 17, 16, 9, 12, + 13, 13, 5, 0, 0, 0, 0, 0, 0, 13, + 0, 13, 25, 25, 0, 25, 25, 25, 25, 25, + 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 25, 57, 57, 59, 59, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56 } ;
static yy_state_type yy_last_accepting_state; @@ -500,7 +517,7 @@ int parse_integer(char *src, int base); int copy_string(const char *src);
-#line 504 "<stdout>" +#line 521 "<stdout>"
#define INITIAL 0 #define FLAGS 1 @@ -721,7 +738,7 @@ { #line 31 "fmd_scanner.l"
-#line 725 "<stdout>" +#line 742 "<stdout>"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -748,13 +765,13 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 40 ) + if ( yy_current_state >= 57 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 64 ); + while ( yy_base[yy_current_state] != 107 );
yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -810,41 +827,56 @@ case 6: YY_RULE_SETUP #line 37 "fmd_scanner.l" -return FLAG_PRESERVE; +return FLAG_STATIC; YY_BREAK case 7: -#line 39 "fmd_scanner.l" +YY_RULE_SETUP +#line 38 "fmd_scanner.l" +return FLAG_COMPRESSED; + YY_BREAK case 8: YY_RULE_SETUP #line 39 "fmd_scanner.l" -return parse_integer(yytext, 10); +return FLAG_RO; YY_BREAK case 9: YY_RULE_SETUP #line 40 "fmd_scanner.l" -return OCTAL; +return FLAG_PRESERVE; YY_BREAK case 10: -YY_RULE_SETUP -#line 41 "fmd_scanner.l" -return parse_integer(yytext + 2, 16); - YY_BREAK +#line 42 "fmd_scanner.l" case 11: YY_RULE_SETUP #line 42 "fmd_scanner.l" -return copy_string(yytext); +return parse_integer(yytext, 10); YY_BREAK case 12: YY_RULE_SETUP #line 43 "fmd_scanner.l" -return *yytext; +return OCTAL; YY_BREAK case 13: YY_RULE_SETUP +#line 44 "fmd_scanner.l" +return parse_integer(yytext + 2, 16); + YY_BREAK +case 14: +YY_RULE_SETUP #line 45 "fmd_scanner.l" +return copy_string(yytext); + YY_BREAK +case 15: +YY_RULE_SETUP +#line 46 "fmd_scanner.l" +return *yytext; + YY_BREAK +case 16: +YY_RULE_SETUP +#line 48 "fmd_scanner.l" ECHO; YY_BREAK -#line 848 "<stdout>" +#line 880 "<stdout>" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(FLAGS): yyterminate(); @@ -1138,7 +1170,7 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 40 ) + if ( yy_current_state >= 57 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; @@ -1166,11 +1198,11 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 40 ) + if ( yy_current_state >= 57 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; - yy_is_jam = (yy_current_state == 39); + yy_is_jam = (yy_current_state == 56);
return yy_is_jam ? 0 : yy_current_state; } @@ -1846,7 +1878,7 @@
#define YYTABLES_NAME "yytables"
-#line 45 "fmd_scanner.l" +#line 48 "fmd_scanner.l"
diff --git a/util/cbfstool/fmd_scanner.h_shipped b/util/cbfstool/fmd_scanner.h_shipped index 2a8b291..822fb57 100644 --- a/util/cbfstool/fmd_scanner.h_shipped +++ b/util/cbfstool/fmd_scanner.h_shipped @@ -317,7 +317,7 @@ #undef YY_DECL #endif
-#line 45 "fmd_scanner.l" +#line 48 "fmd_scanner.l"
#line 324 "fmd_scanner.h_shipped" diff --git a/util/cbfstool/fmd_scanner.l b/util/cbfstool/fmd_scanner.l index be9a5de..e2337cd 100644 --- a/util/cbfstool/fmd_scanner.l +++ b/util/cbfstool/fmd_scanner.l @@ -34,6 +34,9 @@ ( BEGIN(FLAGS); return *yytext; <FLAGS>) BEGIN(INITIAL); return *yytext; <FLAGS>CBFS return FLAG_CBFS; +<FLAGS>STATIC return FLAG_STATIC; +<FLAGS>COMPRESSED return FLAG_COMPRESSED; +<FLAGS>RO return FLAG_RO; <FLAGS>PRESERVE return FLAG_PRESERVE; 0{MULTIPLIER}? | [1-9][0-9]*{MULTIPLIER}? return parse_integer(yytext, 10);
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31708
to look at the new patch set (#3).
Change subject: cbfstool: Support all FMAP flags for FMD ......................................................................
cbfstool: Support all FMAP flags for FMD
The FMAP area_flag also supports STATIC, RO, COMPRESSED and we do want to allow them all in FMD.
BUG=chromium:936768 TEST=make; boots an x86 image. Manually added RO, STATIC, COMPRESSED to FMD entries and verified output.
Change-Id: I7b84ce55c0a120061b285b69c51f37e6663fdb66 Signed-off-by: Hung-Te Lin hungte@chromium.org --- M util/cbfstool/fmap_from_fmd.c M util/cbfstool/fmd.h M util/cbfstool/fmd_parser.c_shipped M util/cbfstool/fmd_parser.h_shipped M util/cbfstool/fmd_parser.y M util/cbfstool/fmd_scanner.c_shipped M util/cbfstool/fmd_scanner.h_shipped M util/cbfstool/fmd_scanner.l 8 files changed, 242 insertions(+), 161 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/31708/3
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31708 )
Change subject: cbfstool: Support all FMAP flags for FMD ......................................................................
Patch Set 3: Code-Review+2
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31708 )
Change subject: cbfstool: Support all FMAP flags for FMD ......................................................................
Patch Set 3:
Is this a good idea? AFAIK none of these flags have a well-defined meaning anymore, so I think allowing people to set them would just open possibilities for confusion. If we ever decide to reactivate one of these and give them new meaning we can still add this at that point, but it would probably be better to not offer them beforehand (otherwise people may start adding them for vague reasons even though they don't do anything, and then if we later decide to reuse them we'll have all these old images with flags set that don't conform to the new meaning).
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31708 )
Change subject: cbfstool: Support all FMAP flags for FMD ......................................................................
Patch Set 3:
Will abandon this. Probably just consider it for reference.
Hung-Te Lin has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/31708 )
Change subject: cbfstool: Support all FMAP flags for FMD ......................................................................
Abandoned
The flags defined are not really used today (yet).