1 From 61ad4b70c72fd7d1d3930b50e180d9727eeae150 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 10 Aug 2015 09:49:15 +0100
4 Subject: [PATCH] scripts/dtc: Update to upstream version 1.4.1
6 Includes the new localfixups format.
8 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
10 scripts/dtc: Fix UMR causing corrupt dtbo overlay files
12 struct fixup_entry is allocated from the heap but it's member
13 local_fixup_generated was never initialized. This lead to
16 Fix this by initializing local_fixup_generated to false.
18 Signed-off-by: Matthias Reichl <hias@horus.com>
20 scripts/dtc: Only emit local fixups for overlays
22 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
24 scripts/dtc/checks.c | 106 +++++-
25 scripts/dtc/dtc-lexer.l | 5 +
26 scripts/dtc/dtc-lexer.lex.c_shipped | 537 +++++++++++++-------------
27 scripts/dtc/dtc-parser.tab.c_shipped | 714 ++++++++++++++++++-----------------
28 scripts/dtc/dtc-parser.tab.h_shipped | 46 +--
29 scripts/dtc/dtc-parser.y | 22 +-
30 scripts/dtc/dtc.c | 9 +-
31 scripts/dtc/dtc.h | 40 ++
32 scripts/dtc/flattree.c | 202 ++++++++++
33 scripts/dtc/version_gen.h | 2 +-
34 10 files changed, 1029 insertions(+), 654 deletions(-)
36 --- a/scripts/dtc/checks.c
37 +++ b/scripts/dtc/checks.c
38 @@ -482,6 +482,8 @@ static void fixup_phandle_references(str
39 struct node *node, struct property *prop)
41 struct marker *m = prop->val.markers;
42 + struct fixup *f, **fp;
43 + struct fixup_entry *fe, **fep;
47 @@ -490,11 +492,70 @@ static void fixup_phandle_references(str
49 refnode = get_node_by_ref(dt, m->ref);
51 - FAIL(c, "Reference to non-existent node or label \"%s\"\n",
53 + if (!dt->is_plugin) {
54 + FAIL(c, "Reference to non-existent node or label \"%s\"\n",
59 + /* allocate fixup entry */
60 + fe = xmalloc(sizeof(*fe));
64 + fe->offset = m->offset;
67 + /* search for an already existing fixup */
68 + for_each_fixup(dt, f)
69 + if (strcmp(f->ref, m->ref) == 0)
72 + /* no fixup found, add new */
74 + f = xmalloc(sizeof(*f));
79 + /* add it to the tree */
86 + /* and now append fixup entry */
89 + fep = &(*fep)->next;
92 + /* mark the entry as unresolved */
93 + *((cell_t *)(prop->val.val + m->offset)) =
94 + cpu_to_fdt32(0xdeadbeef);
98 + /* if it's a local reference, we need to record it */
99 + if (symbol_fixup_support && dt->is_plugin) {
101 + /* allocate a new local fixup entry */
102 + fe = xmalloc(sizeof(*fe));
106 + fe->offset = m->offset;
108 + fe->local_fixup_generated = false;
110 + /* append it to the local fixups */
111 + fep = &dt->local_fixups;
113 + fep = &(*fep)->next;
117 phandle = get_node_phandle(dt, refnode);
118 *((cell_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle);
120 @@ -676,6 +737,45 @@ static void check_obsolete_chosen_interr
122 TREE_WARNING(obsolete_chosen_interrupt_controller, NULL);
124 +static void check_auto_label_phandles(struct check *c, struct node *dt,
128 + struct symbol *s, **sp;
131 + if (!symbol_fixup_support)
135 + for_each_label(node->labels, l) {
143 + /* force allocation of a phandle for this node */
144 + (void)get_node_phandle(dt, node);
146 + /* add the symbol */
147 + for_each_label(node->labels, l) {
149 + s = xmalloc(sizeof(*s));
154 + /* add it to the symbols list */
157 + sp = &((*sp)->next);
161 +NODE_WARNING(auto_label_phandles, NULL);
163 static struct check *check_table[] = {
164 &duplicate_node_names, &duplicate_property_names,
165 &node_name_chars, &node_name_format, &property_name_chars,
166 @@ -696,6 +796,8 @@ static struct check *check_table[] = {
167 &avoid_default_addr_size,
168 &obsolete_chosen_interrupt_controller,
170 + &auto_label_phandles,
175 --- a/scripts/dtc/dtc-lexer.l
176 +++ b/scripts/dtc/dtc-lexer.l
177 @@ -121,6 +121,11 @@ static void lexical_error(const char *fm
182 + DPRINT("Keyword: /plugin/\n");
187 DPRINT("Keyword: /memreserve/\n");
189 --- a/scripts/dtc/dtc-lexer.lex.c_shipped
190 +++ b/scripts/dtc/dtc-lexer.lex.c_shipped
193 #define YY_FLEX_MAJOR_VERSION 2
194 #define YY_FLEX_MINOR_VERSION 5
195 -#define YY_FLEX_SUBMINOR_VERSION 39
196 +#define YY_FLEX_SUBMINOR_VERSION 35
197 #if YY_FLEX_SUBMINOR_VERSION > 0
200 @@ -162,12 +162,7 @@ typedef unsigned int flex_uint32_t;
201 typedef struct yy_buffer_state *YY_BUFFER_STATE;
204 -#ifndef YY_TYPEDEF_YY_SIZE_T
205 -#define YY_TYPEDEF_YY_SIZE_T
206 -typedef size_t yy_size_t;
209 -extern yy_size_t yyleng;
212 extern FILE *yyin, *yyout;
214 @@ -176,7 +171,6 @@ extern FILE *yyin, *yyout;
215 #define EOB_ACT_LAST_MATCH 2
217 #define YY_LESS_LINENO(n)
218 - #define YY_LINENO_REWIND_TO(ptr)
220 /* Return all but the first "n" matched characters back to the input stream. */
222 @@ -194,6 +188,11 @@ extern FILE *yyin, *yyout;
224 #define unput(c) yyunput( c, (yytext_ptr) )
226 +#ifndef YY_TYPEDEF_YY_SIZE_T
227 +#define YY_TYPEDEF_YY_SIZE_T
228 +typedef size_t yy_size_t;
231 #ifndef YY_STRUCT_YY_BUFFER_STATE
232 #define YY_STRUCT_YY_BUFFER_STATE
233 struct yy_buffer_state
234 @@ -211,7 +210,7 @@ struct yy_buffer_state
235 /* Number of characters read into yy_ch_buf, not including EOB
238 - yy_size_t yy_n_chars;
241 /* Whether we "own" the buffer - i.e., we know we created it,
242 * and can realloc() it to grow it, and should free() it to
243 @@ -281,8 +280,8 @@ static YY_BUFFER_STATE * yy_buffer_stack
245 /* yy_hold_char holds the character lost when yytext is formed. */
246 static char yy_hold_char;
247 -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
249 +static int yy_n_chars; /* number of characters read into yy_ch_buf */
252 /* Points to current character in buffer. */
253 static char *yy_c_buf_p = (char *) 0;
254 @@ -310,7 +309,7 @@ static void yy_init_buffer (YY_BUFFER_ST
256 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
257 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
258 -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
259 +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
261 void *yyalloc (yy_size_t );
262 void *yyrealloc (void *,yy_size_t );
263 @@ -342,7 +341,7 @@ void yyfree (void * );
265 /* Begin user sect3 */
269 #define YY_SKIP_YYWRAP
271 typedef unsigned char YY_CHAR;
272 @@ -373,8 +372,8 @@ static void yy_fatal_error (yyconst char
274 (yy_c_buf_p) = yy_cp;
276 -#define YY_NUM_RULES 30
277 -#define YY_END_OF_BUFFER 31
278 +#define YY_NUM_RULES 31
279 +#define YY_END_OF_BUFFER 32
280 /* This struct is not used in this scanner,
281 but its presence is necessary. */
283 @@ -382,25 +381,26 @@ struct yy_trans_info
284 flex_int32_t yy_verify;
287 -static yyconst flex_int16_t yy_accept[159] =
288 +static yyconst flex_int16_t yy_accept[166] =
290 - 0, 0, 0, 0, 0, 0, 0, 0, 31, 29,
291 - 18, 18, 29, 29, 29, 29, 29, 29, 29, 29,
292 - 29, 29, 29, 29, 29, 29, 15, 16, 16, 29,
293 - 16, 10, 10, 18, 26, 0, 3, 0, 27, 12,
294 - 0, 0, 11, 0, 0, 0, 0, 0, 0, 0,
295 - 21, 23, 25, 24, 22, 0, 9, 28, 0, 0,
296 - 0, 14, 14, 16, 16, 16, 10, 10, 10, 0,
297 - 12, 0, 11, 0, 0, 0, 20, 0, 0, 0,
298 - 0, 0, 0, 0, 0, 16, 10, 10, 10, 0,
299 - 13, 19, 0, 0, 0, 0, 0, 0, 0, 0,
301 - 0, 16, 0, 0, 0, 0, 0, 0, 0, 0,
302 - 0, 16, 6, 0, 0, 0, 0, 0, 0, 2,
303 - 0, 0, 0, 0, 0, 0, 0, 0, 4, 17,
304 - 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
305 - 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
306 - 5, 8, 0, 0, 0, 0, 7, 0
307 + 0, 0, 0, 0, 0, 0, 0, 0, 32, 30,
308 + 19, 19, 30, 30, 30, 30, 30, 30, 30, 30,
309 + 30, 30, 30, 30, 30, 30, 16, 17, 17, 30,
310 + 17, 11, 11, 19, 27, 0, 3, 0, 28, 13,
311 + 0, 0, 12, 0, 0, 0, 0, 0, 0, 0,
312 + 0, 22, 24, 26, 25, 23, 0, 10, 29, 0,
313 + 0, 0, 15, 15, 17, 17, 17, 11, 11, 11,
314 + 0, 13, 0, 12, 0, 0, 0, 21, 0, 0,
315 + 0, 0, 0, 0, 0, 0, 0, 17, 11, 11,
316 + 11, 0, 14, 20, 0, 0, 0, 0, 0, 0,
318 + 0, 0, 0, 0, 17, 0, 0, 0, 0, 0,
319 + 0, 0, 0, 0, 0, 17, 7, 0, 0, 0,
320 + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
321 + 0, 0, 0, 0, 4, 18, 0, 0, 5, 2,
322 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
323 + 0, 0, 1, 0, 0, 0, 0, 6, 9, 0,
327 static yyconst flex_int32_t yy_ec[256] =
328 @@ -416,9 +416,9 @@ static yyconst flex_int32_t yy_ec[256] =
329 22, 22, 22, 22, 24, 22, 22, 25, 22, 22,
330 1, 26, 27, 1, 22, 1, 21, 28, 29, 30,
332 - 31, 21, 22, 22, 32, 22, 22, 33, 34, 35,
333 - 36, 37, 22, 38, 39, 40, 41, 42, 22, 25,
334 - 43, 22, 44, 45, 46, 1, 1, 1, 1, 1,
335 + 31, 21, 32, 22, 33, 22, 22, 34, 35, 36,
336 + 37, 38, 22, 39, 40, 41, 42, 43, 22, 25,
337 + 44, 22, 45, 46, 47, 1, 1, 1, 1, 1,
338 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
339 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
340 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
341 @@ -435,163 +435,165 @@ static yyconst flex_int32_t yy_ec[256] =
345 -static yyconst flex_int32_t yy_meta[47] =
346 +static yyconst flex_int32_t yy_meta[48] =
348 1, 1, 1, 1, 1, 1, 2, 3, 1, 2,
349 2, 2, 4, 5, 5, 5, 6, 1, 1, 1,
350 7, 8, 8, 8, 8, 1, 1, 7, 7, 7,
351 7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
353 + 8, 8, 8, 8, 3, 1, 4
356 -static yyconst flex_int16_t yy_base[173] =
357 +static yyconst flex_int16_t yy_base[180] =
359 - 0, 383, 34, 382, 65, 381, 37, 105, 387, 391,
360 - 54, 111, 367, 110, 109, 109, 112, 41, 366, 104,
361 - 367, 338, 124, 117, 0, 144, 391, 0, 121, 0,
362 - 135, 155, 140, 179, 391, 160, 391, 379, 391, 0,
363 - 368, 141, 391, 167, 370, 376, 346, 103, 342, 345,
364 - 391, 391, 391, 391, 391, 358, 391, 391, 175, 342,
365 - 338, 391, 355, 0, 185, 339, 184, 347, 346, 0,
366 - 0, 322, 175, 357, 175, 363, 352, 324, 330, 323,
367 - 332, 326, 201, 324, 329, 322, 391, 333, 181, 309,
368 - 391, 341, 340, 313, 320, 338, 178, 311, 146, 317,
370 - 314, 315, 335, 331, 303, 300, 309, 299, 308, 188,
371 - 336, 335, 391, 305, 320, 281, 283, 271, 203, 288,
372 - 281, 271, 266, 264, 245, 242, 208, 104, 391, 391,
373 - 244, 218, 204, 219, 206, 224, 201, 212, 204, 229,
374 - 215, 208, 207, 200, 219, 391, 233, 221, 200, 181,
375 - 391, 391, 149, 122, 86, 41, 391, 391, 245, 251,
376 - 259, 263, 267, 273, 280, 284, 292, 300, 304, 310,
378 + 0, 393, 35, 392, 66, 391, 38, 107, 397, 401,
379 + 55, 113, 377, 112, 111, 111, 114, 42, 376, 106,
380 + 377, 347, 126, 120, 0, 147, 401, 0, 124, 0,
381 + 137, 158, 170, 163, 401, 153, 401, 389, 401, 0,
382 + 378, 120, 401, 131, 380, 386, 355, 139, 351, 355,
383 + 351, 401, 401, 401, 401, 401, 367, 401, 401, 185,
384 + 350, 346, 401, 364, 0, 185, 347, 189, 356, 355,
385 + 0, 0, 330, 180, 366, 141, 372, 361, 332, 338,
386 + 331, 341, 334, 326, 205, 331, 337, 329, 401, 341,
387 + 167, 316, 401, 349, 348, 320, 328, 346, 180, 318,
389 + 324, 209, 324, 320, 322, 342, 338, 309, 306, 315,
390 + 305, 315, 312, 192, 342, 341, 401, 293, 306, 282,
391 + 268, 252, 255, 203, 285, 282, 272, 268, 252, 233,
392 + 232, 239, 208, 107, 401, 401, 238, 211, 401, 211,
393 + 212, 208, 228, 203, 215, 207, 233, 222, 212, 211,
394 + 203, 227, 401, 237, 225, 204, 185, 401, 401, 149,
395 + 128, 88, 42, 401, 401, 253, 259, 267, 271, 275,
396 + 281, 288, 292, 300, 308, 312, 318, 326, 334
399 -static yyconst flex_int16_t yy_def[173] =
400 +static yyconst flex_int16_t yy_def[180] =
402 - 158, 1, 1, 3, 158, 5, 1, 1, 158, 158,
403 - 158, 158, 158, 159, 160, 161, 158, 158, 158, 158,
404 - 162, 158, 158, 158, 163, 162, 158, 164, 165, 164,
405 - 164, 158, 158, 158, 158, 159, 158, 159, 158, 166,
406 - 158, 161, 158, 161, 167, 168, 158, 158, 158, 158,
407 - 158, 158, 158, 158, 158, 162, 158, 158, 158, 158,
408 - 158, 158, 162, 164, 165, 164, 158, 158, 158, 169,
409 - 166, 170, 161, 167, 167, 168, 158, 158, 158, 158,
410 - 158, 158, 158, 158, 158, 164, 158, 158, 169, 170,
411 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
413 - 158, 164, 158, 158, 158, 158, 158, 158, 158, 171,
414 - 158, 164, 158, 158, 158, 158, 158, 158, 171, 158,
415 - 171, 158, 158, 158, 158, 158, 158, 158, 158, 158,
416 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
417 - 172, 158, 158, 158, 172, 158, 172, 158, 158, 158,
418 - 158, 158, 158, 158, 158, 158, 158, 0, 158, 158,
419 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
421 + 165, 1, 1, 3, 165, 5, 1, 1, 165, 165,
422 + 165, 165, 165, 166, 167, 168, 165, 165, 165, 165,
423 + 169, 165, 165, 165, 170, 169, 165, 171, 172, 171,
424 + 171, 165, 165, 165, 165, 166, 165, 166, 165, 173,
425 + 165, 168, 165, 168, 174, 175, 165, 165, 165, 165,
426 + 165, 165, 165, 165, 165, 165, 169, 165, 165, 165,
427 + 165, 165, 165, 169, 171, 172, 171, 165, 165, 165,
428 + 176, 173, 177, 168, 174, 174, 175, 165, 165, 165,
429 + 165, 165, 165, 165, 165, 165, 165, 171, 165, 165,
430 + 176, 177, 165, 165, 165, 165, 165, 165, 165, 165,
432 + 165, 165, 165, 165, 171, 165, 165, 165, 165, 165,
433 + 165, 165, 165, 178, 165, 171, 165, 165, 165, 165,
434 + 165, 165, 165, 178, 165, 178, 165, 165, 165, 165,
435 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
436 + 165, 165, 165, 165, 165, 165, 165, 179, 165, 165,
437 + 165, 179, 165, 179, 165, 165, 165, 165, 165, 165,
438 + 165, 165, 165, 165, 0, 165, 165, 165, 165, 165,
439 + 165, 165, 165, 165, 165, 165, 165, 165, 165
442 -static yyconst flex_int16_t yy_nxt[438] =
443 +static yyconst flex_int16_t yy_nxt[449] =
445 10, 11, 12, 11, 13, 14, 10, 15, 16, 10,
446 10, 10, 17, 10, 10, 10, 10, 18, 19, 20,
447 21, 21, 21, 21, 21, 10, 10, 21, 21, 21,
448 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
449 - 21, 21, 21, 10, 22, 10, 24, 25, 25, 25,
450 - 32, 33, 33, 157, 26, 34, 34, 34, 51, 52,
451 - 27, 26, 26, 26, 26, 10, 11, 12, 11, 13,
452 - 14, 28, 15, 16, 28, 28, 28, 24, 28, 28,
453 - 28, 10, 18, 19, 20, 29, 29, 29, 29, 29,
454 - 30, 10, 29, 29, 29, 29, 29, 29, 29, 29,
456 - 29, 29, 29, 29, 29, 29, 29, 29, 10, 22,
457 - 10, 23, 34, 34, 34, 37, 39, 43, 32, 33,
458 - 33, 45, 54, 55, 46, 59, 45, 64, 156, 46,
459 - 64, 64, 64, 79, 44, 38, 59, 57, 134, 47,
460 - 135, 48, 80, 49, 47, 50, 48, 99, 61, 43,
461 - 50, 110, 41, 67, 67, 67, 60, 63, 63, 63,
462 - 57, 155, 68, 69, 63, 37, 44, 66, 67, 67,
463 - 67, 63, 63, 63, 63, 73, 59, 68, 69, 70,
464 - 34, 34, 34, 43, 75, 38, 154, 92, 83, 83,
465 - 83, 64, 44, 120, 64, 64, 64, 67, 67, 67,
467 - 44, 57, 99, 68, 69, 107, 68, 69, 120, 127,
468 - 108, 153, 152, 121, 83, 83, 83, 133, 133, 133,
469 - 146, 133, 133, 133, 146, 140, 140, 140, 121, 141,
470 - 140, 140, 140, 151, 141, 158, 150, 149, 148, 144,
471 - 147, 143, 142, 139, 147, 36, 36, 36, 36, 36,
472 - 36, 36, 36, 40, 138, 137, 136, 40, 40, 42,
473 - 42, 42, 42, 42, 42, 42, 42, 56, 56, 56,
474 - 56, 62, 132, 62, 64, 131, 130, 64, 129, 64,
475 - 64, 65, 128, 158, 65, 65, 65, 65, 71, 127,
476 - 71, 71, 74, 74, 74, 74, 74, 74, 74, 74,
478 - 76, 76, 76, 76, 76, 76, 76, 76, 89, 126,
479 - 89, 90, 125, 90, 90, 124, 90, 90, 119, 119,
480 - 119, 119, 119, 119, 119, 119, 145, 145, 145, 145,
481 - 145, 145, 145, 145, 123, 122, 59, 59, 118, 117,
482 - 116, 115, 114, 113, 45, 112, 108, 111, 109, 106,
483 - 105, 104, 46, 103, 91, 87, 102, 101, 100, 98,
484 - 97, 96, 95, 94, 93, 77, 75, 91, 88, 87,
485 - 86, 57, 85, 84, 57, 82, 81, 78, 77, 75,
486 - 72, 158, 58, 57, 53, 35, 158, 31, 23, 23,
487 - 9, 158, 158, 158, 158, 158, 158, 158, 158, 158,
489 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
490 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
491 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
492 - 158, 158, 158, 158, 158, 158, 158
493 + 21, 21, 21, 21, 10, 22, 10, 24, 25, 25,
494 + 25, 32, 33, 33, 164, 26, 34, 34, 34, 52,
495 + 53, 27, 26, 26, 26, 26, 10, 11, 12, 11,
496 + 13, 14, 28, 15, 16, 28, 28, 28, 24, 28,
497 + 28, 28, 10, 18, 19, 20, 29, 29, 29, 29,
498 + 29, 30, 10, 29, 29, 29, 29, 29, 29, 29,
500 + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
501 + 10, 22, 10, 23, 34, 34, 34, 37, 39, 43,
502 + 32, 33, 33, 45, 55, 56, 46, 60, 43, 45,
503 + 65, 163, 46, 65, 65, 65, 44, 38, 60, 74,
504 + 58, 47, 141, 48, 142, 44, 49, 47, 50, 48,
505 + 76, 51, 62, 94, 50, 41, 44, 51, 37, 61,
506 + 64, 64, 64, 58, 34, 34, 34, 64, 162, 80,
507 + 67, 68, 68, 68, 64, 64, 64, 64, 38, 81,
508 + 69, 70, 71, 68, 68, 68, 60, 161, 43, 69,
509 + 70, 65, 69, 70, 65, 65, 65, 125, 85, 85,
511 + 85, 58, 68, 68, 68, 44, 102, 110, 125, 133,
512 + 102, 69, 70, 111, 114, 160, 159, 126, 85, 85,
513 + 85, 140, 140, 140, 140, 140, 140, 153, 126, 147,
514 + 147, 147, 153, 148, 147, 147, 147, 158, 148, 165,
515 + 157, 156, 155, 151, 150, 149, 146, 154, 145, 144,
516 + 143, 139, 154, 36, 36, 36, 36, 36, 36, 36,
517 + 36, 40, 138, 137, 136, 40, 40, 42, 42, 42,
518 + 42, 42, 42, 42, 42, 57, 57, 57, 57, 63,
519 + 135, 63, 65, 134, 165, 65, 133, 65, 65, 66,
520 + 132, 131, 66, 66, 66, 66, 72, 130, 72, 72,
522 + 75, 75, 75, 75, 75, 75, 75, 75, 77, 77,
523 + 77, 77, 77, 77, 77, 77, 91, 129, 91, 92,
524 + 128, 92, 92, 127, 92, 92, 124, 124, 124, 124,
525 + 124, 124, 124, 124, 152, 152, 152, 152, 152, 152,
526 + 152, 152, 60, 60, 123, 122, 121, 120, 119, 118,
527 + 117, 45, 116, 111, 115, 113, 112, 109, 108, 107,
528 + 46, 106, 93, 89, 105, 104, 103, 101, 100, 99,
529 + 98, 97, 96, 95, 78, 76, 93, 90, 89, 88,
530 + 58, 87, 86, 58, 84, 83, 82, 79, 78, 76,
531 + 73, 165, 59, 58, 54, 35, 165, 31, 23, 23,
533 + 9, 165, 165, 165, 165, 165, 165, 165, 165, 165,
534 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
535 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
536 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
537 + 165, 165, 165, 165, 165, 165, 165, 165
540 -static yyconst flex_int16_t yy_chk[438] =
541 +static yyconst flex_int16_t yy_chk[449] =
543 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
544 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
545 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
546 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
547 - 1, 1, 1, 1, 1, 1, 3, 3, 3, 3,
548 - 7, 7, 7, 156, 3, 11, 11, 11, 18, 18,
549 - 3, 3, 3, 3, 3, 5, 5, 5, 5, 5,
550 + 1, 1, 1, 1, 1, 1, 1, 3, 3, 3,
551 + 3, 7, 7, 7, 163, 3, 11, 11, 11, 18,
552 + 18, 3, 3, 3, 3, 3, 5, 5, 5, 5,
553 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
554 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
555 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
557 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
558 - 5, 8, 12, 12, 12, 14, 15, 16, 8, 8,
559 - 8, 17, 20, 20, 17, 23, 24, 29, 155, 24,
560 - 29, 29, 29, 48, 16, 14, 31, 29, 128, 17,
561 - 128, 17, 48, 17, 24, 17, 24, 99, 24, 42,
562 - 24, 99, 15, 33, 33, 33, 23, 26, 26, 26,
563 - 26, 154, 33, 33, 26, 36, 42, 31, 32, 32,
564 - 32, 26, 26, 26, 26, 44, 59, 32, 32, 32,
565 - 34, 34, 34, 73, 75, 36, 153, 75, 59, 59,
566 - 59, 65, 44, 110, 65, 65, 65, 67, 67, 67,
568 - 73, 65, 83, 89, 89, 97, 67, 67, 119, 127,
569 - 97, 150, 149, 110, 83, 83, 83, 133, 133, 133,
570 - 141, 127, 127, 127, 145, 136, 136, 136, 119, 136,
571 - 140, 140, 140, 148, 140, 147, 144, 143, 142, 139,
572 - 141, 138, 137, 135, 145, 159, 159, 159, 159, 159,
573 - 159, 159, 159, 160, 134, 132, 131, 160, 160, 161,
574 - 161, 161, 161, 161, 161, 161, 161, 162, 162, 162,
575 - 162, 163, 126, 163, 164, 125, 124, 164, 123, 164,
576 - 164, 165, 122, 121, 165, 165, 165, 165, 166, 120,
577 - 166, 166, 167, 167, 167, 167, 167, 167, 167, 167,
579 - 168, 168, 168, 168, 168, 168, 168, 168, 169, 118,
580 - 169, 170, 117, 170, 170, 116, 170, 170, 171, 171,
581 - 171, 171, 171, 171, 171, 171, 172, 172, 172, 172,
582 - 172, 172, 172, 172, 115, 114, 112, 111, 109, 108,
583 - 107, 106, 105, 104, 103, 102, 101, 100, 98, 96,
584 - 95, 94, 93, 92, 90, 88, 86, 85, 84, 82,
585 - 81, 80, 79, 78, 77, 76, 74, 72, 69, 68,
586 - 66, 63, 61, 60, 56, 50, 49, 47, 46, 45,
587 + 5, 5, 5, 8, 12, 12, 12, 14, 15, 16,
588 + 8, 8, 8, 17, 20, 20, 17, 23, 42, 24,
589 + 29, 162, 24, 29, 29, 29, 16, 14, 31, 44,
590 + 29, 17, 134, 17, 134, 42, 17, 24, 17, 24,
591 + 76, 17, 24, 76, 24, 15, 44, 24, 36, 23,
592 + 26, 26, 26, 26, 34, 34, 34, 26, 161, 48,
593 + 31, 32, 32, 32, 26, 26, 26, 26, 36, 48,
594 + 32, 32, 32, 33, 33, 33, 60, 160, 74, 91,
595 + 91, 66, 33, 33, 66, 66, 66, 114, 60, 60,
597 + 60, 66, 68, 68, 68, 74, 85, 99, 124, 133,
598 + 102, 68, 68, 99, 102, 157, 156, 114, 85, 85,
599 + 85, 133, 133, 133, 140, 140, 140, 148, 124, 143,
600 + 143, 143, 152, 143, 147, 147, 147, 155, 147, 154,
601 + 151, 150, 149, 146, 145, 144, 142, 148, 141, 138,
602 + 137, 132, 152, 166, 166, 166, 166, 166, 166, 166,
603 + 166, 167, 131, 130, 129, 167, 167, 168, 168, 168,
604 + 168, 168, 168, 168, 168, 169, 169, 169, 169, 170,
605 + 128, 170, 171, 127, 126, 171, 125, 171, 171, 172,
606 + 123, 122, 172, 172, 172, 172, 173, 121, 173, 173,
608 + 174, 174, 174, 174, 174, 174, 174, 174, 175, 175,
609 + 175, 175, 175, 175, 175, 175, 176, 120, 176, 177,
610 + 119, 177, 177, 118, 177, 177, 178, 178, 178, 178,
611 + 178, 178, 178, 178, 179, 179, 179, 179, 179, 179,
612 + 179, 179, 116, 115, 113, 112, 111, 110, 109, 108,
613 + 107, 106, 105, 104, 103, 101, 100, 98, 97, 96,
614 + 95, 94, 92, 90, 88, 87, 86, 84, 83, 82,
615 + 81, 80, 79, 78, 77, 75, 73, 70, 69, 67,
616 + 64, 62, 61, 57, 51, 50, 49, 47, 46, 45,
617 41, 38, 22, 21, 19, 13, 9, 6, 4, 2,
618 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
620 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
621 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
622 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
623 - 158, 158, 158, 158, 158, 158, 158
624 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
625 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
626 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
627 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
628 + 165, 165, 165, 165, 165, 165, 165, 165
631 static yy_state_type yy_last_accepting_state;
632 @@ -662,7 +664,7 @@ static int dts_version = 1;
633 static void push_input_file(const char *filename);
634 static bool pop_input_file(void);
635 static void lexical_error(const char *fmt, ...);
636 -#line 666 "dtc-lexer.lex.c"
637 +#line 668 "dtc-lexer.lex.c"
641 @@ -704,7 +706,7 @@ FILE *yyget_out (void );
643 void yyset_out (FILE * out_str );
645 -yy_size_t yyget_leng (void );
646 +int yyget_leng (void );
648 char *yyget_text (void );
650 @@ -853,6 +855,10 @@ YY_DECL
651 register char *yy_cp, *yy_bp;
654 +#line 68 "dtc-lexer.l"
656 +#line 861 "dtc-lexer.lex.c"
661 @@ -879,11 +885,6 @@ YY_DECL
662 yy_load_buffer_state( );
666 -#line 68 "dtc-lexer.l"
668 -#line 886 "dtc-lexer.lex.c"
670 while ( 1 ) /* loops until end-of-file is reached */
672 yy_cp = (yy_c_buf_p);
673 @@ -901,7 +902,7 @@ YY_DECL
677 - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
678 + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
679 if ( yy_accept[yy_current_state] )
681 (yy_last_accepting_state) = yy_current_state;
682 @@ -910,13 +911,13 @@ yy_match:
683 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
685 yy_current_state = (int) yy_def[yy_current_state];
686 - if ( yy_current_state >= 159 )
687 + if ( yy_current_state >= 166 )
688 yy_c = yy_meta[(unsigned int) yy_c];
690 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
693 - while ( yy_current_state != 158 );
694 + while ( yy_current_state != 165 );
695 yy_cp = (yy_last_accepting_cpos);
696 yy_current_state = (yy_last_accepting_state);
698 @@ -951,39 +952,31 @@ case 2:
700 #line 75 "dtc-lexer.l"
702 - char *line, *fnstart, *fnend;
704 + char *line, *tmp, *fn;
705 /* skip text before line # */
707 while (!isdigit((unsigned char)*line))
710 - /* regexp ensures that first and list "
711 - * in the whole yytext are those at
712 - * beginning and end of the filename string */
713 - fnstart = memchr(yytext, '"', yyleng);
714 - for (fnend = yytext + yyleng - 1;
715 - *fnend != '"'; fnend--)
717 - assert(fnstart && fnend && (fnend > fnstart));
719 - fn = data_copy_escape_string(fnstart + 1,
720 - fnend - fnstart - 1);
722 - /* Don't allow nuls in filenames */
723 - if (memchr(fn.val, '\0', fn.len - 1))
724 - lexical_error("nul in line number directive");
726 + /* skip digits in line # */
728 + while (!isspace((unsigned char)*tmp))
730 + /* "NULL"-terminate line # */
732 + /* start of filename */
733 + fn = strchr(tmp + 1, '"') + 1;
734 + /* strip trailing " from filename */
735 + tmp = strchr(fn, '"');
737 /* -1 since #line is the number of the next line */
738 - srcpos_set_line(xstrdup(fn.val), atoi(line) - 1);
740 + srcpos_set_line(xstrdup(fn), atoi(line) - 1);
743 case YY_STATE_EOF(INITIAL):
744 case YY_STATE_EOF(BYTESTRING):
745 case YY_STATE_EOF(PROPNODENAME):
746 case YY_STATE_EOF(V1):
747 -#line 104 "dtc-lexer.l"
748 +#line 96 "dtc-lexer.l"
750 if (!pop_input_file()) {
752 @@ -993,7 +986,7 @@ case YY_STATE_EOF(V1):
754 /* rule 3 can match eol */
756 -#line 110 "dtc-lexer.l"
757 +#line 102 "dtc-lexer.l"
759 DPRINT("String: %s\n", yytext);
760 yylval.data = data_copy_escape_string(yytext+1,
761 @@ -1003,7 +996,7 @@ YY_RULE_SETUP
765 -#line 117 "dtc-lexer.l"
766 +#line 109 "dtc-lexer.l"
768 DPRINT("Keyword: /dts-v1/\n");
770 @@ -1013,25 +1006,33 @@ YY_RULE_SETUP
774 -#line 124 "dtc-lexer.l"
775 +#line 116 "dtc-lexer.l"
777 + DPRINT("Keyword: /plugin/\n");
783 +#line 121 "dtc-lexer.l"
785 DPRINT("Keyword: /memreserve/\n");
787 return DT_MEMRESERVE;
793 -#line 130 "dtc-lexer.l"
794 +#line 127 "dtc-lexer.l"
796 DPRINT("Keyword: /bits/\n");
804 -#line 136 "dtc-lexer.l"
805 +#line 133 "dtc-lexer.l"
807 DPRINT("Keyword: /delete-property/\n");
808 DPRINT("<PROPNODENAME>\n");
809 @@ -1039,9 +1040,9 @@ YY_RULE_SETUP
816 -#line 143 "dtc-lexer.l"
817 +#line 140 "dtc-lexer.l"
819 DPRINT("Keyword: /delete-node/\n");
820 DPRINT("<PROPNODENAME>\n");
821 @@ -1049,9 +1050,9 @@ YY_RULE_SETUP
828 -#line 150 "dtc-lexer.l"
829 +#line 147 "dtc-lexer.l"
831 DPRINT("Label: %s\n", yytext);
832 yylval.labelref = xstrdup(yytext);
833 @@ -1059,9 +1060,9 @@ YY_RULE_SETUP
840 -#line 157 "dtc-lexer.l"
841 +#line 154 "dtc-lexer.l"
844 DPRINT("Integer Literal: '%s'\n", yytext);
845 @@ -1069,10 +1070,7 @@ YY_RULE_SETUP
847 yylval.integer = strtoull(yytext, &e, 0);
849 - if (*e && e[strspn(e, "UL")]) {
850 - lexical_error("Bad integer literal '%s'",
853 + assert(!(*e) || !e[strspn(e, "UL")]);
856 lexical_error("Integer literal '%s' out of range",
857 @@ -1084,10 +1082,10 @@ YY_RULE_SETUP
862 -/* rule 11 can match eol */
864 +/* rule 12 can match eol */
866 -#line 179 "dtc-lexer.l"
867 +#line 173 "dtc-lexer.l"
870 DPRINT("Character literal: %s\n", yytext);
871 @@ -1109,18 +1107,18 @@ YY_RULE_SETUP
872 return DT_CHAR_LITERAL;
878 -#line 200 "dtc-lexer.l"
879 +#line 194 "dtc-lexer.l"
880 { /* label reference */
881 DPRINT("Ref: %s\n", yytext+1);
882 yylval.labelref = xstrdup(yytext+1);
889 -#line 206 "dtc-lexer.l"
890 +#line 200 "dtc-lexer.l"
891 { /* new-style path reference */
892 yytext[yyleng-1] = '\0';
893 DPRINT("Ref: %s\n", yytext+2);
894 @@ -1128,27 +1126,27 @@ YY_RULE_SETUP
901 -#line 213 "dtc-lexer.l"
902 +#line 207 "dtc-lexer.l"
904 yylval.byte = strtol(yytext, NULL, 16);
905 DPRINT("Byte: %02x\n", (int)yylval.byte);
912 -#line 219 "dtc-lexer.l"
913 +#line 213 "dtc-lexer.l"
915 DPRINT("/BYTESTRING\n");
923 -#line 225 "dtc-lexer.l"
924 +#line 219 "dtc-lexer.l"
926 DPRINT("PropNodeName: %s\n", yytext);
927 yylval.propnodename = xstrdup((yytext[0] == '\\') ?
928 @@ -1157,75 +1155,75 @@ YY_RULE_SETUP
929 return DT_PROPNODENAME;
935 -#line 233 "dtc-lexer.l"
936 +#line 227 "dtc-lexer.l"
938 DPRINT("Binary Include\n");
943 -/* rule 18 can match eol */
945 -#line 238 "dtc-lexer.l"
946 -/* eat whitespace */
949 /* rule 19 can match eol */
951 -#line 239 "dtc-lexer.l"
952 -/* eat C-style comments */
953 +#line 232 "dtc-lexer.l"
954 +/* eat whitespace */
957 /* rule 20 can match eol */
959 -#line 240 "dtc-lexer.l"
960 -/* eat C++-style comments */
961 +#line 233 "dtc-lexer.l"
962 +/* eat C-style comments */
965 +/* rule 21 can match eol */
967 -#line 242 "dtc-lexer.l"
968 -{ return DT_LSHIFT; };
969 +#line 234 "dtc-lexer.l"
970 +/* eat C++-style comments */
974 -#line 243 "dtc-lexer.l"
975 -{ return DT_RSHIFT; };
976 +#line 236 "dtc-lexer.l"
977 +{ return DT_LSHIFT; };
981 -#line 244 "dtc-lexer.l"
983 +#line 237 "dtc-lexer.l"
984 +{ return DT_RSHIFT; };
988 -#line 245 "dtc-lexer.l"
990 +#line 238 "dtc-lexer.l"
995 -#line 246 "dtc-lexer.l"
997 +#line 239 "dtc-lexer.l"
1002 -#line 247 "dtc-lexer.l"
1004 +#line 240 "dtc-lexer.l"
1009 -#line 248 "dtc-lexer.l"
1010 -{ return DT_AND; };
1011 +#line 241 "dtc-lexer.l"
1016 -#line 249 "dtc-lexer.l"
1018 +#line 242 "dtc-lexer.l"
1019 +{ return DT_AND; };
1023 -#line 251 "dtc-lexer.l"
1024 +#line 243 "dtc-lexer.l"
1029 +#line 245 "dtc-lexer.l"
1031 DPRINT("Char: %c (\\x%02x)\n", yytext[0],
1032 (unsigned)yytext[0]);
1033 @@ -1241,12 +1239,12 @@ YY_RULE_SETUP
1040 -#line 266 "dtc-lexer.l"
1041 +#line 260 "dtc-lexer.l"
1044 -#line 1250 "dtc-lexer.lex.c"
1045 +#line 1248 "dtc-lexer.lex.c"
1047 case YY_END_OF_BUFFER:
1049 @@ -1376,7 +1374,6 @@ ECHO;
1050 "fatal flex scanner internal error--no action found" );
1051 } /* end of action switch */
1052 } /* end of scanning one token */
1053 - } /* end of user's declarations */
1054 } /* end of yylex */
1056 /* yy_get_next_buffer - try to read in a new buffer
1057 @@ -1432,21 +1429,21 @@ static int yy_get_next_buffer (void)
1061 - yy_size_t num_to_read =
1063 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1065 while ( num_to_read <= 0 )
1066 { /* Not enough room in the buffer - grow it. */
1068 /* just a shorter name for the current buffer */
1069 - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1070 + YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1072 int yy_c_buf_p_offset =
1073 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1075 if ( b->yy_is_our_buffer )
1077 - yy_size_t new_size = b->yy_buf_size * 2;
1078 + int new_size = b->yy_buf_size * 2;
1080 if ( new_size <= 0 )
1081 b->yy_buf_size += b->yy_buf_size / 8;
1082 @@ -1477,7 +1474,7 @@ static int yy_get_next_buffer (void)
1084 /* Read in more data. */
1085 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1086 - (yy_n_chars), num_to_read );
1087 + (yy_n_chars), (size_t) num_to_read );
1089 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1091 @@ -1539,7 +1536,7 @@ static int yy_get_next_buffer (void)
1092 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1094 yy_current_state = (int) yy_def[yy_current_state];
1095 - if ( yy_current_state >= 159 )
1096 + if ( yy_current_state >= 166 )
1097 yy_c = yy_meta[(unsigned int) yy_c];
1099 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1100 @@ -1567,13 +1564,13 @@ static int yy_get_next_buffer (void)
1101 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1103 yy_current_state = (int) yy_def[yy_current_state];
1104 - if ( yy_current_state >= 159 )
1105 + if ( yy_current_state >= 166 )
1106 yy_c = yy_meta[(unsigned int) yy_c];
1108 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1109 - yy_is_jam = (yy_current_state == 158);
1110 + yy_is_jam = (yy_current_state == 165);
1112 - return yy_is_jam ? 0 : yy_current_state;
1113 + return yy_is_jam ? 0 : yy_current_state;
1117 @@ -1600,7 +1597,7 @@ static int yy_get_next_buffer (void)
1120 { /* need more input */
1121 - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1122 + int offset = (yy_c_buf_p) - (yytext_ptr);
1125 switch ( yy_get_next_buffer( ) )
1126 @@ -1874,7 +1871,7 @@ void yypop_buffer_state (void)
1128 static void yyensure_buffer_stack (void)
1130 - yy_size_t num_to_alloc;
1133 if (!(yy_buffer_stack)) {
1135 @@ -1971,12 +1968,12 @@ YY_BUFFER_STATE yy_scan_string (yyconst
1137 * @return the newly allocated buffer state object.
1139 -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1140 +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1148 /* Get memory for full buffer, including space for trailing EOB's. */
1149 n = _yybytes_len + 2;
1150 @@ -2058,7 +2055,7 @@ FILE *yyget_out (void)
1151 /** Get the length of the current token.
1154 -yy_size_t yyget_leng (void)
1155 +int yyget_leng (void)
1159 @@ -2206,7 +2203,7 @@ void yyfree (void * ptr )
1161 #define YYTABLES_NAME "yytables"
1163 -#line 265 "dtc-lexer.l"
1164 +#line 260 "dtc-lexer.l"
1168 --- a/scripts/dtc/dtc-parser.tab.c_shipped
1169 +++ b/scripts/dtc/dtc-parser.tab.c_shipped
1171 #line 20 "dtc-parser.y" /* yacc.c:339 */
1174 +#include <inttypes.h>
1178 @@ -80,7 +81,7 @@ extern void yyerror(char const *s);
1179 extern struct boot_info *the_boot_info;
1180 extern bool treesource_error;
1182 -#line 84 "dtc-parser.tab.c" /* yacc.c:339 */
1183 +#line 85 "dtc-parser.tab.c" /* yacc.c:339 */
1186 # if defined __cplusplus && 201103L <= __cplusplus
1187 @@ -116,26 +117,27 @@ extern int yydebug;
1191 - DT_MEMRESERVE = 259,
1201 - DT_DEL_PROP = 269,
1202 - DT_DEL_NODE = 270,
1203 - DT_PROPNODENAME = 271,
1205 - DT_CHAR_LITERAL = 273,
1212 + DT_MEMRESERVE = 260,
1222 + DT_DEL_PROP = 270,
1223 + DT_DEL_NODE = 271,
1224 + DT_PROPNODENAME = 272,
1226 + DT_CHAR_LITERAL = 274,
1235 @@ -144,7 +146,7 @@ extern int yydebug;
1236 typedef union YYSTYPE YYSTYPE;
1239 -#line 38 "dtc-parser.y" /* yacc.c:355 */
1240 +#line 39 "dtc-parser.y" /* yacc.c:355 */
1244 @@ -162,8 +164,9 @@ union YYSTYPE
1245 struct node *nodelist;
1246 struct reserve_info *re;
1250 -#line 167 "dtc-parser.tab.c" /* yacc.c:355 */
1251 +#line 170 "dtc-parser.tab.c" /* yacc.c:355 */
1253 # define YYSTYPE_IS_TRIVIAL 1
1254 # define YYSTYPE_IS_DECLARED 1
1255 @@ -192,7 +195,7 @@ int yyparse (void);
1257 /* Copy the second part of user declarations. */
1259 -#line 196 "dtc-parser.tab.c" /* yacc.c:358 */
1260 +#line 199 "dtc-parser.tab.c" /* yacc.c:358 */
1264 @@ -439,18 +442,18 @@ union yyalloc
1267 /* YYNTOKENS -- Number of terminals. */
1268 -#define YYNTOKENS 47
1269 +#define YYNTOKENS 48
1270 /* YYNNTS -- Number of nonterminals. */
1273 /* YYNRULES -- Number of rules. */
1274 -#define YYNRULES 80
1275 +#define YYNRULES 82
1276 /* YYNSTATES -- Number of states. */
1277 -#define YYNSTATES 144
1278 +#define YYNSTATES 147
1280 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
1281 by yylex, with out-of-bounds checking. */
1282 #define YYUNDEFTOK 2
1283 -#define YYMAXUTOK 278
1284 +#define YYMAXUTOK 279
1286 #define YYTRANSLATE(YYX) \
1287 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1288 @@ -462,16 +465,16 @@ static const yytype_uint8 yytranslate[]
1289 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1290 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1291 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1292 - 2, 2, 2, 46, 2, 2, 2, 44, 40, 2,
1293 - 32, 34, 43, 41, 33, 42, 2, 25, 2, 2,
1294 - 2, 2, 2, 2, 2, 2, 2, 2, 37, 24,
1295 - 35, 28, 29, 36, 2, 2, 2, 2, 2, 2,
1296 + 2, 2, 2, 47, 2, 2, 2, 45, 41, 2,
1297 + 33, 35, 44, 42, 34, 43, 2, 26, 2, 2,
1298 + 2, 2, 2, 2, 2, 2, 2, 2, 38, 25,
1299 + 36, 29, 30, 37, 2, 2, 2, 2, 2, 2,
1300 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1301 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1302 - 2, 30, 2, 31, 39, 2, 2, 2, 2, 2,
1303 + 2, 31, 2, 32, 40, 2, 2, 2, 2, 2,
1304 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1305 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1306 - 2, 2, 2, 26, 38, 27, 45, 2, 2, 2,
1307 + 2, 2, 2, 27, 39, 28, 46, 2, 2, 2,
1308 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1309 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1310 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1311 @@ -486,22 +489,22 @@ static const yytype_uint8 yytranslate[]
1312 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1313 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1314 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1315 - 15, 16, 17, 18, 19, 20, 21, 22, 23
1316 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24
1320 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
1321 static const yytype_uint16 yyrline[] =
1323 - 0, 104, 104, 113, 116, 123, 127, 135, 139, 144,
1324 - 155, 165, 180, 188, 191, 198, 202, 206, 210, 218,
1325 - 222, 226, 230, 234, 250, 260, 268, 271, 275, 282,
1326 - 298, 303, 322, 336, 343, 344, 345, 352, 356, 357,
1327 - 361, 362, 366, 367, 371, 372, 376, 377, 381, 382,
1328 - 386, 387, 388, 392, 393, 394, 395, 396, 400, 401,
1329 - 402, 406, 407, 408, 412, 413, 422, 431, 435, 436,
1330 - 437, 438, 443, 446, 450, 458, 461, 465, 473, 477,
1332 + 0, 108, 108, 118, 121, 129, 132, 139, 143, 151,
1333 + 155, 160, 171, 181, 196, 204, 207, 214, 218, 222,
1334 + 226, 234, 238, 242, 246, 250, 266, 276, 284, 287,
1335 + 291, 298, 314, 319, 338, 352, 359, 360, 361, 368,
1336 + 372, 373, 377, 378, 382, 383, 387, 388, 392, 393,
1337 + 397, 398, 402, 403, 404, 408, 409, 410, 411, 412,
1338 + 416, 417, 418, 422, 423, 424, 428, 429, 430, 431,
1339 + 435, 436, 437, 438, 443, 446, 450, 458, 461, 465,
1344 @@ -510,19 +513,19 @@ static const yytype_uint16 yyrline[] =
1345 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1346 static const char *const yytname[] =
1348 - "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE", "DT_LSHIFT",
1349 - "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ", "DT_NE", "DT_AND", "DT_OR",
1350 - "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE", "DT_PROPNODENAME", "DT_LITERAL",
1351 - "DT_CHAR_LITERAL", "DT_BYTE", "DT_STRING", "DT_LABEL", "DT_REF",
1352 - "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['", "']'",
1353 - "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'", "'+'",
1354 - "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile",
1355 - "memreserves", "memreserve", "devicetree", "nodedef", "proplist",
1356 - "propdef", "propdata", "propdataprefix", "arrayprefix", "integer_prim",
1357 - "integer_expr", "integer_trinary", "integer_or", "integer_and",
1358 - "integer_bitor", "integer_bitxor", "integer_bitand", "integer_eq",
1359 - "integer_rela", "integer_shift", "integer_add", "integer_mul",
1360 - "integer_unary", "bytestring", "subnodes", "subnode", YY_NULLPTR
1361 + "$end", "error", "$undefined", "DT_V1", "DT_PLUGIN", "DT_MEMRESERVE",
1362 + "DT_LSHIFT", "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ", "DT_NE", "DT_AND",
1363 + "DT_OR", "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE", "DT_PROPNODENAME",
1364 + "DT_LITERAL", "DT_CHAR_LITERAL", "DT_BYTE", "DT_STRING", "DT_LABEL",
1365 + "DT_REF", "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['",
1366 + "']'", "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'",
1367 + "'+'", "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile",
1368 + "plugindecl", "memreserves", "memreserve", "devicetree", "nodedef",
1369 + "proplist", "propdef", "propdata", "propdataprefix", "arrayprefix",
1370 + "integer_prim", "integer_expr", "integer_trinary", "integer_or",
1371 + "integer_and", "integer_bitor", "integer_bitxor", "integer_bitand",
1372 + "integer_eq", "integer_rela", "integer_shift", "integer_add",
1373 + "integer_mul", "integer_unary", "bytestring", "subnodes", "subnode", YY_NULLPTR
1377 @@ -533,16 +536,16 @@ static const yytype_uint16 yytoknum[] =
1379 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1380 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1381 - 275, 276, 277, 278, 59, 47, 123, 125, 61, 62,
1382 - 91, 93, 40, 44, 41, 60, 63, 58, 124, 94,
1383 - 38, 43, 45, 42, 37, 126, 33
1384 + 275, 276, 277, 278, 279, 59, 47, 123, 125, 61,
1385 + 62, 91, 93, 40, 44, 41, 60, 63, 58, 124,
1386 + 94, 38, 43, 45, 42, 37, 126, 33
1390 -#define YYPACT_NINF -81
1391 +#define YYPACT_NINF -84
1393 #define yypact_value_is_default(Yystate) \
1394 - (!!((Yystate) == (-81)))
1395 + (!!((Yystate) == (-84)))
1397 #define YYTABLE_NINF -1
1399 @@ -553,21 +556,21 @@ static const yytype_uint16 yytoknum[] =
1401 static const yytype_int8 yypact[] =
1403 - 16, -11, 21, 10, -81, 25, 10, 19, 10, -81,
1404 - -81, -9, 25, -81, 2, 51, -81, -9, -9, -9,
1405 - -81, 1, -81, -6, 50, 14, 28, 29, 36, 3,
1406 - 58, 44, -3, -81, 47, -81, -81, 65, 68, 2,
1407 - 2, -81, -81, -81, -81, -9, -9, -9, -9, -9,
1408 - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
1409 - -9, -9, -9, -9, -81, 63, 69, 2, -81, -81,
1410 - 50, 57, 14, 28, 29, 36, 3, 3, 58, 58,
1411 - 58, 58, 44, 44, -3, -3, -81, -81, -81, 79,
1412 - 80, -8, 63, -81, 72, 63, -81, -81, -9, 76,
1413 - 77, -81, -81, -81, -81, -81, 78, -81, -81, -81,
1414 - -81, -81, 35, 4, -81, -81, -81, -81, 86, -81,
1415 - -81, -81, 73, -81, -81, 33, 71, 84, 39, -81,
1416 - -81, -81, -81, -81, 41, -81, -81, -81, 25, -81,
1418 + 15, -12, 35, 42, -84, 27, 9, -84, 24, 9,
1419 + 43, 9, -84, -84, -10, 24, -84, 60, 44, -84,
1420 + -10, -10, -10, -84, 55, -84, -7, 52, 53, 51,
1421 + 54, 10, 2, 38, 37, -4, -84, 68, -84, -84,
1422 + 71, 73, 60, 60, -84, -84, -84, -84, -10, -10,
1423 + -10, -10, -10, -10, -10, -10, -10, -10, -10, -10,
1424 + -10, -10, -10, -10, -10, -10, -10, -84, 56, 72,
1425 + 60, -84, -84, 52, 61, 53, 51, 54, 10, 2,
1426 + 2, 38, 38, 38, 38, 37, 37, -4, -4, -84,
1427 + -84, -84, 81, 83, 34, 56, -84, 74, 56, -84,
1428 + -84, -10, 76, 78, -84, -84, -84, -84, -84, 79,
1429 + -84, -84, -84, -84, -84, -6, 3, -84, -84, -84,
1430 + -84, 87, -84, -84, -84, 75, -84, -84, 32, 70,
1431 + 86, 36, -84, -84, -84, -84, -84, 47, -84, -84,
1432 + -84, 24, -84, 77, 24, 80, -84
1435 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1436 @@ -575,37 +578,37 @@ static const yytype_int8 yypact[] =
1437 means the default is an error. */
1438 static const yytype_uint8 yydefact[] =
1440 - 0, 0, 0, 3, 1, 0, 0, 0, 3, 34,
1441 - 35, 0, 0, 6, 0, 2, 4, 0, 0, 0,
1442 - 68, 0, 37, 38, 40, 42, 44, 46, 48, 50,
1443 - 53, 60, 63, 67, 0, 13, 7, 0, 0, 0,
1444 - 0, 69, 70, 71, 36, 0, 0, 0, 0, 0,
1445 + 0, 0, 0, 3, 1, 0, 5, 4, 0, 0,
1446 + 0, 5, 36, 37, 0, 0, 8, 0, 2, 6,
1447 + 0, 0, 0, 70, 0, 39, 40, 42, 44, 46,
1448 + 48, 50, 52, 55, 62, 65, 69, 0, 15, 9,
1449 + 0, 0, 0, 0, 71, 72, 73, 38, 0, 0,
1450 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1451 - 0, 0, 0, 0, 5, 75, 0, 0, 10, 8,
1452 - 41, 0, 43, 45, 47, 49, 51, 52, 56, 57,
1453 - 55, 54, 58, 59, 61, 62, 65, 64, 66, 0,
1454 - 0, 0, 0, 14, 0, 75, 11, 9, 0, 0,
1455 - 0, 16, 26, 78, 18, 80, 0, 77, 76, 39,
1456 - 17, 79, 0, 0, 12, 25, 15, 27, 0, 19,
1457 - 28, 22, 0, 72, 30, 0, 0, 0, 0, 33,
1458 - 32, 20, 31, 29, 0, 73, 74, 21, 0, 24,
1460 + 0, 0, 0, 0, 0, 0, 0, 7, 77, 0,
1461 + 0, 12, 10, 43, 0, 45, 47, 49, 51, 53,
1462 + 54, 58, 59, 57, 56, 60, 61, 63, 64, 67,
1463 + 66, 68, 0, 0, 0, 0, 16, 0, 77, 13,
1464 + 11, 0, 0, 0, 18, 28, 80, 20, 82, 0,
1465 + 79, 78, 41, 19, 81, 0, 0, 14, 27, 17,
1466 + 29, 0, 21, 30, 24, 0, 74, 32, 0, 0,
1467 + 0, 0, 35, 34, 22, 33, 31, 0, 75, 76,
1468 + 23, 0, 26, 0, 0, 0, 25
1471 /* YYPGOTO[NTERM-NUM]. */
1472 static const yytype_int8 yypgoto[] =
1474 - -81, -81, 100, 104, -81, -38, -81, -80, -81, -81,
1475 - -81, -5, 66, 13, -81, 70, 67, 81, 64, 82,
1476 - 37, 27, 34, 38, -14, -81, 22, 24
1477 + -84, -84, -84, 98, 101, -84, -41, -84, -83, -84,
1478 + -84, -84, -8, 63, 12, -84, 66, 67, 65, 69,
1479 + 82, 29, 18, 25, 26, -17, -84, 20, 28
1482 /* YYDEFGOTO[NTERM-NUM]. */
1483 static const yytype_int16 yydefgoto[] =
1485 - -1, 2, 7, 8, 15, 36, 65, 93, 112, 113,
1486 - 125, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1487 - 29, 30, 31, 32, 33, 128, 94, 95
1488 + -1, 2, 6, 10, 11, 18, 39, 68, 96, 115,
1489 + 116, 128, 23, 24, 25, 26, 27, 28, 29, 30,
1490 + 31, 32, 33, 34, 35, 36, 131, 97, 98
1493 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1494 @@ -613,87 +616,87 @@ static const yytype_int16 yydefgoto[] =
1495 number is the opposite. If YYTABLE_NINF, syntax error. */
1496 static const yytype_uint8 yytable[] =
1498 - 12, 68, 69, 41, 42, 43, 45, 34, 9, 10,
1499 - 53, 54, 104, 3, 5, 107, 101, 118, 35, 1,
1500 - 102, 4, 61, 11, 119, 120, 121, 122, 35, 97,
1501 - 46, 6, 55, 17, 123, 44, 18, 19, 56, 124,
1502 - 62, 63, 9, 10, 14, 51, 52, 86, 87, 88,
1503 - 9, 10, 48, 103, 129, 130, 115, 11, 135, 116,
1504 - 136, 47, 131, 57, 58, 11, 37, 49, 117, 50,
1505 - 137, 64, 38, 39, 138, 139, 40, 89, 90, 91,
1506 - 78, 79, 80, 81, 92, 59, 60, 66, 76, 77,
1507 - 67, 82, 83, 96, 98, 99, 100, 84, 85, 106,
1508 - 110, 111, 114, 126, 134, 127, 133, 141, 16, 143,
1509 - 13, 109, 71, 74, 72, 70, 105, 108, 0, 0,
1510 - 132, 0, 0, 0, 0, 0, 0, 0, 0, 73,
1511 - 0, 0, 75, 140, 0, 0, 142
1512 + 15, 71, 72, 44, 45, 46, 48, 37, 12, 13,
1513 + 56, 57, 107, 3, 8, 110, 118, 121, 1, 119,
1514 + 54, 55, 64, 14, 122, 123, 124, 125, 120, 100,
1515 + 49, 9, 58, 20, 126, 4, 21, 22, 59, 127,
1516 + 65, 66, 12, 13, 60, 61, 5, 89, 90, 91,
1517 + 12, 13, 7, 106, 132, 133, 138, 14, 139, 104,
1518 + 40, 38, 134, 105, 50, 14, 41, 42, 140, 17,
1519 + 43, 92, 93, 94, 81, 82, 83, 84, 95, 62,
1520 + 63, 141, 142, 79, 80, 85, 86, 38, 87, 88,
1521 + 47, 52, 51, 67, 69, 53, 70, 99, 102, 101,
1522 + 103, 113, 109, 114, 117, 129, 136, 137, 130, 19,
1523 + 16, 144, 74, 112, 73, 146, 76, 75, 111, 0,
1524 + 135, 77, 0, 108, 0, 0, 0, 0, 0, 0,
1525 + 0, 0, 0, 143, 0, 78, 145
1528 static const yytype_int16 yycheck[] =
1530 - 5, 39, 40, 17, 18, 19, 12, 12, 17, 18,
1531 - 7, 8, 92, 24, 4, 95, 24, 13, 26, 3,
1532 - 28, 0, 25, 32, 20, 21, 22, 23, 26, 67,
1533 - 36, 21, 29, 42, 30, 34, 45, 46, 35, 35,
1534 - 43, 44, 17, 18, 25, 9, 10, 61, 62, 63,
1535 - 17, 18, 38, 91, 21, 22, 21, 32, 19, 24,
1536 - 21, 11, 29, 5, 6, 32, 15, 39, 33, 40,
1537 - 31, 24, 21, 22, 33, 34, 25, 14, 15, 16,
1538 - 53, 54, 55, 56, 21, 41, 42, 22, 51, 52,
1539 - 22, 57, 58, 24, 37, 16, 16, 59, 60, 27,
1540 - 24, 24, 24, 17, 20, 32, 35, 33, 8, 34,
1541 - 6, 98, 46, 49, 47, 45, 92, 95, -1, -1,
1542 - 125, -1, -1, -1, -1, -1, -1, -1, -1, 48,
1543 - -1, -1, 50, 138, -1, -1, 141
1544 + 8, 42, 43, 20, 21, 22, 13, 15, 18, 19,
1545 + 8, 9, 95, 25, 5, 98, 22, 14, 3, 25,
1546 + 10, 11, 26, 33, 21, 22, 23, 24, 34, 70,
1547 + 37, 22, 30, 43, 31, 0, 46, 47, 36, 36,
1548 + 44, 45, 18, 19, 6, 7, 4, 64, 65, 66,
1549 + 18, 19, 25, 94, 22, 23, 20, 33, 22, 25,
1550 + 16, 27, 30, 29, 12, 33, 22, 23, 32, 26,
1551 + 26, 15, 16, 17, 56, 57, 58, 59, 22, 42,
1552 + 43, 34, 35, 54, 55, 60, 61, 27, 62, 63,
1553 + 35, 40, 39, 25, 23, 41, 23, 25, 17, 38,
1554 + 17, 25, 28, 25, 25, 18, 36, 21, 33, 11,
1555 + 9, 34, 49, 101, 48, 35, 51, 50, 98, -1,
1556 + 128, 52, -1, 95, -1, -1, -1, -1, -1, -1,
1557 + -1, -1, -1, 141, -1, 53, 144
1560 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1561 symbol of state STATE-NUM. */
1562 static const yytype_uint8 yystos[] =
1564 - 0, 3, 48, 24, 0, 4, 21, 49, 50, 17,
1565 - 18, 32, 58, 50, 25, 51, 49, 42, 45, 46,
1566 - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
1567 - 68, 69, 70, 71, 58, 26, 52, 15, 21, 22,
1568 - 25, 71, 71, 71, 34, 12, 36, 11, 38, 39,
1569 - 40, 9, 10, 7, 8, 29, 35, 5, 6, 41,
1570 - 42, 25, 43, 44, 24, 53, 22, 22, 52, 52,
1571 - 62, 59, 63, 64, 65, 66, 67, 67, 68, 68,
1572 - 68, 68, 69, 69, 70, 70, 71, 71, 71, 14,
1573 - 15, 16, 21, 54, 73, 74, 24, 52, 37, 16,
1574 - 16, 24, 28, 52, 54, 74, 27, 54, 73, 60,
1575 - 24, 24, 55, 56, 24, 21, 24, 33, 13, 20,
1576 - 21, 22, 23, 30, 35, 57, 17, 32, 72, 21,
1577 - 22, 29, 58, 35, 20, 19, 21, 31, 33, 34,
1579 + 0, 3, 49, 25, 0, 4, 50, 25, 5, 22,
1580 + 51, 52, 18, 19, 33, 60, 52, 26, 53, 51,
1581 + 43, 46, 47, 60, 61, 62, 63, 64, 65, 66,
1582 + 67, 68, 69, 70, 71, 72, 73, 60, 27, 54,
1583 + 16, 22, 23, 26, 73, 73, 73, 35, 13, 37,
1584 + 12, 39, 40, 41, 10, 11, 8, 9, 30, 36,
1585 + 6, 7, 42, 43, 26, 44, 45, 25, 55, 23,
1586 + 23, 54, 54, 64, 61, 65, 66, 67, 68, 69,
1587 + 69, 70, 70, 70, 70, 71, 71, 72, 72, 73,
1588 + 73, 73, 15, 16, 17, 22, 56, 75, 76, 25,
1589 + 54, 38, 17, 17, 25, 29, 54, 56, 76, 28,
1590 + 56, 75, 62, 25, 25, 57, 58, 25, 22, 25,
1591 + 34, 14, 21, 22, 23, 24, 31, 36, 59, 18,
1592 + 33, 74, 22, 23, 30, 60, 36, 21, 20, 22,
1593 + 32, 34, 35, 60, 34, 60, 35
1596 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1597 static const yytype_uint8 yyr1[] =
1599 - 0, 47, 48, 49, 49, 50, 50, 51, 51, 51,
1600 - 51, 51, 52, 53, 53, 54, 54, 54, 54, 55,
1601 - 55, 55, 55, 55, 55, 55, 56, 56, 56, 57,
1602 - 57, 57, 57, 57, 58, 58, 58, 59, 60, 60,
1603 - 61, 61, 62, 62, 63, 63, 64, 64, 65, 65,
1604 - 66, 66, 66, 67, 67, 67, 67, 67, 68, 68,
1605 - 68, 69, 69, 69, 70, 70, 70, 70, 71, 71,
1606 - 71, 71, 72, 72, 72, 73, 73, 73, 74, 74,
1608 + 0, 48, 49, 50, 50, 51, 51, 52, 52, 53,
1609 + 53, 53, 53, 53, 54, 55, 55, 56, 56, 56,
1610 + 56, 57, 57, 57, 57, 57, 57, 57, 58, 58,
1611 + 58, 59, 59, 59, 59, 59, 60, 60, 60, 61,
1612 + 62, 62, 63, 63, 64, 64, 65, 65, 66, 66,
1613 + 67, 67, 68, 68, 68, 69, 69, 69, 69, 69,
1614 + 70, 70, 70, 71, 71, 71, 72, 72, 72, 72,
1615 + 73, 73, 73, 73, 74, 74, 74, 75, 75, 75,
1619 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
1620 static const yytype_uint8 yyr2[] =
1622 - 0, 2, 4, 0, 2, 4, 2, 2, 3, 4,
1623 - 3, 4, 5, 0, 2, 4, 2, 3, 2, 2,
1624 - 3, 4, 2, 9, 5, 2, 0, 2, 2, 3,
1625 - 1, 2, 2, 2, 1, 1, 3, 1, 1, 5,
1626 - 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
1627 - 1, 3, 3, 1, 3, 3, 3, 3, 3, 3,
1628 - 1, 3, 3, 1, 3, 3, 3, 1, 1, 2,
1629 - 2, 2, 0, 2, 2, 0, 2, 2, 2, 3,
1631 + 0, 2, 5, 0, 2, 0, 2, 4, 2, 2,
1632 + 3, 4, 3, 4, 5, 0, 2, 4, 2, 3,
1633 + 2, 2, 3, 4, 2, 9, 5, 2, 0, 2,
1634 + 2, 3, 1, 2, 2, 2, 1, 1, 3, 1,
1635 + 1, 5, 1, 3, 1, 3, 1, 3, 1, 3,
1636 + 1, 3, 1, 3, 3, 1, 3, 3, 3, 3,
1637 + 3, 3, 1, 3, 3, 1, 3, 3, 3, 1,
1638 + 1, 2, 2, 2, 0, 2, 2, 0, 2, 2,
1643 @@ -1463,65 +1466,82 @@ yyreduce:
1647 -#line 105 "dtc-parser.y" /* yacc.c:1646 */
1648 +#line 109 "dtc-parser.y" /* yacc.c:1646 */
1650 + (yyvsp[0].node)->is_plugin = (yyvsp[-2].is_plugin);
1651 the_boot_info = build_boot_info((yyvsp[-1].re), (yyvsp[0].node),
1652 guess_boot_cpuid((yyvsp[0].node)));
1654 -#line 1472 "dtc-parser.tab.c" /* yacc.c:1646 */
1655 +#line 1476 "dtc-parser.tab.c" /* yacc.c:1646 */
1659 -#line 113 "dtc-parser.y" /* yacc.c:1646 */
1660 +#line 118 "dtc-parser.y" /* yacc.c:1646 */
1662 - (yyval.re) = NULL;
1663 + (yyval.is_plugin) = false;
1665 -#line 1480 "dtc-parser.tab.c" /* yacc.c:1646 */
1666 +#line 1484 "dtc-parser.tab.c" /* yacc.c:1646 */
1670 -#line 117 "dtc-parser.y" /* yacc.c:1646 */
1671 +#line 122 "dtc-parser.y" /* yacc.c:1646 */
1673 - (yyval.re) = chain_reserve_entry((yyvsp[-1].re), (yyvsp[0].re));
1674 + (yyval.is_plugin) = true;
1676 -#line 1488 "dtc-parser.tab.c" /* yacc.c:1646 */
1677 +#line 1492 "dtc-parser.tab.c" /* yacc.c:1646 */
1681 -#line 124 "dtc-parser.y" /* yacc.c:1646 */
1682 +#line 129 "dtc-parser.y" /* yacc.c:1646 */
1684 - (yyval.re) = build_reserve_entry((yyvsp[-2].integer), (yyvsp[-1].integer));
1685 + (yyval.re) = NULL;
1687 -#line 1496 "dtc-parser.tab.c" /* yacc.c:1646 */
1688 +#line 1500 "dtc-parser.tab.c" /* yacc.c:1646 */
1692 -#line 128 "dtc-parser.y" /* yacc.c:1646 */
1693 +#line 133 "dtc-parser.y" /* yacc.c:1646 */
1695 + (yyval.re) = chain_reserve_entry((yyvsp[-1].re), (yyvsp[0].re));
1697 +#line 1508 "dtc-parser.tab.c" /* yacc.c:1646 */
1701 +#line 140 "dtc-parser.y" /* yacc.c:1646 */
1703 + (yyval.re) = build_reserve_entry((yyvsp[-2].integer), (yyvsp[-1].integer));
1705 +#line 1516 "dtc-parser.tab.c" /* yacc.c:1646 */
1709 +#line 144 "dtc-parser.y" /* yacc.c:1646 */
1711 add_label(&(yyvsp[0].re)->labels, (yyvsp[-1].labelref));
1712 (yyval.re) = (yyvsp[0].re);
1714 -#line 1505 "dtc-parser.tab.c" /* yacc.c:1646 */
1715 +#line 1525 "dtc-parser.tab.c" /* yacc.c:1646 */
1719 -#line 136 "dtc-parser.y" /* yacc.c:1646 */
1721 +#line 152 "dtc-parser.y" /* yacc.c:1646 */
1723 (yyval.node) = name_node((yyvsp[0].node), "");
1725 -#line 1513 "dtc-parser.tab.c" /* yacc.c:1646 */
1726 +#line 1533 "dtc-parser.tab.c" /* yacc.c:1646 */
1730 -#line 140 "dtc-parser.y" /* yacc.c:1646 */
1732 +#line 156 "dtc-parser.y" /* yacc.c:1646 */
1734 (yyval.node) = merge_nodes((yyvsp[-2].node), (yyvsp[0].node));
1736 -#line 1521 "dtc-parser.tab.c" /* yacc.c:1646 */
1737 +#line 1541 "dtc-parser.tab.c" /* yacc.c:1646 */
1741 -#line 145 "dtc-parser.y" /* yacc.c:1646 */
1743 +#line 161 "dtc-parser.y" /* yacc.c:1646 */
1745 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1747 @@ -1532,11 +1552,11 @@ yyreduce:
1748 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1749 (yyval.node) = (yyvsp[-3].node);
1751 -#line 1536 "dtc-parser.tab.c" /* yacc.c:1646 */
1752 +#line 1556 "dtc-parser.tab.c" /* yacc.c:1646 */
1756 -#line 156 "dtc-parser.y" /* yacc.c:1646 */
1758 +#line 172 "dtc-parser.y" /* yacc.c:1646 */
1760 struct node *target = get_node_by_ref((yyvsp[-2].node), (yyvsp[-1].labelref));
1762 @@ -1546,11 +1566,11 @@ yyreduce:
1763 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1764 (yyval.node) = (yyvsp[-2].node);
1766 -#line 1550 "dtc-parser.tab.c" /* yacc.c:1646 */
1767 +#line 1570 "dtc-parser.tab.c" /* yacc.c:1646 */
1771 -#line 166 "dtc-parser.y" /* yacc.c:1646 */
1773 +#line 182 "dtc-parser.y" /* yacc.c:1646 */
1775 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1777 @@ -1562,100 +1582,100 @@ yyreduce:
1779 (yyval.node) = (yyvsp[-3].node);
1781 -#line 1566 "dtc-parser.tab.c" /* yacc.c:1646 */
1782 +#line 1586 "dtc-parser.tab.c" /* yacc.c:1646 */
1786 -#line 181 "dtc-parser.y" /* yacc.c:1646 */
1788 +#line 197 "dtc-parser.y" /* yacc.c:1646 */
1790 (yyval.node) = build_node((yyvsp[-3].proplist), (yyvsp[-2].nodelist));
1792 -#line 1574 "dtc-parser.tab.c" /* yacc.c:1646 */
1793 +#line 1594 "dtc-parser.tab.c" /* yacc.c:1646 */
1797 -#line 188 "dtc-parser.y" /* yacc.c:1646 */
1799 +#line 204 "dtc-parser.y" /* yacc.c:1646 */
1801 (yyval.proplist) = NULL;
1803 -#line 1582 "dtc-parser.tab.c" /* yacc.c:1646 */
1804 +#line 1602 "dtc-parser.tab.c" /* yacc.c:1646 */
1808 -#line 192 "dtc-parser.y" /* yacc.c:1646 */
1810 +#line 208 "dtc-parser.y" /* yacc.c:1646 */
1812 (yyval.proplist) = chain_property((yyvsp[0].prop), (yyvsp[-1].proplist));
1814 -#line 1590 "dtc-parser.tab.c" /* yacc.c:1646 */
1815 +#line 1610 "dtc-parser.tab.c" /* yacc.c:1646 */
1819 -#line 199 "dtc-parser.y" /* yacc.c:1646 */
1821 +#line 215 "dtc-parser.y" /* yacc.c:1646 */
1823 (yyval.prop) = build_property((yyvsp[-3].propnodename), (yyvsp[-1].data));
1825 -#line 1598 "dtc-parser.tab.c" /* yacc.c:1646 */
1826 +#line 1618 "dtc-parser.tab.c" /* yacc.c:1646 */
1830 -#line 203 "dtc-parser.y" /* yacc.c:1646 */
1832 +#line 219 "dtc-parser.y" /* yacc.c:1646 */
1834 (yyval.prop) = build_property((yyvsp[-1].propnodename), empty_data);
1836 -#line 1606 "dtc-parser.tab.c" /* yacc.c:1646 */
1837 +#line 1626 "dtc-parser.tab.c" /* yacc.c:1646 */
1841 -#line 207 "dtc-parser.y" /* yacc.c:1646 */
1843 +#line 223 "dtc-parser.y" /* yacc.c:1646 */
1845 (yyval.prop) = build_property_delete((yyvsp[-1].propnodename));
1847 -#line 1614 "dtc-parser.tab.c" /* yacc.c:1646 */
1848 +#line 1634 "dtc-parser.tab.c" /* yacc.c:1646 */
1852 -#line 211 "dtc-parser.y" /* yacc.c:1646 */
1854 +#line 227 "dtc-parser.y" /* yacc.c:1646 */
1856 add_label(&(yyvsp[0].prop)->labels, (yyvsp[-1].labelref));
1857 (yyval.prop) = (yyvsp[0].prop);
1859 -#line 1623 "dtc-parser.tab.c" /* yacc.c:1646 */
1860 +#line 1643 "dtc-parser.tab.c" /* yacc.c:1646 */
1864 -#line 219 "dtc-parser.y" /* yacc.c:1646 */
1866 +#line 235 "dtc-parser.y" /* yacc.c:1646 */
1868 (yyval.data) = data_merge((yyvsp[-1].data), (yyvsp[0].data));
1870 -#line 1631 "dtc-parser.tab.c" /* yacc.c:1646 */
1871 +#line 1651 "dtc-parser.tab.c" /* yacc.c:1646 */
1875 -#line 223 "dtc-parser.y" /* yacc.c:1646 */
1877 +#line 239 "dtc-parser.y" /* yacc.c:1646 */
1879 (yyval.data) = data_merge((yyvsp[-2].data), (yyvsp[-1].array).data);
1881 -#line 1639 "dtc-parser.tab.c" /* yacc.c:1646 */
1882 +#line 1659 "dtc-parser.tab.c" /* yacc.c:1646 */
1886 -#line 227 "dtc-parser.y" /* yacc.c:1646 */
1888 +#line 243 "dtc-parser.y" /* yacc.c:1646 */
1890 (yyval.data) = data_merge((yyvsp[-3].data), (yyvsp[-1].data));
1892 -#line 1647 "dtc-parser.tab.c" /* yacc.c:1646 */
1893 +#line 1667 "dtc-parser.tab.c" /* yacc.c:1646 */
1897 -#line 231 "dtc-parser.y" /* yacc.c:1646 */
1899 +#line 247 "dtc-parser.y" /* yacc.c:1646 */
1901 (yyval.data) = data_add_marker((yyvsp[-1].data), REF_PATH, (yyvsp[0].labelref));
1903 -#line 1655 "dtc-parser.tab.c" /* yacc.c:1646 */
1904 +#line 1675 "dtc-parser.tab.c" /* yacc.c:1646 */
1908 -#line 235 "dtc-parser.y" /* yacc.c:1646 */
1910 +#line 251 "dtc-parser.y" /* yacc.c:1646 */
1912 FILE *f = srcfile_relative_open((yyvsp[-5].data).val, NULL);
1914 @@ -1671,11 +1691,11 @@ yyreduce:
1915 (yyval.data) = data_merge((yyvsp[-8].data), d);
1918 -#line 1675 "dtc-parser.tab.c" /* yacc.c:1646 */
1919 +#line 1695 "dtc-parser.tab.c" /* yacc.c:1646 */
1923 -#line 251 "dtc-parser.y" /* yacc.c:1646 */
1925 +#line 267 "dtc-parser.y" /* yacc.c:1646 */
1927 FILE *f = srcfile_relative_open((yyvsp[-1].data).val, NULL);
1928 struct data d = empty_data;
1929 @@ -1685,43 +1705,43 @@ yyreduce:
1930 (yyval.data) = data_merge((yyvsp[-4].data), d);
1933 -#line 1689 "dtc-parser.tab.c" /* yacc.c:1646 */
1934 +#line 1709 "dtc-parser.tab.c" /* yacc.c:1646 */
1938 -#line 261 "dtc-parser.y" /* yacc.c:1646 */
1940 +#line 277 "dtc-parser.y" /* yacc.c:1646 */
1942 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1944 -#line 1697 "dtc-parser.tab.c" /* yacc.c:1646 */
1945 +#line 1717 "dtc-parser.tab.c" /* yacc.c:1646 */
1949 -#line 268 "dtc-parser.y" /* yacc.c:1646 */
1951 +#line 284 "dtc-parser.y" /* yacc.c:1646 */
1953 (yyval.data) = empty_data;
1955 -#line 1705 "dtc-parser.tab.c" /* yacc.c:1646 */
1956 +#line 1725 "dtc-parser.tab.c" /* yacc.c:1646 */
1960 -#line 272 "dtc-parser.y" /* yacc.c:1646 */
1962 +#line 288 "dtc-parser.y" /* yacc.c:1646 */
1964 (yyval.data) = (yyvsp[-1].data);
1966 -#line 1713 "dtc-parser.tab.c" /* yacc.c:1646 */
1967 +#line 1733 "dtc-parser.tab.c" /* yacc.c:1646 */
1971 -#line 276 "dtc-parser.y" /* yacc.c:1646 */
1973 +#line 292 "dtc-parser.y" /* yacc.c:1646 */
1975 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1977 -#line 1721 "dtc-parser.tab.c" /* yacc.c:1646 */
1978 +#line 1741 "dtc-parser.tab.c" /* yacc.c:1646 */
1982 -#line 283 "dtc-parser.y" /* yacc.c:1646 */
1984 +#line 299 "dtc-parser.y" /* yacc.c:1646 */
1986 unsigned long long bits;
1988 @@ -1737,20 +1757,20 @@ yyreduce:
1989 (yyval.array).data = empty_data;
1990 (yyval.array).bits = bits;
1992 -#line 1741 "dtc-parser.tab.c" /* yacc.c:1646 */
1993 +#line 1761 "dtc-parser.tab.c" /* yacc.c:1646 */
1997 -#line 299 "dtc-parser.y" /* yacc.c:1646 */
1999 +#line 315 "dtc-parser.y" /* yacc.c:1646 */
2001 (yyval.array).data = empty_data;
2002 (yyval.array).bits = 32;
2004 -#line 1750 "dtc-parser.tab.c" /* yacc.c:1646 */
2005 +#line 1770 "dtc-parser.tab.c" /* yacc.c:1646 */
2009 -#line 304 "dtc-parser.y" /* yacc.c:1646 */
2011 +#line 320 "dtc-parser.y" /* yacc.c:1646 */
2013 if ((yyvsp[-1].array).bits < 64) {
2014 uint64_t mask = (1ULL << (yyvsp[-1].array).bits) - 1;
2015 @@ -1769,11 +1789,11 @@ yyreduce:
2017 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, (yyvsp[0].integer), (yyvsp[-1].array).bits);
2019 -#line 1773 "dtc-parser.tab.c" /* yacc.c:1646 */
2020 +#line 1793 "dtc-parser.tab.c" /* yacc.c:1646 */
2024 -#line 323 "dtc-parser.y" /* yacc.c:1646 */
2026 +#line 339 "dtc-parser.y" /* yacc.c:1646 */
2028 uint64_t val = ~0ULL >> (64 - (yyvsp[-1].array).bits);
2030 @@ -1787,247 +1807,233 @@ yyreduce:
2032 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, val, (yyvsp[-1].array).bits);
2034 -#line 1791 "dtc-parser.tab.c" /* yacc.c:1646 */
2035 +#line 1811 "dtc-parser.tab.c" /* yacc.c:1646 */
2039 -#line 337 "dtc-parser.y" /* yacc.c:1646 */
2041 +#line 353 "dtc-parser.y" /* yacc.c:1646 */
2043 (yyval.array).data = data_add_marker((yyvsp[-1].array).data, LABEL, (yyvsp[0].labelref));
2045 -#line 1799 "dtc-parser.tab.c" /* yacc.c:1646 */
2046 +#line 1819 "dtc-parser.tab.c" /* yacc.c:1646 */
2050 -#line 346 "dtc-parser.y" /* yacc.c:1646 */
2052 +#line 362 "dtc-parser.y" /* yacc.c:1646 */
2054 (yyval.integer) = (yyvsp[-1].integer);
2056 -#line 1807 "dtc-parser.tab.c" /* yacc.c:1646 */
2057 +#line 1827 "dtc-parser.tab.c" /* yacc.c:1646 */
2061 -#line 357 "dtc-parser.y" /* yacc.c:1646 */
2063 +#line 373 "dtc-parser.y" /* yacc.c:1646 */
2064 { (yyval.integer) = (yyvsp[-4].integer) ? (yyvsp[-2].integer) : (yyvsp[0].integer); }
2065 -#line 1813 "dtc-parser.tab.c" /* yacc.c:1646 */
2066 +#line 1833 "dtc-parser.tab.c" /* yacc.c:1646 */
2070 -#line 362 "dtc-parser.y" /* yacc.c:1646 */
2072 +#line 378 "dtc-parser.y" /* yacc.c:1646 */
2073 { (yyval.integer) = (yyvsp[-2].integer) || (yyvsp[0].integer); }
2074 -#line 1819 "dtc-parser.tab.c" /* yacc.c:1646 */
2075 +#line 1839 "dtc-parser.tab.c" /* yacc.c:1646 */
2079 -#line 367 "dtc-parser.y" /* yacc.c:1646 */
2081 +#line 383 "dtc-parser.y" /* yacc.c:1646 */
2082 { (yyval.integer) = (yyvsp[-2].integer) && (yyvsp[0].integer); }
2083 -#line 1825 "dtc-parser.tab.c" /* yacc.c:1646 */
2084 +#line 1845 "dtc-parser.tab.c" /* yacc.c:1646 */
2088 -#line 372 "dtc-parser.y" /* yacc.c:1646 */
2090 +#line 388 "dtc-parser.y" /* yacc.c:1646 */
2091 { (yyval.integer) = (yyvsp[-2].integer) | (yyvsp[0].integer); }
2092 -#line 1831 "dtc-parser.tab.c" /* yacc.c:1646 */
2093 +#line 1851 "dtc-parser.tab.c" /* yacc.c:1646 */
2097 -#line 377 "dtc-parser.y" /* yacc.c:1646 */
2099 +#line 393 "dtc-parser.y" /* yacc.c:1646 */
2100 { (yyval.integer) = (yyvsp[-2].integer) ^ (yyvsp[0].integer); }
2101 -#line 1837 "dtc-parser.tab.c" /* yacc.c:1646 */
2102 +#line 1857 "dtc-parser.tab.c" /* yacc.c:1646 */
2106 -#line 382 "dtc-parser.y" /* yacc.c:1646 */
2108 +#line 398 "dtc-parser.y" /* yacc.c:1646 */
2109 { (yyval.integer) = (yyvsp[-2].integer) & (yyvsp[0].integer); }
2110 -#line 1843 "dtc-parser.tab.c" /* yacc.c:1646 */
2111 +#line 1863 "dtc-parser.tab.c" /* yacc.c:1646 */
2115 -#line 387 "dtc-parser.y" /* yacc.c:1646 */
2117 +#line 403 "dtc-parser.y" /* yacc.c:1646 */
2118 { (yyval.integer) = (yyvsp[-2].integer) == (yyvsp[0].integer); }
2119 -#line 1849 "dtc-parser.tab.c" /* yacc.c:1646 */
2120 +#line 1869 "dtc-parser.tab.c" /* yacc.c:1646 */
2124 -#line 388 "dtc-parser.y" /* yacc.c:1646 */
2126 +#line 404 "dtc-parser.y" /* yacc.c:1646 */
2127 { (yyval.integer) = (yyvsp[-2].integer) != (yyvsp[0].integer); }
2128 -#line 1855 "dtc-parser.tab.c" /* yacc.c:1646 */
2129 +#line 1875 "dtc-parser.tab.c" /* yacc.c:1646 */
2133 -#line 393 "dtc-parser.y" /* yacc.c:1646 */
2135 +#line 409 "dtc-parser.y" /* yacc.c:1646 */
2136 { (yyval.integer) = (yyvsp[-2].integer) < (yyvsp[0].integer); }
2137 -#line 1861 "dtc-parser.tab.c" /* yacc.c:1646 */
2138 +#line 1881 "dtc-parser.tab.c" /* yacc.c:1646 */
2142 -#line 394 "dtc-parser.y" /* yacc.c:1646 */
2144 +#line 410 "dtc-parser.y" /* yacc.c:1646 */
2145 { (yyval.integer) = (yyvsp[-2].integer) > (yyvsp[0].integer); }
2146 -#line 1867 "dtc-parser.tab.c" /* yacc.c:1646 */
2147 +#line 1887 "dtc-parser.tab.c" /* yacc.c:1646 */
2151 -#line 395 "dtc-parser.y" /* yacc.c:1646 */
2153 +#line 411 "dtc-parser.y" /* yacc.c:1646 */
2154 { (yyval.integer) = (yyvsp[-2].integer) <= (yyvsp[0].integer); }
2155 -#line 1873 "dtc-parser.tab.c" /* yacc.c:1646 */
2156 +#line 1893 "dtc-parser.tab.c" /* yacc.c:1646 */
2160 -#line 396 "dtc-parser.y" /* yacc.c:1646 */
2162 +#line 412 "dtc-parser.y" /* yacc.c:1646 */
2163 { (yyval.integer) = (yyvsp[-2].integer) >= (yyvsp[0].integer); }
2164 -#line 1879 "dtc-parser.tab.c" /* yacc.c:1646 */
2165 +#line 1899 "dtc-parser.tab.c" /* yacc.c:1646 */
2169 -#line 400 "dtc-parser.y" /* yacc.c:1646 */
2171 +#line 416 "dtc-parser.y" /* yacc.c:1646 */
2172 { (yyval.integer) = (yyvsp[-2].integer) << (yyvsp[0].integer); }
2173 -#line 1885 "dtc-parser.tab.c" /* yacc.c:1646 */
2174 +#line 1905 "dtc-parser.tab.c" /* yacc.c:1646 */
2178 -#line 401 "dtc-parser.y" /* yacc.c:1646 */
2180 +#line 417 "dtc-parser.y" /* yacc.c:1646 */
2181 { (yyval.integer) = (yyvsp[-2].integer) >> (yyvsp[0].integer); }
2182 -#line 1891 "dtc-parser.tab.c" /* yacc.c:1646 */
2183 +#line 1911 "dtc-parser.tab.c" /* yacc.c:1646 */
2187 -#line 406 "dtc-parser.y" /* yacc.c:1646 */
2189 +#line 422 "dtc-parser.y" /* yacc.c:1646 */
2190 { (yyval.integer) = (yyvsp[-2].integer) + (yyvsp[0].integer); }
2191 -#line 1897 "dtc-parser.tab.c" /* yacc.c:1646 */
2192 +#line 1917 "dtc-parser.tab.c" /* yacc.c:1646 */
2196 -#line 407 "dtc-parser.y" /* yacc.c:1646 */
2198 +#line 423 "dtc-parser.y" /* yacc.c:1646 */
2199 { (yyval.integer) = (yyvsp[-2].integer) - (yyvsp[0].integer); }
2200 -#line 1903 "dtc-parser.tab.c" /* yacc.c:1646 */
2201 +#line 1923 "dtc-parser.tab.c" /* yacc.c:1646 */
2205 -#line 412 "dtc-parser.y" /* yacc.c:1646 */
2207 +#line 428 "dtc-parser.y" /* yacc.c:1646 */
2208 { (yyval.integer) = (yyvsp[-2].integer) * (yyvsp[0].integer); }
2209 -#line 1909 "dtc-parser.tab.c" /* yacc.c:1646 */
2210 +#line 1929 "dtc-parser.tab.c" /* yacc.c:1646 */
2214 -#line 414 "dtc-parser.y" /* yacc.c:1646 */
2216 - if ((yyvsp[0].integer) != 0) {
2217 - (yyval.integer) = (yyvsp[-2].integer) / (yyvsp[0].integer);
2219 - ERROR(&(yyloc), "Division by zero");
2220 - (yyval.integer) = 0;
2223 -#line 1922 "dtc-parser.tab.c" /* yacc.c:1646 */
2225 +#line 429 "dtc-parser.y" /* yacc.c:1646 */
2226 + { (yyval.integer) = (yyvsp[-2].integer) / (yyvsp[0].integer); }
2227 +#line 1935 "dtc-parser.tab.c" /* yacc.c:1646 */
2231 -#line 423 "dtc-parser.y" /* yacc.c:1646 */
2233 - if ((yyvsp[0].integer) != 0) {
2234 - (yyval.integer) = (yyvsp[-2].integer) % (yyvsp[0].integer);
2236 - ERROR(&(yyloc), "Division by zero");
2237 - (yyval.integer) = 0;
2240 -#line 1935 "dtc-parser.tab.c" /* yacc.c:1646 */
2242 +#line 430 "dtc-parser.y" /* yacc.c:1646 */
2243 + { (yyval.integer) = (yyvsp[-2].integer) % (yyvsp[0].integer); }
2244 +#line 1941 "dtc-parser.tab.c" /* yacc.c:1646 */
2249 #line 436 "dtc-parser.y" /* yacc.c:1646 */
2250 { (yyval.integer) = -(yyvsp[0].integer); }
2251 -#line 1941 "dtc-parser.tab.c" /* yacc.c:1646 */
2252 +#line 1947 "dtc-parser.tab.c" /* yacc.c:1646 */
2257 #line 437 "dtc-parser.y" /* yacc.c:1646 */
2258 { (yyval.integer) = ~(yyvsp[0].integer); }
2259 -#line 1947 "dtc-parser.tab.c" /* yacc.c:1646 */
2260 +#line 1953 "dtc-parser.tab.c" /* yacc.c:1646 */
2265 #line 438 "dtc-parser.y" /* yacc.c:1646 */
2266 { (yyval.integer) = !(yyvsp[0].integer); }
2267 -#line 1953 "dtc-parser.tab.c" /* yacc.c:1646 */
2268 +#line 1959 "dtc-parser.tab.c" /* yacc.c:1646 */
2273 #line 443 "dtc-parser.y" /* yacc.c:1646 */
2275 (yyval.data) = empty_data;
2277 -#line 1961 "dtc-parser.tab.c" /* yacc.c:1646 */
2278 +#line 1967 "dtc-parser.tab.c" /* yacc.c:1646 */
2283 #line 447 "dtc-parser.y" /* yacc.c:1646 */
2285 (yyval.data) = data_append_byte((yyvsp[-1].data), (yyvsp[0].byte));
2287 -#line 1969 "dtc-parser.tab.c" /* yacc.c:1646 */
2288 +#line 1975 "dtc-parser.tab.c" /* yacc.c:1646 */
2293 #line 451 "dtc-parser.y" /* yacc.c:1646 */
2295 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
2297 -#line 1977 "dtc-parser.tab.c" /* yacc.c:1646 */
2298 +#line 1983 "dtc-parser.tab.c" /* yacc.c:1646 */
2303 #line 458 "dtc-parser.y" /* yacc.c:1646 */
2305 (yyval.nodelist) = NULL;
2307 -#line 1985 "dtc-parser.tab.c" /* yacc.c:1646 */
2308 +#line 1991 "dtc-parser.tab.c" /* yacc.c:1646 */
2313 #line 462 "dtc-parser.y" /* yacc.c:1646 */
2315 (yyval.nodelist) = chain_node((yyvsp[-1].node), (yyvsp[0].nodelist));
2317 -#line 1993 "dtc-parser.tab.c" /* yacc.c:1646 */
2318 +#line 1999 "dtc-parser.tab.c" /* yacc.c:1646 */
2323 #line 466 "dtc-parser.y" /* yacc.c:1646 */
2325 ERROR(&(yylsp[0]), "Properties must precede subnodes");
2328 -#line 2002 "dtc-parser.tab.c" /* yacc.c:1646 */
2329 +#line 2008 "dtc-parser.tab.c" /* yacc.c:1646 */
2334 #line 474 "dtc-parser.y" /* yacc.c:1646 */
2336 (yyval.node) = name_node((yyvsp[0].node), (yyvsp[-1].propnodename));
2338 -#line 2010 "dtc-parser.tab.c" /* yacc.c:1646 */
2339 +#line 2016 "dtc-parser.tab.c" /* yacc.c:1646 */
2344 #line 478 "dtc-parser.y" /* yacc.c:1646 */
2346 (yyval.node) = name_node(build_node_delete(), (yyvsp[-1].propnodename));
2348 -#line 2018 "dtc-parser.tab.c" /* yacc.c:1646 */
2349 +#line 2024 "dtc-parser.tab.c" /* yacc.c:1646 */
2354 #line 482 "dtc-parser.y" /* yacc.c:1646 */
2356 add_label(&(yyvsp[0].node)->labels, (yyvsp[-1].labelref));
2357 (yyval.node) = (yyvsp[0].node);
2359 -#line 2027 "dtc-parser.tab.c" /* yacc.c:1646 */
2360 +#line 2033 "dtc-parser.tab.c" /* yacc.c:1646 */
2364 -#line 2031 "dtc-parser.tab.c" /* yacc.c:1646 */
2365 +#line 2037 "dtc-parser.tab.c" /* yacc.c:1646 */
2368 /* User semantic actions sometimes alter yychar, and that requires
2369 --- a/scripts/dtc/dtc-parser.tab.h_shipped
2370 +++ b/scripts/dtc/dtc-parser.tab.h_shipped
2371 @@ -46,26 +46,27 @@ extern int yydebug;
2375 - DT_MEMRESERVE = 259,
2385 - DT_DEL_PROP = 269,
2386 - DT_DEL_NODE = 270,
2387 - DT_PROPNODENAME = 271,
2389 - DT_CHAR_LITERAL = 273,
2396 + DT_MEMRESERVE = 260,
2406 + DT_DEL_PROP = 270,
2407 + DT_DEL_NODE = 271,
2408 + DT_PROPNODENAME = 272,
2410 + DT_CHAR_LITERAL = 274,
2419 @@ -74,7 +75,7 @@ extern int yydebug;
2420 typedef union YYSTYPE YYSTYPE;
2423 -#line 38 "dtc-parser.y" /* yacc.c:1909 */
2424 +#line 39 "dtc-parser.y" /* yacc.c:1909 */
2428 @@ -92,8 +93,9 @@ union YYSTYPE
2429 struct node *nodelist;
2430 struct reserve_info *re;
2434 -#line 97 "dtc-parser.tab.h" /* yacc.c:1909 */
2435 +#line 99 "dtc-parser.tab.h" /* yacc.c:1909 */
2437 # define YYSTYPE_IS_TRIVIAL 1
2438 # define YYSTYPE_IS_DECLARED 1
2439 --- a/scripts/dtc/dtc-parser.y
2440 +++ b/scripts/dtc/dtc-parser.y
2445 +#include <inttypes.h>
2449 @@ -52,9 +53,11 @@ extern bool treesource_error;
2450 struct node *nodelist;
2451 struct reserve_info *re;
2458 %token DT_MEMRESERVE
2459 %token DT_LSHIFT DT_RSHIFT DT_LE DT_GE DT_EQ DT_NE DT_AND DT_OR
2461 @@ -71,6 +74,7 @@ extern bool treesource_error;
2463 %type <data> propdata
2464 %type <data> propdataprefix
2465 +%type <is_plugin> plugindecl
2466 %type <re> memreserve
2467 %type <re> memreserves
2468 %type <array> arrayprefix
2469 @@ -101,10 +105,22 @@ extern bool treesource_error;
2473 - DT_V1 ';' memreserves devicetree
2474 + DT_V1 ';' plugindecl memreserves devicetree
2476 - the_boot_info = build_boot_info($3, $4,
2477 - guess_boot_cpuid($4));
2478 + $5->is_plugin = $3;
2479 + the_boot_info = build_boot_info($4, $5,
2480 + guess_boot_cpuid($5));
2495 --- a/scripts/dtc/dtc.c
2496 +++ b/scripts/dtc/dtc.c
2497 @@ -31,6 +31,7 @@ int reservenum; /* Number of memory res
2498 int minsize; /* Minimum blob size */
2499 int padsize; /* Additional padding to blob */
2500 int phandle_format = PHANDLE_BOTH; /* Use linux,phandle or phandle properties */
2501 +int symbol_fixup_support = 0;
2503 static void fill_fullpaths(struct node *tree, const char *prefix)
2505 @@ -53,7 +54,7 @@ static void fill_fullpaths(struct node *
2506 #define FDT_VERSION(version) _FDT_VERSION(version)
2507 #define _FDT_VERSION(version) #version
2508 static const char usage_synopsis[] = "dtc [options] <input file>";
2509 -static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv";
2510 +static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:@hv";
2511 static struct option const usage_long_opts[] = {
2512 {"quiet", no_argument, NULL, 'q'},
2513 {"in-format", a_argument, NULL, 'I'},
2514 @@ -71,6 +72,7 @@ static struct option const usage_long_op
2515 {"phandle", a_argument, NULL, 'H'},
2516 {"warning", a_argument, NULL, 'W'},
2517 {"error", a_argument, NULL, 'E'},
2518 + {"symbols", no_argument, NULL, '@'},
2519 {"help", no_argument, NULL, 'h'},
2520 {"version", no_argument, NULL, 'v'},
2521 {NULL, no_argument, NULL, 0x0},
2522 @@ -101,6 +103,7 @@ static const char * const usage_opts_hel
2523 "\t\tboth - Both \"linux,phandle\" and \"phandle\" properties",
2524 "\n\tEnable/disable warnings (prefix with \"no-\")",
2525 "\n\tEnable/disable errors (prefix with \"no-\")",
2526 + "\n\tEnable symbols/fixup support",
2527 "\n\tPrint this help and exit",
2528 "\n\tPrint version and exit",
2530 @@ -233,7 +236,9 @@ int main(int argc, char *argv[])
2532 parse_checks_option(false, true, optarg);
2536 + symbol_fixup_support = 1;
2541 --- a/scripts/dtc/dtc.h
2542 +++ b/scripts/dtc/dtc.h
2543 @@ -54,6 +54,7 @@ extern int reservenum; /* Number of mem
2544 extern int minsize; /* Minimum blob size */
2545 extern int padsize; /* Additional padding to blob */
2546 extern int phandle_format; /* Use linux,phandle or phandle properties */
2547 +extern int symbol_fixup_support;/* enable symbols & fixup support */
2549 #define PHANDLE_LEGACY 0x1
2550 #define PHANDLE_EPAPR 0x2
2551 @@ -132,6 +133,26 @@ struct label {
2555 +struct fixup_entry {
2557 + struct node *node;
2558 + struct property *prop;
2559 + struct fixup_entry *next;
2560 + bool local_fixup_generated;
2565 + struct fixup_entry *entries;
2566 + struct fixup *next;
2570 + struct label *label;
2571 + struct node *node;
2572 + struct symbol *next;
2578 @@ -158,6 +179,13 @@ struct node {
2579 int addr_cells, size_cells;
2581 struct label *labels;
2583 + struct symbol *symbols;
2584 + struct fixup_entry *local_fixups;
2585 + bool emit_local_fixup_node;
2588 + struct fixup *fixups;
2591 #define for_each_label_withdel(l0, l) \
2592 @@ -181,6 +209,18 @@ struct node {
2593 for_each_child_withdel(n, c) \
2596 +#define for_each_fixup(n, f) \
2597 + for ((f) = (n)->fixups; (f); (f) = (f)->next)
2599 +#define for_each_fixup_entry(f, fe) \
2600 + for ((fe) = (f)->entries; (fe); (fe) = (fe)->next)
2602 +#define for_each_symbol(n, s) \
2603 + for ((s) = (n)->symbols; (s); (s) = (s)->next)
2605 +#define for_each_local_fixup_entry(n, fe) \
2606 + for ((fe) = (n)->local_fixups; (fe); (fe) = (fe)->next)
2608 void add_label(struct label **labels, char *label);
2609 void delete_labels(struct label **labels);
2611 --- a/scripts/dtc/flattree.c
2612 +++ b/scripts/dtc/flattree.c
2613 @@ -255,6 +255,204 @@ static int stringtable_insert(struct dat
2617 +static void emit_local_fixups(struct node *tree, struct emitter *emit,
2618 + void *etarget, struct data *strbuf, struct version_info *vi,
2619 + struct node *node)
2621 + struct fixup_entry *fe, *fen;
2622 + struct node *child;
2623 + int nameoff, count;
2627 + if (node->emit_local_fixup_node) {
2629 + /* emit the external fixups (do not emit /) */
2630 + if (node != tree) {
2631 + emit->beginnode(etarget, NULL);
2632 + emit->string(etarget, node->name, 0);
2633 + emit->align(etarget, sizeof(cell_t));
2636 + for_each_local_fixup_entry(tree, fe) {
2637 + if (fe->node != node || fe->local_fixup_generated)
2640 + /* count the number of fixup entries */
2642 + for_each_local_fixup_entry(tree, fen) {
2643 + if (fen->prop != fe->prop)
2645 + fen->local_fixup_generated = true;
2649 + /* allocate buffer */
2650 + buf = xmalloc(count * sizeof(cell_t));
2652 + /* collect all the offsets in buffer */
2654 + for_each_local_fixup_entry(tree, fen) {
2655 + if (fen->prop != fe->prop)
2657 + fen->local_fixup_generated = true;
2658 + buf[count++] = cpu_to_fdt32(fen->offset);
2661 + d.len = count * sizeof(cell_t);
2662 + d.val = (char *)buf;
2664 + nameoff = stringtable_insert(strbuf, fe->prop->name);
2665 + emit->property(etarget, fe->prop->labels);
2666 + emit->cell(etarget, count * sizeof(cell_t));
2667 + emit->cell(etarget, nameoff);
2669 + if ((vi->flags & FTF_VARALIGN) &&
2670 + (count * sizeof(cell_t)) >= 8)
2671 + emit->align(etarget, 8);
2673 + emit->data(etarget, d);
2674 + emit->align(etarget, sizeof(cell_t));
2680 + for_each_child(node, child)
2681 + emit_local_fixups(tree, emit, etarget, strbuf, vi, child);
2683 + if (node->emit_local_fixup_node && node != tree)
2684 + emit->endnode(etarget, tree->labels);
2687 +static void emit_symbols_node(struct node *tree, struct emitter *emit,
2688 + void *etarget, struct data *strbuf,
2689 + struct version_info *vi)
2691 + struct symbol *sym;
2692 + int nameoff, vallen;
2694 + /* do nothing if no symbols */
2695 + if (!tree->symbols)
2698 + emit->beginnode(etarget, NULL);
2699 + emit->string(etarget, "__symbols__", 0);
2700 + emit->align(etarget, sizeof(cell_t));
2702 + for_each_symbol(tree, sym) {
2704 + vallen = strlen(sym->node->fullpath);
2706 + nameoff = stringtable_insert(strbuf, sym->label->label);
2708 + emit->property(etarget, NULL);
2709 + emit->cell(etarget, vallen + 1);
2710 + emit->cell(etarget, nameoff);
2712 + if ((vi->flags & FTF_VARALIGN) && vallen >= 8)
2713 + emit->align(etarget, 8);
2715 + emit->string(etarget, sym->node->fullpath,
2716 + strlen(sym->node->fullpath));
2717 + emit->align(etarget, sizeof(cell_t));
2720 + emit->endnode(etarget, NULL);
2723 +static void emit_local_fixups_node(struct node *tree, struct emitter *emit,
2724 + void *etarget, struct data *strbuf,
2725 + struct version_info *vi)
2727 + struct fixup_entry *fe;
2728 + struct node *node;
2730 + /* do nothing if no local fixups */
2731 + if (!tree->local_fixups)
2734 + /* mark all nodes that need a local fixup generated (and parents) */
2735 + for_each_local_fixup_entry(tree, fe) {
2737 + while (node != NULL && !node->emit_local_fixup_node) {
2738 + node->emit_local_fixup_node = true;
2739 + node = node->parent;
2743 + /* emit the local fixups node now */
2744 + emit->beginnode(etarget, NULL);
2745 + emit->string(etarget, "__local_fixups__", 0);
2746 + emit->align(etarget, sizeof(cell_t));
2748 + emit_local_fixups(tree, emit, etarget, strbuf, vi, tree);
2750 + emit->endnode(etarget, tree->labels);
2753 +static void emit_fixups_node(struct node *tree, struct emitter *emit,
2754 + void *etarget, struct data *strbuf,
2755 + struct version_info *vi)
2758 + struct fixup_entry *fe;
2760 + const char *fullpath;
2761 + int namesz, nameoff, vallen;
2763 + /* do nothing if no fixups */
2764 + if (!tree->fixups)
2767 + /* emit the external fixups */
2768 + emit->beginnode(etarget, NULL);
2769 + emit->string(etarget, "__fixups__", 0);
2770 + emit->align(etarget, sizeof(cell_t));
2772 + for_each_fixup(tree, f) {
2775 + for_each_fixup_entry(f, fe) {
2776 + fullpath = fe->node->fullpath;
2777 + if (fullpath[0] == '\0')
2779 + namesz += strlen(fullpath) + 1;
2780 + namesz += strlen(fe->prop->name) + 1;
2781 + namesz += 32; /* space for :<number> + '\0' */
2784 + name = xmalloc(namesz);
2787 + for_each_fixup_entry(f, fe) {
2788 + fullpath = fe->node->fullpath;
2789 + if (fullpath[0] == '\0')
2791 + snprintf(s, name + namesz - s, "%s:%s:%d", fullpath,
2792 + fe->prop->name, fe->offset);
2793 + s += strlen(s) + 1;
2796 + nameoff = stringtable_insert(strbuf, f->ref);
2797 + vallen = s - name - 1;
2799 + emit->property(etarget, NULL);
2800 + emit->cell(etarget, vallen + 1);
2801 + emit->cell(etarget, nameoff);
2803 + if ((vi->flags & FTF_VARALIGN) && vallen >= 8)
2804 + emit->align(etarget, 8);
2806 + emit->string(etarget, name, vallen);
2807 + emit->align(etarget, sizeof(cell_t));
2812 + emit->endnode(etarget, tree->labels);
2815 static void flatten_tree(struct node *tree, struct emitter *emit,
2816 void *etarget, struct data *strbuf,
2817 struct version_info *vi)
2818 @@ -310,6 +508,10 @@ static void flatten_tree(struct node *tr
2819 flatten_tree(child, emit, etarget, strbuf, vi);
2822 + emit_symbols_node(tree, emit, etarget, strbuf, vi);
2823 + emit_local_fixups_node(tree, emit, etarget, strbuf, vi);
2824 + emit_fixups_node(tree, emit, etarget, strbuf, vi);
2826 emit->endnode(etarget, tree->labels);
2829 --- a/scripts/dtc/version_gen.h
2830 +++ b/scripts/dtc/version_gen.h
2832 -#define DTC_VERSION "DTC 1.4.1-g53bf130b"
2833 +#define DTC_VERSION "DTC 1.4.1-g25efc119"