1 From c128c19379082f13558d4b51ae7d15a209bd9918 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/checks.c | 105 ++++-
11 scripts/dtc/dtc-lexer.l | 5 +
12 scripts/dtc/dtc-lexer.lex.c_shipped | 490 ++++++++++++------------
13 scripts/dtc/dtc-parser.tab.c_shipped | 722 ++++++++++++++++++-----------------
14 scripts/dtc/dtc-parser.tab.h_shipped | 46 +--
15 scripts/dtc/dtc-parser.y | 22 +-
16 scripts/dtc/dtc.c | 9 +-
17 scripts/dtc/dtc.h | 40 ++
18 scripts/dtc/flattree.c | 202 ++++++++++
19 scripts/dtc/version_gen.h | 2 +-
20 10 files changed, 1021 insertions(+), 622 deletions(-)
22 --- a/scripts/dtc/checks.c
23 +++ b/scripts/dtc/checks.c
24 @@ -458,6 +458,8 @@ static void fixup_phandle_references(str
25 struct node *node, struct property *prop)
27 struct marker *m = prop->val.markers;
28 + struct fixup *f, **fp;
29 + struct fixup_entry *fe, **fep;
33 @@ -466,11 +468,69 @@ static void fixup_phandle_references(str
35 refnode = get_node_by_ref(dt, m->ref);
37 - FAIL(c, "Reference to non-existent node or label \"%s\"\n",
39 + if (!dt->is_plugin) {
40 + FAIL(c, "Reference to non-existent node or label \"%s\"\n",
45 + /* allocate fixup entry */
46 + fe = xmalloc(sizeof(*fe));
50 + fe->offset = m->offset;
53 + /* search for an already existing fixup */
54 + for_each_fixup(dt, f)
55 + if (strcmp(f->ref, m->ref) == 0)
58 + /* no fixup found, add new */
60 + f = xmalloc(sizeof(*f));
65 + /* add it to the tree */
72 + /* and now append fixup entry */
75 + fep = &(*fep)->next;
78 + /* mark the entry as unresolved */
79 + *((cell_t *)(prop->val.val + m->offset)) =
80 + cpu_to_fdt32(0xdeadbeef);
84 + /* if it's a local reference, we need to record it */
85 + if (symbol_fixup_support) {
87 + /* allocate a new local fixup entry */
88 + fe = xmalloc(sizeof(*fe));
92 + fe->offset = m->offset;
95 + /* append it to the local fixups */
96 + fep = &dt->local_fixups;
98 + fep = &(*fep)->next;
102 phandle = get_node_phandle(dt, refnode);
103 *((cell_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle);
105 @@ -652,6 +712,45 @@ static void check_obsolete_chosen_interr
107 TREE_WARNING(obsolete_chosen_interrupt_controller, NULL);
109 +static void check_auto_label_phandles(struct check *c, struct node *dt,
113 + struct symbol *s, **sp;
116 + if (!symbol_fixup_support)
120 + for_each_label(node->labels, l) {
128 + /* force allocation of a phandle for this node */
129 + (void)get_node_phandle(dt, node);
131 + /* add the symbol */
132 + for_each_label(node->labels, l) {
134 + s = xmalloc(sizeof(*s));
139 + /* add it to the symbols list */
142 + sp = &((*sp)->next);
146 +NODE_WARNING(auto_label_phandles, NULL);
148 static struct check *check_table[] = {
149 &duplicate_node_names, &duplicate_property_names,
150 &node_name_chars, &node_name_format, &property_name_chars,
151 @@ -670,6 +769,8 @@ static struct check *check_table[] = {
152 &avoid_default_addr_size,
153 &obsolete_chosen_interrupt_controller,
155 + &auto_label_phandles,
160 --- a/scripts/dtc/dtc-lexer.l
161 +++ b/scripts/dtc/dtc-lexer.l
162 @@ -113,6 +113,11 @@ static void lexical_error(const char *fm
167 + DPRINT("Keyword: /plugin/\n");
172 DPRINT("Keyword: /memreserve/\n");
174 --- a/scripts/dtc/dtc-lexer.lex.c_shipped
175 +++ b/scripts/dtc/dtc-lexer.lex.c_shipped
178 #define YY_FLEX_MAJOR_VERSION 2
179 #define YY_FLEX_MINOR_VERSION 5
180 -#define YY_FLEX_SUBMINOR_VERSION 39
181 +#define YY_FLEX_SUBMINOR_VERSION 35
182 #if YY_FLEX_SUBMINOR_VERSION > 0
185 @@ -162,12 +162,7 @@ typedef unsigned int flex_uint32_t;
186 typedef struct yy_buffer_state *YY_BUFFER_STATE;
189 -#ifndef YY_TYPEDEF_YY_SIZE_T
190 -#define YY_TYPEDEF_YY_SIZE_T
191 -typedef size_t yy_size_t;
194 -extern yy_size_t yyleng;
197 extern FILE *yyin, *yyout;
199 @@ -176,7 +171,6 @@ extern FILE *yyin, *yyout;
200 #define EOB_ACT_LAST_MATCH 2
202 #define YY_LESS_LINENO(n)
203 - #define YY_LINENO_REWIND_TO(ptr)
205 /* Return all but the first "n" matched characters back to the input stream. */
207 @@ -194,6 +188,11 @@ extern FILE *yyin, *yyout;
209 #define unput(c) yyunput( c, (yytext_ptr) )
211 +#ifndef YY_TYPEDEF_YY_SIZE_T
212 +#define YY_TYPEDEF_YY_SIZE_T
213 +typedef size_t yy_size_t;
216 #ifndef YY_STRUCT_YY_BUFFER_STATE
217 #define YY_STRUCT_YY_BUFFER_STATE
218 struct yy_buffer_state
219 @@ -211,7 +210,7 @@ struct yy_buffer_state
220 /* Number of characters read into yy_ch_buf, not including EOB
223 - yy_size_t yy_n_chars;
226 /* Whether we "own" the buffer - i.e., we know we created it,
227 * and can realloc() it to grow it, and should free() it to
228 @@ -281,8 +280,8 @@ static YY_BUFFER_STATE * yy_buffer_stack
230 /* yy_hold_char holds the character lost when yytext is formed. */
231 static char yy_hold_char;
232 -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
234 +static int yy_n_chars; /* number of characters read into yy_ch_buf */
237 /* Points to current character in buffer. */
238 static char *yy_c_buf_p = (char *) 0;
239 @@ -310,7 +309,7 @@ static void yy_init_buffer (YY_BUFFER_ST
241 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
242 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
243 -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
244 +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
246 void *yyalloc (yy_size_t );
247 void *yyrealloc (void *,yy_size_t );
248 @@ -342,7 +341,7 @@ void yyfree (void * );
250 /* Begin user sect3 */
254 #define YY_SKIP_YYWRAP
256 typedef unsigned char YY_CHAR;
257 @@ -373,8 +372,8 @@ static void yy_fatal_error (yyconst char
259 (yy_c_buf_p) = yy_cp;
261 -#define YY_NUM_RULES 30
262 -#define YY_END_OF_BUFFER 31
263 +#define YY_NUM_RULES 31
264 +#define YY_END_OF_BUFFER 32
265 /* This struct is not used in this scanner,
266 but its presence is necessary. */
268 @@ -382,25 +381,26 @@ struct yy_trans_info
269 flex_int32_t yy_verify;
272 -static yyconst flex_int16_t yy_accept[159] =
273 +static yyconst flex_int16_t yy_accept[166] =
275 - 0, 0, 0, 0, 0, 0, 0, 0, 31, 29,
276 - 18, 18, 29, 29, 29, 29, 29, 29, 29, 29,
277 - 29, 29, 29, 29, 29, 29, 15, 16, 16, 29,
278 - 16, 10, 10, 18, 26, 0, 3, 0, 27, 12,
279 - 0, 0, 11, 0, 0, 0, 0, 0, 0, 0,
280 - 21, 23, 25, 24, 22, 0, 9, 28, 0, 0,
281 - 0, 14, 14, 16, 16, 16, 10, 10, 10, 0,
282 - 12, 0, 11, 0, 0, 0, 20, 0, 0, 0,
283 - 0, 0, 0, 0, 0, 16, 10, 10, 10, 0,
284 - 13, 19, 0, 0, 0, 0, 0, 0, 0, 0,
286 - 0, 16, 0, 0, 0, 0, 0, 0, 0, 0,
287 - 0, 16, 6, 0, 0, 0, 0, 0, 0, 2,
288 - 0, 0, 0, 0, 0, 0, 0, 0, 4, 17,
289 - 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
290 - 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
291 - 5, 8, 0, 0, 0, 0, 7, 0
292 + 0, 0, 0, 0, 0, 0, 0, 0, 32, 30,
293 + 19, 19, 30, 30, 30, 30, 30, 30, 30, 30,
294 + 30, 30, 30, 30, 30, 30, 16, 17, 17, 30,
295 + 17, 11, 11, 19, 27, 0, 3, 0, 28, 13,
296 + 0, 0, 12, 0, 0, 0, 0, 0, 0, 0,
297 + 0, 22, 24, 26, 25, 23, 0, 10, 29, 0,
298 + 0, 0, 15, 15, 17, 17, 17, 11, 11, 11,
299 + 0, 13, 0, 12, 0, 0, 0, 21, 0, 0,
300 + 0, 0, 0, 0, 0, 0, 0, 17, 11, 11,
301 + 11, 0, 14, 20, 0, 0, 0, 0, 0, 0,
303 + 0, 0, 0, 0, 17, 0, 0, 0, 0, 0,
304 + 0, 0, 0, 0, 0, 17, 7, 0, 0, 0,
305 + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
306 + 0, 0, 0, 0, 4, 18, 0, 0, 5, 2,
307 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
308 + 0, 0, 1, 0, 0, 0, 0, 6, 9, 0,
312 static yyconst flex_int32_t yy_ec[256] =
313 @@ -416,9 +416,9 @@ static yyconst flex_int32_t yy_ec[256] =
314 22, 22, 22, 22, 24, 22, 22, 25, 22, 22,
315 1, 26, 27, 1, 22, 1, 21, 28, 29, 30,
317 - 31, 21, 22, 22, 32, 22, 22, 33, 34, 35,
318 - 36, 37, 22, 38, 39, 40, 41, 42, 22, 25,
319 - 43, 22, 44, 45, 46, 1, 1, 1, 1, 1,
320 + 31, 21, 32, 22, 33, 22, 22, 34, 35, 36,
321 + 37, 38, 22, 39, 40, 41, 42, 43, 22, 25,
322 + 44, 22, 45, 46, 47, 1, 1, 1, 1, 1,
323 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
324 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
325 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
326 @@ -435,163 +435,165 @@ static yyconst flex_int32_t yy_ec[256] =
330 -static yyconst flex_int32_t yy_meta[47] =
331 +static yyconst flex_int32_t yy_meta[48] =
333 1, 1, 1, 1, 1, 1, 2, 3, 1, 2,
334 2, 2, 4, 5, 5, 5, 6, 1, 1, 1,
335 7, 8, 8, 8, 8, 1, 1, 7, 7, 7,
336 7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
338 + 8, 8, 8, 8, 3, 1, 4
341 -static yyconst flex_int16_t yy_base[173] =
342 +static yyconst flex_int16_t yy_base[180] =
344 - 0, 383, 34, 382, 65, 381, 37, 105, 387, 391,
345 - 54, 111, 367, 110, 109, 109, 112, 41, 366, 104,
346 - 367, 338, 124, 117, 0, 144, 391, 0, 121, 0,
347 - 135, 155, 140, 179, 391, 160, 391, 379, 391, 0,
348 - 368, 141, 391, 167, 370, 376, 346, 103, 342, 345,
349 - 391, 391, 391, 391, 391, 358, 391, 391, 175, 342,
350 - 338, 391, 355, 0, 185, 339, 184, 347, 346, 0,
351 - 0, 322, 175, 357, 175, 363, 352, 324, 330, 323,
352 - 332, 326, 201, 324, 329, 322, 391, 333, 181, 309,
353 - 391, 341, 340, 313, 320, 338, 178, 311, 146, 317,
355 - 314, 315, 335, 331, 303, 300, 309, 299, 308, 188,
356 - 336, 335, 391, 305, 320, 281, 283, 271, 203, 288,
357 - 281, 271, 266, 264, 245, 242, 208, 104, 391, 391,
358 - 244, 218, 204, 219, 206, 224, 201, 212, 204, 229,
359 - 215, 208, 207, 200, 219, 391, 233, 221, 200, 181,
360 - 391, 391, 149, 122, 86, 41, 391, 391, 245, 251,
361 - 259, 263, 267, 273, 280, 284, 292, 300, 304, 310,
363 + 0, 393, 35, 392, 66, 391, 38, 107, 397, 401,
364 + 55, 113, 377, 112, 111, 111, 114, 42, 376, 106,
365 + 377, 347, 126, 120, 0, 147, 401, 0, 124, 0,
366 + 137, 158, 170, 163, 401, 153, 401, 389, 401, 0,
367 + 378, 120, 401, 131, 380, 386, 355, 139, 351, 355,
368 + 351, 401, 401, 401, 401, 401, 367, 401, 401, 185,
369 + 350, 346, 401, 364, 0, 185, 347, 189, 356, 355,
370 + 0, 0, 330, 180, 366, 141, 372, 361, 332, 338,
371 + 331, 341, 334, 326, 205, 331, 337, 329, 401, 341,
372 + 167, 316, 401, 349, 348, 320, 328, 346, 180, 318,
374 + 324, 209, 324, 320, 322, 342, 338, 309, 306, 315,
375 + 305, 315, 312, 192, 342, 341, 401, 293, 306, 282,
376 + 268, 252, 255, 203, 285, 282, 272, 268, 252, 233,
377 + 232, 239, 208, 107, 401, 401, 238, 211, 401, 211,
378 + 212, 208, 228, 203, 215, 207, 233, 222, 212, 211,
379 + 203, 227, 401, 237, 225, 204, 185, 401, 401, 149,
380 + 128, 88, 42, 401, 401, 253, 259, 267, 271, 275,
381 + 281, 288, 292, 300, 308, 312, 318, 326, 334
384 -static yyconst flex_int16_t yy_def[173] =
385 +static yyconst flex_int16_t yy_def[180] =
387 - 158, 1, 1, 3, 158, 5, 1, 1, 158, 158,
388 - 158, 158, 158, 159, 160, 161, 158, 158, 158, 158,
389 - 162, 158, 158, 158, 163, 162, 158, 164, 165, 164,
390 - 164, 158, 158, 158, 158, 159, 158, 159, 158, 166,
391 - 158, 161, 158, 161, 167, 168, 158, 158, 158, 158,
392 - 158, 158, 158, 158, 158, 162, 158, 158, 158, 158,
393 - 158, 158, 162, 164, 165, 164, 158, 158, 158, 169,
394 - 166, 170, 161, 167, 167, 168, 158, 158, 158, 158,
395 - 158, 158, 158, 158, 158, 164, 158, 158, 169, 170,
396 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
398 - 158, 164, 158, 158, 158, 158, 158, 158, 158, 171,
399 - 158, 164, 158, 158, 158, 158, 158, 158, 171, 158,
400 - 171, 158, 158, 158, 158, 158, 158, 158, 158, 158,
401 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
402 - 172, 158, 158, 158, 172, 158, 172, 158, 158, 158,
403 - 158, 158, 158, 158, 158, 158, 158, 0, 158, 158,
404 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
406 + 165, 1, 1, 3, 165, 5, 1, 1, 165, 165,
407 + 165, 165, 165, 166, 167, 168, 165, 165, 165, 165,
408 + 169, 165, 165, 165, 170, 169, 165, 171, 172, 171,
409 + 171, 165, 165, 165, 165, 166, 165, 166, 165, 173,
410 + 165, 168, 165, 168, 174, 175, 165, 165, 165, 165,
411 + 165, 165, 165, 165, 165, 165, 169, 165, 165, 165,
412 + 165, 165, 165, 169, 171, 172, 171, 165, 165, 165,
413 + 176, 173, 177, 168, 174, 174, 175, 165, 165, 165,
414 + 165, 165, 165, 165, 165, 165, 165, 171, 165, 165,
415 + 176, 177, 165, 165, 165, 165, 165, 165, 165, 165,
417 + 165, 165, 165, 165, 171, 165, 165, 165, 165, 165,
418 + 165, 165, 165, 178, 165, 171, 165, 165, 165, 165,
419 + 165, 165, 165, 178, 165, 178, 165, 165, 165, 165,
420 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
421 + 165, 165, 165, 165, 165, 165, 165, 179, 165, 165,
422 + 165, 179, 165, 179, 165, 165, 165, 165, 165, 165,
423 + 165, 165, 165, 165, 0, 165, 165, 165, 165, 165,
424 + 165, 165, 165, 165, 165, 165, 165, 165, 165
427 -static yyconst flex_int16_t yy_nxt[438] =
428 +static yyconst flex_int16_t yy_nxt[449] =
430 10, 11, 12, 11, 13, 14, 10, 15, 16, 10,
431 10, 10, 17, 10, 10, 10, 10, 18, 19, 20,
432 21, 21, 21, 21, 21, 10, 10, 21, 21, 21,
433 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
434 - 21, 21, 21, 10, 22, 10, 24, 25, 25, 25,
435 - 32, 33, 33, 157, 26, 34, 34, 34, 51, 52,
436 - 27, 26, 26, 26, 26, 10, 11, 12, 11, 13,
437 - 14, 28, 15, 16, 28, 28, 28, 24, 28, 28,
438 - 28, 10, 18, 19, 20, 29, 29, 29, 29, 29,
439 - 30, 10, 29, 29, 29, 29, 29, 29, 29, 29,
441 - 29, 29, 29, 29, 29, 29, 29, 29, 10, 22,
442 - 10, 23, 34, 34, 34, 37, 39, 43, 32, 33,
443 - 33, 45, 54, 55, 46, 59, 45, 64, 156, 46,
444 - 64, 64, 64, 79, 44, 38, 59, 57, 134, 47,
445 - 135, 48, 80, 49, 47, 50, 48, 99, 61, 43,
446 - 50, 110, 41, 67, 67, 67, 60, 63, 63, 63,
447 - 57, 155, 68, 69, 63, 37, 44, 66, 67, 67,
448 - 67, 63, 63, 63, 63, 73, 59, 68, 69, 70,
449 - 34, 34, 34, 43, 75, 38, 154, 92, 83, 83,
450 - 83, 64, 44, 120, 64, 64, 64, 67, 67, 67,
452 - 44, 57, 99, 68, 69, 107, 68, 69, 120, 127,
453 - 108, 153, 152, 121, 83, 83, 83, 133, 133, 133,
454 - 146, 133, 133, 133, 146, 140, 140, 140, 121, 141,
455 - 140, 140, 140, 151, 141, 158, 150, 149, 148, 144,
456 - 147, 143, 142, 139, 147, 36, 36, 36, 36, 36,
457 - 36, 36, 36, 40, 138, 137, 136, 40, 40, 42,
458 - 42, 42, 42, 42, 42, 42, 42, 56, 56, 56,
459 - 56, 62, 132, 62, 64, 131, 130, 64, 129, 64,
460 - 64, 65, 128, 158, 65, 65, 65, 65, 71, 127,
461 - 71, 71, 74, 74, 74, 74, 74, 74, 74, 74,
463 - 76, 76, 76, 76, 76, 76, 76, 76, 89, 126,
464 - 89, 90, 125, 90, 90, 124, 90, 90, 119, 119,
465 - 119, 119, 119, 119, 119, 119, 145, 145, 145, 145,
466 - 145, 145, 145, 145, 123, 122, 59, 59, 118, 117,
467 - 116, 115, 114, 113, 45, 112, 108, 111, 109, 106,
468 - 105, 104, 46, 103, 91, 87, 102, 101, 100, 98,
469 - 97, 96, 95, 94, 93, 77, 75, 91, 88, 87,
470 - 86, 57, 85, 84, 57, 82, 81, 78, 77, 75,
471 - 72, 158, 58, 57, 53, 35, 158, 31, 23, 23,
472 - 9, 158, 158, 158, 158, 158, 158, 158, 158, 158,
474 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
475 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
476 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
477 - 158, 158, 158, 158, 158, 158, 158
478 + 21, 21, 21, 21, 10, 22, 10, 24, 25, 25,
479 + 25, 32, 33, 33, 164, 26, 34, 34, 34, 52,
480 + 53, 27, 26, 26, 26, 26, 10, 11, 12, 11,
481 + 13, 14, 28, 15, 16, 28, 28, 28, 24, 28,
482 + 28, 28, 10, 18, 19, 20, 29, 29, 29, 29,
483 + 29, 30, 10, 29, 29, 29, 29, 29, 29, 29,
485 + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
486 + 10, 22, 10, 23, 34, 34, 34, 37, 39, 43,
487 + 32, 33, 33, 45, 55, 56, 46, 60, 43, 45,
488 + 65, 163, 46, 65, 65, 65, 44, 38, 60, 74,
489 + 58, 47, 141, 48, 142, 44, 49, 47, 50, 48,
490 + 76, 51, 62, 94, 50, 41, 44, 51, 37, 61,
491 + 64, 64, 64, 58, 34, 34, 34, 64, 162, 80,
492 + 67, 68, 68, 68, 64, 64, 64, 64, 38, 81,
493 + 69, 70, 71, 68, 68, 68, 60, 161, 43, 69,
494 + 70, 65, 69, 70, 65, 65, 65, 125, 85, 85,
496 + 85, 58, 68, 68, 68, 44, 102, 110, 125, 133,
497 + 102, 69, 70, 111, 114, 160, 159, 126, 85, 85,
498 + 85, 140, 140, 140, 140, 140, 140, 153, 126, 147,
499 + 147, 147, 153, 148, 147, 147, 147, 158, 148, 165,
500 + 157, 156, 155, 151, 150, 149, 146, 154, 145, 144,
501 + 143, 139, 154, 36, 36, 36, 36, 36, 36, 36,
502 + 36, 40, 138, 137, 136, 40, 40, 42, 42, 42,
503 + 42, 42, 42, 42, 42, 57, 57, 57, 57, 63,
504 + 135, 63, 65, 134, 165, 65, 133, 65, 65, 66,
505 + 132, 131, 66, 66, 66, 66, 72, 130, 72, 72,
507 + 75, 75, 75, 75, 75, 75, 75, 75, 77, 77,
508 + 77, 77, 77, 77, 77, 77, 91, 129, 91, 92,
509 + 128, 92, 92, 127, 92, 92, 124, 124, 124, 124,
510 + 124, 124, 124, 124, 152, 152, 152, 152, 152, 152,
511 + 152, 152, 60, 60, 123, 122, 121, 120, 119, 118,
512 + 117, 45, 116, 111, 115, 113, 112, 109, 108, 107,
513 + 46, 106, 93, 89, 105, 104, 103, 101, 100, 99,
514 + 98, 97, 96, 95, 78, 76, 93, 90, 89, 88,
515 + 58, 87, 86, 58, 84, 83, 82, 79, 78, 76,
516 + 73, 165, 59, 58, 54, 35, 165, 31, 23, 23,
518 + 9, 165, 165, 165, 165, 165, 165, 165, 165, 165,
519 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
520 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
521 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
522 + 165, 165, 165, 165, 165, 165, 165, 165
525 -static yyconst flex_int16_t yy_chk[438] =
526 +static yyconst flex_int16_t yy_chk[449] =
528 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
529 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
530 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
531 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
532 - 1, 1, 1, 1, 1, 1, 3, 3, 3, 3,
533 - 7, 7, 7, 156, 3, 11, 11, 11, 18, 18,
534 - 3, 3, 3, 3, 3, 5, 5, 5, 5, 5,
535 + 1, 1, 1, 1, 1, 1, 1, 3, 3, 3,
536 + 3, 7, 7, 7, 163, 3, 11, 11, 11, 18,
537 + 18, 3, 3, 3, 3, 3, 5, 5, 5, 5,
538 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
539 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
540 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
542 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
543 - 5, 8, 12, 12, 12, 14, 15, 16, 8, 8,
544 - 8, 17, 20, 20, 17, 23, 24, 29, 155, 24,
545 - 29, 29, 29, 48, 16, 14, 31, 29, 128, 17,
546 - 128, 17, 48, 17, 24, 17, 24, 99, 24, 42,
547 - 24, 99, 15, 33, 33, 33, 23, 26, 26, 26,
548 - 26, 154, 33, 33, 26, 36, 42, 31, 32, 32,
549 - 32, 26, 26, 26, 26, 44, 59, 32, 32, 32,
550 - 34, 34, 34, 73, 75, 36, 153, 75, 59, 59,
551 - 59, 65, 44, 110, 65, 65, 65, 67, 67, 67,
553 - 73, 65, 83, 89, 89, 97, 67, 67, 119, 127,
554 - 97, 150, 149, 110, 83, 83, 83, 133, 133, 133,
555 - 141, 127, 127, 127, 145, 136, 136, 136, 119, 136,
556 - 140, 140, 140, 148, 140, 147, 144, 143, 142, 139,
557 - 141, 138, 137, 135, 145, 159, 159, 159, 159, 159,
558 - 159, 159, 159, 160, 134, 132, 131, 160, 160, 161,
559 - 161, 161, 161, 161, 161, 161, 161, 162, 162, 162,
560 - 162, 163, 126, 163, 164, 125, 124, 164, 123, 164,
561 - 164, 165, 122, 121, 165, 165, 165, 165, 166, 120,
562 - 166, 166, 167, 167, 167, 167, 167, 167, 167, 167,
564 - 168, 168, 168, 168, 168, 168, 168, 168, 169, 118,
565 - 169, 170, 117, 170, 170, 116, 170, 170, 171, 171,
566 - 171, 171, 171, 171, 171, 171, 172, 172, 172, 172,
567 - 172, 172, 172, 172, 115, 114, 112, 111, 109, 108,
568 - 107, 106, 105, 104, 103, 102, 101, 100, 98, 96,
569 - 95, 94, 93, 92, 90, 88, 86, 85, 84, 82,
570 - 81, 80, 79, 78, 77, 76, 74, 72, 69, 68,
571 - 66, 63, 61, 60, 56, 50, 49, 47, 46, 45,
572 + 5, 5, 5, 8, 12, 12, 12, 14, 15, 16,
573 + 8, 8, 8, 17, 20, 20, 17, 23, 42, 24,
574 + 29, 162, 24, 29, 29, 29, 16, 14, 31, 44,
575 + 29, 17, 134, 17, 134, 42, 17, 24, 17, 24,
576 + 76, 17, 24, 76, 24, 15, 44, 24, 36, 23,
577 + 26, 26, 26, 26, 34, 34, 34, 26, 161, 48,
578 + 31, 32, 32, 32, 26, 26, 26, 26, 36, 48,
579 + 32, 32, 32, 33, 33, 33, 60, 160, 74, 91,
580 + 91, 66, 33, 33, 66, 66, 66, 114, 60, 60,
582 + 60, 66, 68, 68, 68, 74, 85, 99, 124, 133,
583 + 102, 68, 68, 99, 102, 157, 156, 114, 85, 85,
584 + 85, 133, 133, 133, 140, 140, 140, 148, 124, 143,
585 + 143, 143, 152, 143, 147, 147, 147, 155, 147, 154,
586 + 151, 150, 149, 146, 145, 144, 142, 148, 141, 138,
587 + 137, 132, 152, 166, 166, 166, 166, 166, 166, 166,
588 + 166, 167, 131, 130, 129, 167, 167, 168, 168, 168,
589 + 168, 168, 168, 168, 168, 169, 169, 169, 169, 170,
590 + 128, 170, 171, 127, 126, 171, 125, 171, 171, 172,
591 + 123, 122, 172, 172, 172, 172, 173, 121, 173, 173,
593 + 174, 174, 174, 174, 174, 174, 174, 174, 175, 175,
594 + 175, 175, 175, 175, 175, 175, 176, 120, 176, 177,
595 + 119, 177, 177, 118, 177, 177, 178, 178, 178, 178,
596 + 178, 178, 178, 178, 179, 179, 179, 179, 179, 179,
597 + 179, 179, 116, 115, 113, 112, 111, 110, 109, 108,
598 + 107, 106, 105, 104, 103, 101, 100, 98, 97, 96,
599 + 95, 94, 92, 90, 88, 87, 86, 84, 83, 82,
600 + 81, 80, 79, 78, 77, 75, 73, 70, 69, 67,
601 + 64, 62, 61, 57, 51, 50, 49, 47, 46, 45,
602 41, 38, 22, 21, 19, 13, 9, 6, 4, 2,
603 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
605 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
606 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
607 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
608 - 158, 158, 158, 158, 158, 158, 158
609 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
610 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
611 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
612 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
613 + 165, 165, 165, 165, 165, 165, 165, 165
616 static yy_state_type yy_last_accepting_state;
617 @@ -662,7 +664,7 @@ static int dts_version = 1;
618 static void push_input_file(const char *filename);
619 static bool pop_input_file(void);
620 static void lexical_error(const char *fmt, ...);
621 -#line 666 "dtc-lexer.lex.c"
622 +#line 668 "dtc-lexer.lex.c"
626 @@ -704,7 +706,7 @@ FILE *yyget_out (void );
628 void yyset_out (FILE * out_str );
630 -yy_size_t yyget_leng (void );
631 +int yyget_leng (void );
633 char *yyget_text (void );
635 @@ -853,6 +855,10 @@ YY_DECL
636 register char *yy_cp, *yy_bp;
639 +#line 68 "dtc-lexer.l"
641 +#line 861 "dtc-lexer.lex.c"
646 @@ -879,11 +885,6 @@ YY_DECL
647 yy_load_buffer_state( );
651 -#line 68 "dtc-lexer.l"
653 -#line 886 "dtc-lexer.lex.c"
655 while ( 1 ) /* loops until end-of-file is reached */
657 yy_cp = (yy_c_buf_p);
658 @@ -901,7 +902,7 @@ YY_DECL
662 - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
663 + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
664 if ( yy_accept[yy_current_state] )
666 (yy_last_accepting_state) = yy_current_state;
667 @@ -910,13 +911,13 @@ yy_match:
668 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
670 yy_current_state = (int) yy_def[yy_current_state];
671 - if ( yy_current_state >= 159 )
672 + if ( yy_current_state >= 166 )
673 yy_c = yy_meta[(unsigned int) yy_c];
675 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
678 - while ( yy_current_state != 158 );
679 + while ( yy_current_state != 165 );
680 yy_cp = (yy_last_accepting_cpos);
681 yy_current_state = (yy_last_accepting_state);
683 @@ -1007,23 +1008,31 @@ case 5:
685 #line 116 "dtc-lexer.l"
687 + DPRINT("Keyword: /plugin/\n");
693 +#line 121 "dtc-lexer.l"
695 DPRINT("Keyword: /memreserve/\n");
697 return DT_MEMRESERVE;
703 -#line 122 "dtc-lexer.l"
704 +#line 127 "dtc-lexer.l"
706 DPRINT("Keyword: /bits/\n");
714 -#line 128 "dtc-lexer.l"
715 +#line 133 "dtc-lexer.l"
717 DPRINT("Keyword: /delete-property/\n");
718 DPRINT("<PROPNODENAME>\n");
719 @@ -1031,9 +1040,9 @@ YY_RULE_SETUP
726 -#line 135 "dtc-lexer.l"
727 +#line 140 "dtc-lexer.l"
729 DPRINT("Keyword: /delete-node/\n");
730 DPRINT("<PROPNODENAME>\n");
731 @@ -1041,9 +1050,9 @@ YY_RULE_SETUP
738 -#line 142 "dtc-lexer.l"
739 +#line 147 "dtc-lexer.l"
741 DPRINT("Label: %s\n", yytext);
742 yylval.labelref = xstrdup(yytext);
743 @@ -1051,9 +1060,9 @@ YY_RULE_SETUP
750 -#line 149 "dtc-lexer.l"
751 +#line 154 "dtc-lexer.l"
754 DPRINT("Integer Literal: '%s'\n", yytext);
755 @@ -1073,10 +1082,10 @@ YY_RULE_SETUP
760 -/* rule 11 can match eol */
762 +/* rule 12 can match eol */
764 -#line 168 "dtc-lexer.l"
765 +#line 173 "dtc-lexer.l"
768 DPRINT("Character literal: %s\n", yytext);
769 @@ -1098,18 +1107,18 @@ YY_RULE_SETUP
770 return DT_CHAR_LITERAL;
776 -#line 189 "dtc-lexer.l"
777 +#line 194 "dtc-lexer.l"
778 { /* label reference */
779 DPRINT("Ref: %s\n", yytext+1);
780 yylval.labelref = xstrdup(yytext+1);
787 -#line 195 "dtc-lexer.l"
788 +#line 200 "dtc-lexer.l"
789 { /* new-style path reference */
790 yytext[yyleng-1] = '\0';
791 DPRINT("Ref: %s\n", yytext+2);
792 @@ -1117,27 +1126,27 @@ YY_RULE_SETUP
799 -#line 202 "dtc-lexer.l"
800 +#line 207 "dtc-lexer.l"
802 yylval.byte = strtol(yytext, NULL, 16);
803 DPRINT("Byte: %02x\n", (int)yylval.byte);
810 -#line 208 "dtc-lexer.l"
811 +#line 213 "dtc-lexer.l"
813 DPRINT("/BYTESTRING\n");
821 -#line 214 "dtc-lexer.l"
822 +#line 219 "dtc-lexer.l"
824 DPRINT("PropNodeName: %s\n", yytext);
825 yylval.propnodename = xstrdup((yytext[0] == '\\') ?
826 @@ -1146,75 +1155,75 @@ YY_RULE_SETUP
827 return DT_PROPNODENAME;
833 -#line 222 "dtc-lexer.l"
834 +#line 227 "dtc-lexer.l"
836 DPRINT("Binary Include\n");
841 -/* rule 18 can match eol */
843 -#line 227 "dtc-lexer.l"
844 -/* eat whitespace */
847 /* rule 19 can match eol */
849 -#line 228 "dtc-lexer.l"
850 -/* eat C-style comments */
851 +#line 232 "dtc-lexer.l"
852 +/* eat whitespace */
855 /* rule 20 can match eol */
857 -#line 229 "dtc-lexer.l"
858 -/* eat C++-style comments */
859 +#line 233 "dtc-lexer.l"
860 +/* eat C-style comments */
863 +/* rule 21 can match eol */
865 -#line 231 "dtc-lexer.l"
866 -{ return DT_LSHIFT; };
867 +#line 234 "dtc-lexer.l"
868 +/* eat C++-style comments */
872 -#line 232 "dtc-lexer.l"
873 -{ return DT_RSHIFT; };
874 +#line 236 "dtc-lexer.l"
875 +{ return DT_LSHIFT; };
879 -#line 233 "dtc-lexer.l"
881 +#line 237 "dtc-lexer.l"
882 +{ return DT_RSHIFT; };
886 -#line 234 "dtc-lexer.l"
888 +#line 238 "dtc-lexer.l"
893 -#line 235 "dtc-lexer.l"
895 +#line 239 "dtc-lexer.l"
900 -#line 236 "dtc-lexer.l"
902 +#line 240 "dtc-lexer.l"
907 -#line 237 "dtc-lexer.l"
909 +#line 241 "dtc-lexer.l"
914 -#line 238 "dtc-lexer.l"
916 +#line 242 "dtc-lexer.l"
921 -#line 240 "dtc-lexer.l"
922 +#line 243 "dtc-lexer.l"
927 +#line 245 "dtc-lexer.l"
929 DPRINT("Char: %c (\\x%02x)\n", yytext[0],
930 (unsigned)yytext[0]);
931 @@ -1230,12 +1239,12 @@ YY_RULE_SETUP
938 -#line 255 "dtc-lexer.l"
939 +#line 260 "dtc-lexer.l"
942 -#line 1239 "dtc-lexer.lex.c"
943 +#line 1248 "dtc-lexer.lex.c"
945 case YY_END_OF_BUFFER:
947 @@ -1365,7 +1374,6 @@ ECHO;
948 "fatal flex scanner internal error--no action found" );
949 } /* end of action switch */
950 } /* end of scanning one token */
951 - } /* end of user's declarations */
954 /* yy_get_next_buffer - try to read in a new buffer
955 @@ -1421,21 +1429,21 @@ static int yy_get_next_buffer (void)
959 - yy_size_t num_to_read =
961 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
963 while ( num_to_read <= 0 )
964 { /* Not enough room in the buffer - grow it. */
966 /* just a shorter name for the current buffer */
967 - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
968 + YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
970 int yy_c_buf_p_offset =
971 (int) ((yy_c_buf_p) - b->yy_ch_buf);
973 if ( b->yy_is_our_buffer )
975 - yy_size_t new_size = b->yy_buf_size * 2;
976 + int new_size = b->yy_buf_size * 2;
979 b->yy_buf_size += b->yy_buf_size / 8;
980 @@ -1466,7 +1474,7 @@ static int yy_get_next_buffer (void)
982 /* Read in more data. */
983 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
984 - (yy_n_chars), num_to_read );
985 + (yy_n_chars), (size_t) num_to_read );
987 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
989 @@ -1528,7 +1536,7 @@ static int yy_get_next_buffer (void)
990 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
992 yy_current_state = (int) yy_def[yy_current_state];
993 - if ( yy_current_state >= 159 )
994 + if ( yy_current_state >= 166 )
995 yy_c = yy_meta[(unsigned int) yy_c];
997 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
998 @@ -1556,13 +1564,13 @@ static int yy_get_next_buffer (void)
999 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1001 yy_current_state = (int) yy_def[yy_current_state];
1002 - if ( yy_current_state >= 159 )
1003 + if ( yy_current_state >= 166 )
1004 yy_c = yy_meta[(unsigned int) yy_c];
1006 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1007 - yy_is_jam = (yy_current_state == 158);
1008 + yy_is_jam = (yy_current_state == 165);
1010 - return yy_is_jam ? 0 : yy_current_state;
1011 + return yy_is_jam ? 0 : yy_current_state;
1015 @@ -1589,7 +1597,7 @@ static int yy_get_next_buffer (void)
1018 { /* need more input */
1019 - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1020 + int offset = (yy_c_buf_p) - (yytext_ptr);
1023 switch ( yy_get_next_buffer( ) )
1024 @@ -1863,7 +1871,7 @@ void yypop_buffer_state (void)
1026 static void yyensure_buffer_stack (void)
1028 - yy_size_t num_to_alloc;
1031 if (!(yy_buffer_stack)) {
1033 @@ -1960,12 +1968,12 @@ YY_BUFFER_STATE yy_scan_string (yyconst
1035 * @return the newly allocated buffer state object.
1037 -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1038 +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1046 /* Get memory for full buffer, including space for trailing EOB's. */
1047 n = _yybytes_len + 2;
1048 @@ -2047,7 +2055,7 @@ FILE *yyget_out (void)
1049 /** Get the length of the current token.
1052 -yy_size_t yyget_leng (void)
1053 +int yyget_leng (void)
1057 @@ -2195,7 +2203,7 @@ void yyfree (void * ptr )
1059 #define YYTABLES_NAME "yytables"
1061 -#line 254 "dtc-lexer.l"
1062 +#line 260 "dtc-lexer.l"
1066 --- a/scripts/dtc/dtc-parser.tab.c_shipped
1067 +++ b/scripts/dtc/dtc-parser.tab.c_shipped
1069 #line 20 "dtc-parser.y" /* yacc.c:339 */
1072 +#include <inttypes.h>
1076 @@ -80,7 +81,7 @@ extern void yyerror(char const *s);
1077 extern struct boot_info *the_boot_info;
1078 extern bool treesource_error;
1080 -#line 84 "dtc-parser.tab.c" /* yacc.c:339 */
1081 +#line 85 "dtc-parser.tab.c" /* yacc.c:339 */
1084 # if defined __cplusplus && 201103L <= __cplusplus
1085 @@ -116,26 +117,27 @@ extern int yydebug;
1089 - DT_MEMRESERVE = 259,
1099 - DT_DEL_PROP = 269,
1100 - DT_DEL_NODE = 270,
1101 - DT_PROPNODENAME = 271,
1103 - DT_CHAR_LITERAL = 273,
1110 + DT_MEMRESERVE = 260,
1120 + DT_DEL_PROP = 270,
1121 + DT_DEL_NODE = 271,
1122 + DT_PROPNODENAME = 272,
1124 + DT_CHAR_LITERAL = 274,
1133 @@ -144,7 +146,7 @@ extern int yydebug;
1134 typedef union YYSTYPE YYSTYPE;
1137 -#line 38 "dtc-parser.y" /* yacc.c:355 */
1138 +#line 39 "dtc-parser.y" /* yacc.c:355 */
1142 @@ -162,8 +164,9 @@ union YYSTYPE
1143 struct node *nodelist;
1144 struct reserve_info *re;
1148 -#line 167 "dtc-parser.tab.c" /* yacc.c:355 */
1149 +#line 170 "dtc-parser.tab.c" /* yacc.c:355 */
1151 # define YYSTYPE_IS_TRIVIAL 1
1152 # define YYSTYPE_IS_DECLARED 1
1153 @@ -192,7 +195,7 @@ int yyparse (void);
1155 /* Copy the second part of user declarations. */
1157 -#line 196 "dtc-parser.tab.c" /* yacc.c:358 */
1158 +#line 199 "dtc-parser.tab.c" /* yacc.c:358 */
1162 @@ -439,18 +442,18 @@ union yyalloc
1165 /* YYNTOKENS -- Number of terminals. */
1166 -#define YYNTOKENS 47
1167 +#define YYNTOKENS 48
1168 /* YYNNTS -- Number of nonterminals. */
1171 /* YYNRULES -- Number of rules. */
1172 -#define YYNRULES 80
1173 +#define YYNRULES 82
1174 /* YYNSTATES -- Number of states. */
1175 -#define YYNSTATES 144
1176 +#define YYNSTATES 147
1178 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
1179 by yylex, with out-of-bounds checking. */
1180 #define YYUNDEFTOK 2
1181 -#define YYMAXUTOK 278
1182 +#define YYMAXUTOK 279
1184 #define YYTRANSLATE(YYX) \
1185 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1186 @@ -462,16 +465,16 @@ static const yytype_uint8 yytranslate[]
1187 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1188 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1189 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1190 - 2, 2, 2, 46, 2, 2, 2, 44, 40, 2,
1191 - 32, 34, 43, 41, 33, 42, 2, 25, 2, 2,
1192 - 2, 2, 2, 2, 2, 2, 2, 2, 37, 24,
1193 - 35, 28, 29, 36, 2, 2, 2, 2, 2, 2,
1194 + 2, 2, 2, 47, 2, 2, 2, 45, 41, 2,
1195 + 33, 35, 44, 42, 34, 43, 2, 26, 2, 2,
1196 + 2, 2, 2, 2, 2, 2, 2, 2, 38, 25,
1197 + 36, 29, 30, 37, 2, 2, 2, 2, 2, 2,
1198 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1199 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1200 - 2, 30, 2, 31, 39, 2, 2, 2, 2, 2,
1201 + 2, 31, 2, 32, 40, 2, 2, 2, 2, 2,
1202 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1203 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1204 - 2, 2, 2, 26, 38, 27, 45, 2, 2, 2,
1205 + 2, 2, 2, 27, 39, 28, 46, 2, 2, 2,
1206 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1207 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1208 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1209 @@ -486,22 +489,22 @@ static const yytype_uint8 yytranslate[]
1210 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1211 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1212 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1213 - 15, 16, 17, 18, 19, 20, 21, 22, 23
1214 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24
1218 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
1219 static const yytype_uint16 yyrline[] =
1221 - 0, 104, 104, 113, 116, 123, 127, 135, 139, 144,
1222 - 155, 165, 180, 188, 191, 198, 202, 206, 210, 218,
1223 - 222, 226, 230, 234, 250, 260, 268, 271, 275, 282,
1224 - 298, 303, 322, 336, 343, 344, 345, 352, 356, 357,
1225 - 361, 362, 366, 367, 371, 372, 376, 377, 381, 382,
1226 - 386, 387, 388, 392, 393, 394, 395, 396, 400, 401,
1227 - 402, 406, 407, 408, 412, 413, 414, 415, 419, 420,
1228 - 421, 422, 427, 430, 434, 442, 445, 449, 457, 461,
1230 + 0, 108, 108, 118, 121, 129, 132, 139, 143, 151,
1231 + 155, 160, 171, 181, 196, 204, 207, 214, 218, 222,
1232 + 226, 234, 238, 242, 246, 250, 266, 276, 284, 287,
1233 + 291, 298, 314, 319, 338, 352, 359, 360, 361, 368,
1234 + 372, 373, 377, 378, 382, 383, 387, 388, 392, 393,
1235 + 397, 398, 402, 403, 404, 408, 409, 410, 411, 412,
1236 + 416, 417, 418, 422, 423, 424, 428, 429, 430, 431,
1237 + 435, 436, 437, 438, 443, 446, 450, 458, 461, 465,
1242 @@ -510,19 +513,19 @@ static const yytype_uint16 yyrline[] =
1243 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1244 static const char *const yytname[] =
1246 - "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE", "DT_LSHIFT",
1247 - "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ", "DT_NE", "DT_AND", "DT_OR",
1248 - "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE", "DT_PROPNODENAME", "DT_LITERAL",
1249 - "DT_CHAR_LITERAL", "DT_BYTE", "DT_STRING", "DT_LABEL", "DT_REF",
1250 - "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['", "']'",
1251 - "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'", "'+'",
1252 - "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile",
1253 - "memreserves", "memreserve", "devicetree", "nodedef", "proplist",
1254 - "propdef", "propdata", "propdataprefix", "arrayprefix", "integer_prim",
1255 - "integer_expr", "integer_trinary", "integer_or", "integer_and",
1256 - "integer_bitor", "integer_bitxor", "integer_bitand", "integer_eq",
1257 - "integer_rela", "integer_shift", "integer_add", "integer_mul",
1258 - "integer_unary", "bytestring", "subnodes", "subnode", YY_NULLPTR
1259 + "$end", "error", "$undefined", "DT_V1", "DT_PLUGIN", "DT_MEMRESERVE",
1260 + "DT_LSHIFT", "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ", "DT_NE", "DT_AND",
1261 + "DT_OR", "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE", "DT_PROPNODENAME",
1262 + "DT_LITERAL", "DT_CHAR_LITERAL", "DT_BYTE", "DT_STRING", "DT_LABEL",
1263 + "DT_REF", "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['",
1264 + "']'", "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'",
1265 + "'+'", "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile",
1266 + "plugindecl", "memreserves", "memreserve", "devicetree", "nodedef",
1267 + "proplist", "propdef", "propdata", "propdataprefix", "arrayprefix",
1268 + "integer_prim", "integer_expr", "integer_trinary", "integer_or",
1269 + "integer_and", "integer_bitor", "integer_bitxor", "integer_bitand",
1270 + "integer_eq", "integer_rela", "integer_shift", "integer_add",
1271 + "integer_mul", "integer_unary", "bytestring", "subnodes", "subnode", YY_NULLPTR
1275 @@ -533,16 +536,16 @@ static const yytype_uint16 yytoknum[] =
1277 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1278 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1279 - 275, 276, 277, 278, 59, 47, 123, 125, 61, 62,
1280 - 91, 93, 40, 44, 41, 60, 63, 58, 124, 94,
1281 - 38, 43, 45, 42, 37, 126, 33
1282 + 275, 276, 277, 278, 279, 59, 47, 123, 125, 61,
1283 + 62, 91, 93, 40, 44, 41, 60, 63, 58, 124,
1284 + 94, 38, 43, 45, 42, 37, 126, 33
1288 -#define YYPACT_NINF -81
1289 +#define YYPACT_NINF -84
1291 #define yypact_value_is_default(Yystate) \
1292 - (!!((Yystate) == (-81)))
1293 + (!!((Yystate) == (-84)))
1295 #define YYTABLE_NINF -1
1297 @@ -553,21 +556,21 @@ static const yytype_uint16 yytoknum[] =
1299 static const yytype_int8 yypact[] =
1301 - 16, -11, 21, 10, -81, 25, 10, 19, 10, -81,
1302 - -81, -9, 25, -81, 2, 51, -81, -9, -9, -9,
1303 - -81, 1, -81, -6, 50, 14, 28, 29, 36, 3,
1304 - 58, 44, -3, -81, 47, -81, -81, 65, 68, 2,
1305 - 2, -81, -81, -81, -81, -9, -9, -9, -9, -9,
1306 - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
1307 - -9, -9, -9, -9, -81, 63, 69, 2, -81, -81,
1308 - 50, 57, 14, 28, 29, 36, 3, 3, 58, 58,
1309 - 58, 58, 44, 44, -3, -3, -81, -81, -81, 79,
1310 - 80, -8, 63, -81, 72, 63, -81, -81, -9, 76,
1311 - 77, -81, -81, -81, -81, -81, 78, -81, -81, -81,
1312 - -81, -81, 35, 4, -81, -81, -81, -81, 86, -81,
1313 - -81, -81, 73, -81, -81, 33, 71, 84, 39, -81,
1314 - -81, -81, -81, -81, 41, -81, -81, -81, 25, -81,
1316 + 15, -12, 35, 42, -84, 27, 9, -84, 24, 9,
1317 + 43, 9, -84, -84, -10, 24, -84, 60, 44, -84,
1318 + -10, -10, -10, -84, 55, -84, -7, 52, 53, 51,
1319 + 54, 10, 2, 38, 37, -4, -84, 68, -84, -84,
1320 + 71, 73, 60, 60, -84, -84, -84, -84, -10, -10,
1321 + -10, -10, -10, -10, -10, -10, -10, -10, -10, -10,
1322 + -10, -10, -10, -10, -10, -10, -10, -84, 56, 72,
1323 + 60, -84, -84, 52, 61, 53, 51, 54, 10, 2,
1324 + 2, 38, 38, 38, 38, 37, 37, -4, -4, -84,
1325 + -84, -84, 81, 83, 34, 56, -84, 74, 56, -84,
1326 + -84, -10, 76, 78, -84, -84, -84, -84, -84, 79,
1327 + -84, -84, -84, -84, -84, -6, 3, -84, -84, -84,
1328 + -84, 87, -84, -84, -84, 75, -84, -84, 32, 70,
1329 + 86, 36, -84, -84, -84, -84, -84, 47, -84, -84,
1330 + -84, 24, -84, 77, 24, 80, -84
1333 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1334 @@ -575,37 +578,37 @@ static const yytype_int8 yypact[] =
1335 means the default is an error. */
1336 static const yytype_uint8 yydefact[] =
1338 - 0, 0, 0, 3, 1, 0, 0, 0, 3, 34,
1339 - 35, 0, 0, 6, 0, 2, 4, 0, 0, 0,
1340 - 68, 0, 37, 38, 40, 42, 44, 46, 48, 50,
1341 - 53, 60, 63, 67, 0, 13, 7, 0, 0, 0,
1342 - 0, 69, 70, 71, 36, 0, 0, 0, 0, 0,
1343 + 0, 0, 0, 3, 1, 0, 5, 4, 0, 0,
1344 + 0, 5, 36, 37, 0, 0, 8, 0, 2, 6,
1345 + 0, 0, 0, 70, 0, 39, 40, 42, 44, 46,
1346 + 48, 50, 52, 55, 62, 65, 69, 0, 15, 9,
1347 + 0, 0, 0, 0, 71, 72, 73, 38, 0, 0,
1348 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1349 - 0, 0, 0, 0, 5, 75, 0, 0, 10, 8,
1350 - 41, 0, 43, 45, 47, 49, 51, 52, 56, 57,
1351 - 55, 54, 58, 59, 61, 62, 65, 64, 66, 0,
1352 - 0, 0, 0, 14, 0, 75, 11, 9, 0, 0,
1353 - 0, 16, 26, 78, 18, 80, 0, 77, 76, 39,
1354 - 17, 79, 0, 0, 12, 25, 15, 27, 0, 19,
1355 - 28, 22, 0, 72, 30, 0, 0, 0, 0, 33,
1356 - 32, 20, 31, 29, 0, 73, 74, 21, 0, 24,
1358 + 0, 0, 0, 0, 0, 0, 0, 7, 77, 0,
1359 + 0, 12, 10, 43, 0, 45, 47, 49, 51, 53,
1360 + 54, 58, 59, 57, 56, 60, 61, 63, 64, 67,
1361 + 66, 68, 0, 0, 0, 0, 16, 0, 77, 13,
1362 + 11, 0, 0, 0, 18, 28, 80, 20, 82, 0,
1363 + 79, 78, 41, 19, 81, 0, 0, 14, 27, 17,
1364 + 29, 0, 21, 30, 24, 0, 74, 32, 0, 0,
1365 + 0, 0, 35, 34, 22, 33, 31, 0, 75, 76,
1366 + 23, 0, 26, 0, 0, 0, 25
1369 /* YYPGOTO[NTERM-NUM]. */
1370 static const yytype_int8 yypgoto[] =
1372 - -81, -81, 100, 104, -81, -38, -81, -80, -81, -81,
1373 - -81, -5, 66, 13, -81, 70, 67, 81, 64, 82,
1374 - 37, 27, 34, 38, -14, -81, 22, 24
1375 + -84, -84, -84, 98, 101, -84, -41, -84, -83, -84,
1376 + -84, -84, -8, 63, 12, -84, 66, 67, 65, 69,
1377 + 82, 29, 18, 25, 26, -17, -84, 20, 28
1380 /* YYDEFGOTO[NTERM-NUM]. */
1381 static const yytype_int16 yydefgoto[] =
1383 - -1, 2, 7, 8, 15, 36, 65, 93, 112, 113,
1384 - 125, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1385 - 29, 30, 31, 32, 33, 128, 94, 95
1386 + -1, 2, 6, 10, 11, 18, 39, 68, 96, 115,
1387 + 116, 128, 23, 24, 25, 26, 27, 28, 29, 30,
1388 + 31, 32, 33, 34, 35, 36, 131, 97, 98
1391 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1392 @@ -613,87 +616,87 @@ static const yytype_int16 yydefgoto[] =
1393 number is the opposite. If YYTABLE_NINF, syntax error. */
1394 static const yytype_uint8 yytable[] =
1396 - 12, 68, 69, 41, 42, 43, 45, 34, 9, 10,
1397 - 53, 54, 104, 3, 5, 107, 101, 118, 35, 1,
1398 - 102, 4, 61, 11, 119, 120, 121, 122, 35, 97,
1399 - 46, 6, 55, 17, 123, 44, 18, 19, 56, 124,
1400 - 62, 63, 9, 10, 14, 51, 52, 86, 87, 88,
1401 - 9, 10, 48, 103, 129, 130, 115, 11, 135, 116,
1402 - 136, 47, 131, 57, 58, 11, 37, 49, 117, 50,
1403 - 137, 64, 38, 39, 138, 139, 40, 89, 90, 91,
1404 - 78, 79, 80, 81, 92, 59, 60, 66, 76, 77,
1405 - 67, 82, 83, 96, 98, 99, 100, 84, 85, 106,
1406 - 110, 111, 114, 126, 134, 127, 133, 141, 16, 143,
1407 - 13, 109, 71, 74, 72, 70, 105, 108, 0, 0,
1408 - 132, 0, 0, 0, 0, 0, 0, 0, 0, 73,
1409 - 0, 0, 75, 140, 0, 0, 142
1410 + 15, 71, 72, 44, 45, 46, 48, 37, 12, 13,
1411 + 56, 57, 107, 3, 8, 110, 118, 121, 1, 119,
1412 + 54, 55, 64, 14, 122, 123, 124, 125, 120, 100,
1413 + 49, 9, 58, 20, 126, 4, 21, 22, 59, 127,
1414 + 65, 66, 12, 13, 60, 61, 5, 89, 90, 91,
1415 + 12, 13, 7, 106, 132, 133, 138, 14, 139, 104,
1416 + 40, 38, 134, 105, 50, 14, 41, 42, 140, 17,
1417 + 43, 92, 93, 94, 81, 82, 83, 84, 95, 62,
1418 + 63, 141, 142, 79, 80, 85, 86, 38, 87, 88,
1419 + 47, 52, 51, 67, 69, 53, 70, 99, 102, 101,
1420 + 103, 113, 109, 114, 117, 129, 136, 137, 130, 19,
1421 + 16, 144, 74, 112, 73, 146, 76, 75, 111, 0,
1422 + 135, 77, 0, 108, 0, 0, 0, 0, 0, 0,
1423 + 0, 0, 0, 143, 0, 78, 145
1426 static const yytype_int16 yycheck[] =
1428 - 5, 39, 40, 17, 18, 19, 12, 12, 17, 18,
1429 - 7, 8, 92, 24, 4, 95, 24, 13, 26, 3,
1430 - 28, 0, 25, 32, 20, 21, 22, 23, 26, 67,
1431 - 36, 21, 29, 42, 30, 34, 45, 46, 35, 35,
1432 - 43, 44, 17, 18, 25, 9, 10, 61, 62, 63,
1433 - 17, 18, 38, 91, 21, 22, 21, 32, 19, 24,
1434 - 21, 11, 29, 5, 6, 32, 15, 39, 33, 40,
1435 - 31, 24, 21, 22, 33, 34, 25, 14, 15, 16,
1436 - 53, 54, 55, 56, 21, 41, 42, 22, 51, 52,
1437 - 22, 57, 58, 24, 37, 16, 16, 59, 60, 27,
1438 - 24, 24, 24, 17, 20, 32, 35, 33, 8, 34,
1439 - 6, 98, 46, 49, 47, 45, 92, 95, -1, -1,
1440 - 125, -1, -1, -1, -1, -1, -1, -1, -1, 48,
1441 - -1, -1, 50, 138, -1, -1, 141
1442 + 8, 42, 43, 20, 21, 22, 13, 15, 18, 19,
1443 + 8, 9, 95, 25, 5, 98, 22, 14, 3, 25,
1444 + 10, 11, 26, 33, 21, 22, 23, 24, 34, 70,
1445 + 37, 22, 30, 43, 31, 0, 46, 47, 36, 36,
1446 + 44, 45, 18, 19, 6, 7, 4, 64, 65, 66,
1447 + 18, 19, 25, 94, 22, 23, 20, 33, 22, 25,
1448 + 16, 27, 30, 29, 12, 33, 22, 23, 32, 26,
1449 + 26, 15, 16, 17, 56, 57, 58, 59, 22, 42,
1450 + 43, 34, 35, 54, 55, 60, 61, 27, 62, 63,
1451 + 35, 40, 39, 25, 23, 41, 23, 25, 17, 38,
1452 + 17, 25, 28, 25, 25, 18, 36, 21, 33, 11,
1453 + 9, 34, 49, 101, 48, 35, 51, 50, 98, -1,
1454 + 128, 52, -1, 95, -1, -1, -1, -1, -1, -1,
1455 + -1, -1, -1, 141, -1, 53, 144
1458 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1459 symbol of state STATE-NUM. */
1460 static const yytype_uint8 yystos[] =
1462 - 0, 3, 48, 24, 0, 4, 21, 49, 50, 17,
1463 - 18, 32, 58, 50, 25, 51, 49, 42, 45, 46,
1464 - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
1465 - 68, 69, 70, 71, 58, 26, 52, 15, 21, 22,
1466 - 25, 71, 71, 71, 34, 12, 36, 11, 38, 39,
1467 - 40, 9, 10, 7, 8, 29, 35, 5, 6, 41,
1468 - 42, 25, 43, 44, 24, 53, 22, 22, 52, 52,
1469 - 62, 59, 63, 64, 65, 66, 67, 67, 68, 68,
1470 - 68, 68, 69, 69, 70, 70, 71, 71, 71, 14,
1471 - 15, 16, 21, 54, 73, 74, 24, 52, 37, 16,
1472 - 16, 24, 28, 52, 54, 74, 27, 54, 73, 60,
1473 - 24, 24, 55, 56, 24, 21, 24, 33, 13, 20,
1474 - 21, 22, 23, 30, 35, 57, 17, 32, 72, 21,
1475 - 22, 29, 58, 35, 20, 19, 21, 31, 33, 34,
1477 + 0, 3, 49, 25, 0, 4, 50, 25, 5, 22,
1478 + 51, 52, 18, 19, 33, 60, 52, 26, 53, 51,
1479 + 43, 46, 47, 60, 61, 62, 63, 64, 65, 66,
1480 + 67, 68, 69, 70, 71, 72, 73, 60, 27, 54,
1481 + 16, 22, 23, 26, 73, 73, 73, 35, 13, 37,
1482 + 12, 39, 40, 41, 10, 11, 8, 9, 30, 36,
1483 + 6, 7, 42, 43, 26, 44, 45, 25, 55, 23,
1484 + 23, 54, 54, 64, 61, 65, 66, 67, 68, 69,
1485 + 69, 70, 70, 70, 70, 71, 71, 72, 72, 73,
1486 + 73, 73, 15, 16, 17, 22, 56, 75, 76, 25,
1487 + 54, 38, 17, 17, 25, 29, 54, 56, 76, 28,
1488 + 56, 75, 62, 25, 25, 57, 58, 25, 22, 25,
1489 + 34, 14, 21, 22, 23, 24, 31, 36, 59, 18,
1490 + 33, 74, 22, 23, 30, 60, 36, 21, 20, 22,
1491 + 32, 34, 35, 60, 34, 60, 35
1494 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1495 static const yytype_uint8 yyr1[] =
1497 - 0, 47, 48, 49, 49, 50, 50, 51, 51, 51,
1498 - 51, 51, 52, 53, 53, 54, 54, 54, 54, 55,
1499 - 55, 55, 55, 55, 55, 55, 56, 56, 56, 57,
1500 - 57, 57, 57, 57, 58, 58, 58, 59, 60, 60,
1501 - 61, 61, 62, 62, 63, 63, 64, 64, 65, 65,
1502 - 66, 66, 66, 67, 67, 67, 67, 67, 68, 68,
1503 - 68, 69, 69, 69, 70, 70, 70, 70, 71, 71,
1504 - 71, 71, 72, 72, 72, 73, 73, 73, 74, 74,
1506 + 0, 48, 49, 50, 50, 51, 51, 52, 52, 53,
1507 + 53, 53, 53, 53, 54, 55, 55, 56, 56, 56,
1508 + 56, 57, 57, 57, 57, 57, 57, 57, 58, 58,
1509 + 58, 59, 59, 59, 59, 59, 60, 60, 60, 61,
1510 + 62, 62, 63, 63, 64, 64, 65, 65, 66, 66,
1511 + 67, 67, 68, 68, 68, 69, 69, 69, 69, 69,
1512 + 70, 70, 70, 71, 71, 71, 72, 72, 72, 72,
1513 + 73, 73, 73, 73, 74, 74, 74, 75, 75, 75,
1517 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
1518 static const yytype_uint8 yyr2[] =
1520 - 0, 2, 4, 0, 2, 4, 2, 2, 3, 4,
1521 - 3, 4, 5, 0, 2, 4, 2, 3, 2, 2,
1522 - 3, 4, 2, 9, 5, 2, 0, 2, 2, 3,
1523 - 1, 2, 2, 2, 1, 1, 3, 1, 1, 5,
1524 - 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
1525 - 1, 3, 3, 1, 3, 3, 3, 3, 3, 3,
1526 - 1, 3, 3, 1, 3, 3, 3, 1, 1, 2,
1527 - 2, 2, 0, 2, 2, 0, 2, 2, 2, 3,
1529 + 0, 2, 5, 0, 2, 0, 2, 4, 2, 2,
1530 + 3, 4, 3, 4, 5, 0, 2, 4, 2, 3,
1531 + 2, 2, 3, 4, 2, 9, 5, 2, 0, 2,
1532 + 2, 3, 1, 2, 2, 2, 1, 1, 3, 1,
1533 + 1, 5, 1, 3, 1, 3, 1, 3, 1, 3,
1534 + 1, 3, 1, 3, 3, 1, 3, 3, 3, 3,
1535 + 3, 3, 1, 3, 3, 1, 3, 3, 3, 1,
1536 + 1, 2, 2, 2, 0, 2, 2, 0, 2, 2,
1541 @@ -1463,65 +1466,82 @@ yyreduce:
1545 -#line 105 "dtc-parser.y" /* yacc.c:1646 */
1546 +#line 109 "dtc-parser.y" /* yacc.c:1646 */
1548 + (yyvsp[0].node)->is_plugin = (yyvsp[-2].is_plugin);
1549 the_boot_info = build_boot_info((yyvsp[-1].re), (yyvsp[0].node),
1550 guess_boot_cpuid((yyvsp[0].node)));
1552 -#line 1472 "dtc-parser.tab.c" /* yacc.c:1646 */
1553 +#line 1476 "dtc-parser.tab.c" /* yacc.c:1646 */
1557 -#line 113 "dtc-parser.y" /* yacc.c:1646 */
1558 +#line 118 "dtc-parser.y" /* yacc.c:1646 */
1560 - (yyval.re) = NULL;
1561 + (yyval.is_plugin) = false;
1563 -#line 1480 "dtc-parser.tab.c" /* yacc.c:1646 */
1564 +#line 1484 "dtc-parser.tab.c" /* yacc.c:1646 */
1568 -#line 117 "dtc-parser.y" /* yacc.c:1646 */
1569 +#line 122 "dtc-parser.y" /* yacc.c:1646 */
1571 - (yyval.re) = chain_reserve_entry((yyvsp[-1].re), (yyvsp[0].re));
1572 + (yyval.is_plugin) = true;
1574 -#line 1488 "dtc-parser.tab.c" /* yacc.c:1646 */
1575 +#line 1492 "dtc-parser.tab.c" /* yacc.c:1646 */
1579 -#line 124 "dtc-parser.y" /* yacc.c:1646 */
1580 +#line 129 "dtc-parser.y" /* yacc.c:1646 */
1582 - (yyval.re) = build_reserve_entry((yyvsp[-2].integer), (yyvsp[-1].integer));
1583 + (yyval.re) = NULL;
1585 -#line 1496 "dtc-parser.tab.c" /* yacc.c:1646 */
1586 +#line 1500 "dtc-parser.tab.c" /* yacc.c:1646 */
1590 -#line 128 "dtc-parser.y" /* yacc.c:1646 */
1591 +#line 133 "dtc-parser.y" /* yacc.c:1646 */
1593 + (yyval.re) = chain_reserve_entry((yyvsp[-1].re), (yyvsp[0].re));
1595 +#line 1508 "dtc-parser.tab.c" /* yacc.c:1646 */
1599 +#line 140 "dtc-parser.y" /* yacc.c:1646 */
1601 + (yyval.re) = build_reserve_entry((yyvsp[-2].integer), (yyvsp[-1].integer));
1603 +#line 1516 "dtc-parser.tab.c" /* yacc.c:1646 */
1607 +#line 144 "dtc-parser.y" /* yacc.c:1646 */
1609 add_label(&(yyvsp[0].re)->labels, (yyvsp[-1].labelref));
1610 (yyval.re) = (yyvsp[0].re);
1612 -#line 1505 "dtc-parser.tab.c" /* yacc.c:1646 */
1613 +#line 1525 "dtc-parser.tab.c" /* yacc.c:1646 */
1617 -#line 136 "dtc-parser.y" /* yacc.c:1646 */
1619 +#line 152 "dtc-parser.y" /* yacc.c:1646 */
1621 (yyval.node) = name_node((yyvsp[0].node), "");
1623 -#line 1513 "dtc-parser.tab.c" /* yacc.c:1646 */
1624 +#line 1533 "dtc-parser.tab.c" /* yacc.c:1646 */
1628 -#line 140 "dtc-parser.y" /* yacc.c:1646 */
1630 +#line 156 "dtc-parser.y" /* yacc.c:1646 */
1632 (yyval.node) = merge_nodes((yyvsp[-2].node), (yyvsp[0].node));
1634 -#line 1521 "dtc-parser.tab.c" /* yacc.c:1646 */
1635 +#line 1541 "dtc-parser.tab.c" /* yacc.c:1646 */
1639 -#line 145 "dtc-parser.y" /* yacc.c:1646 */
1641 +#line 161 "dtc-parser.y" /* yacc.c:1646 */
1643 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1645 @@ -1532,11 +1552,11 @@ yyreduce:
1646 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1647 (yyval.node) = (yyvsp[-3].node);
1649 -#line 1536 "dtc-parser.tab.c" /* yacc.c:1646 */
1650 +#line 1556 "dtc-parser.tab.c" /* yacc.c:1646 */
1654 -#line 156 "dtc-parser.y" /* yacc.c:1646 */
1656 +#line 172 "dtc-parser.y" /* yacc.c:1646 */
1658 struct node *target = get_node_by_ref((yyvsp[-2].node), (yyvsp[-1].labelref));
1660 @@ -1546,11 +1566,11 @@ yyreduce:
1661 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1662 (yyval.node) = (yyvsp[-2].node);
1664 -#line 1550 "dtc-parser.tab.c" /* yacc.c:1646 */
1665 +#line 1570 "dtc-parser.tab.c" /* yacc.c:1646 */
1669 -#line 166 "dtc-parser.y" /* yacc.c:1646 */
1671 +#line 182 "dtc-parser.y" /* yacc.c:1646 */
1673 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1675 @@ -1562,100 +1582,100 @@ yyreduce:
1677 (yyval.node) = (yyvsp[-3].node);
1679 -#line 1566 "dtc-parser.tab.c" /* yacc.c:1646 */
1680 +#line 1586 "dtc-parser.tab.c" /* yacc.c:1646 */
1684 -#line 181 "dtc-parser.y" /* yacc.c:1646 */
1686 +#line 197 "dtc-parser.y" /* yacc.c:1646 */
1688 (yyval.node) = build_node((yyvsp[-3].proplist), (yyvsp[-2].nodelist));
1690 -#line 1574 "dtc-parser.tab.c" /* yacc.c:1646 */
1691 +#line 1594 "dtc-parser.tab.c" /* yacc.c:1646 */
1695 -#line 188 "dtc-parser.y" /* yacc.c:1646 */
1697 +#line 204 "dtc-parser.y" /* yacc.c:1646 */
1699 (yyval.proplist) = NULL;
1701 -#line 1582 "dtc-parser.tab.c" /* yacc.c:1646 */
1702 +#line 1602 "dtc-parser.tab.c" /* yacc.c:1646 */
1706 -#line 192 "dtc-parser.y" /* yacc.c:1646 */
1708 +#line 208 "dtc-parser.y" /* yacc.c:1646 */
1710 (yyval.proplist) = chain_property((yyvsp[0].prop), (yyvsp[-1].proplist));
1712 -#line 1590 "dtc-parser.tab.c" /* yacc.c:1646 */
1713 +#line 1610 "dtc-parser.tab.c" /* yacc.c:1646 */
1717 -#line 199 "dtc-parser.y" /* yacc.c:1646 */
1719 +#line 215 "dtc-parser.y" /* yacc.c:1646 */
1721 (yyval.prop) = build_property((yyvsp[-3].propnodename), (yyvsp[-1].data));
1723 -#line 1598 "dtc-parser.tab.c" /* yacc.c:1646 */
1724 +#line 1618 "dtc-parser.tab.c" /* yacc.c:1646 */
1728 -#line 203 "dtc-parser.y" /* yacc.c:1646 */
1730 +#line 219 "dtc-parser.y" /* yacc.c:1646 */
1732 (yyval.prop) = build_property((yyvsp[-1].propnodename), empty_data);
1734 -#line 1606 "dtc-parser.tab.c" /* yacc.c:1646 */
1735 +#line 1626 "dtc-parser.tab.c" /* yacc.c:1646 */
1739 -#line 207 "dtc-parser.y" /* yacc.c:1646 */
1741 +#line 223 "dtc-parser.y" /* yacc.c:1646 */
1743 (yyval.prop) = build_property_delete((yyvsp[-1].propnodename));
1745 -#line 1614 "dtc-parser.tab.c" /* yacc.c:1646 */
1746 +#line 1634 "dtc-parser.tab.c" /* yacc.c:1646 */
1750 -#line 211 "dtc-parser.y" /* yacc.c:1646 */
1752 +#line 227 "dtc-parser.y" /* yacc.c:1646 */
1754 add_label(&(yyvsp[0].prop)->labels, (yyvsp[-1].labelref));
1755 (yyval.prop) = (yyvsp[0].prop);
1757 -#line 1623 "dtc-parser.tab.c" /* yacc.c:1646 */
1758 +#line 1643 "dtc-parser.tab.c" /* yacc.c:1646 */
1762 -#line 219 "dtc-parser.y" /* yacc.c:1646 */
1764 +#line 235 "dtc-parser.y" /* yacc.c:1646 */
1766 (yyval.data) = data_merge((yyvsp[-1].data), (yyvsp[0].data));
1768 -#line 1631 "dtc-parser.tab.c" /* yacc.c:1646 */
1769 +#line 1651 "dtc-parser.tab.c" /* yacc.c:1646 */
1773 -#line 223 "dtc-parser.y" /* yacc.c:1646 */
1775 +#line 239 "dtc-parser.y" /* yacc.c:1646 */
1777 (yyval.data) = data_merge((yyvsp[-2].data), (yyvsp[-1].array).data);
1779 -#line 1639 "dtc-parser.tab.c" /* yacc.c:1646 */
1780 +#line 1659 "dtc-parser.tab.c" /* yacc.c:1646 */
1784 -#line 227 "dtc-parser.y" /* yacc.c:1646 */
1786 +#line 243 "dtc-parser.y" /* yacc.c:1646 */
1788 (yyval.data) = data_merge((yyvsp[-3].data), (yyvsp[-1].data));
1790 -#line 1647 "dtc-parser.tab.c" /* yacc.c:1646 */
1791 +#line 1667 "dtc-parser.tab.c" /* yacc.c:1646 */
1795 -#line 231 "dtc-parser.y" /* yacc.c:1646 */
1797 +#line 247 "dtc-parser.y" /* yacc.c:1646 */
1799 (yyval.data) = data_add_marker((yyvsp[-1].data), REF_PATH, (yyvsp[0].labelref));
1801 -#line 1655 "dtc-parser.tab.c" /* yacc.c:1646 */
1802 +#line 1675 "dtc-parser.tab.c" /* yacc.c:1646 */
1806 -#line 235 "dtc-parser.y" /* yacc.c:1646 */
1808 +#line 251 "dtc-parser.y" /* yacc.c:1646 */
1810 FILE *f = srcfile_relative_open((yyvsp[-5].data).val, NULL);
1812 @@ -1671,11 +1691,11 @@ yyreduce:
1813 (yyval.data) = data_merge((yyvsp[-8].data), d);
1816 -#line 1675 "dtc-parser.tab.c" /* yacc.c:1646 */
1817 +#line 1695 "dtc-parser.tab.c" /* yacc.c:1646 */
1821 -#line 251 "dtc-parser.y" /* yacc.c:1646 */
1823 +#line 267 "dtc-parser.y" /* yacc.c:1646 */
1825 FILE *f = srcfile_relative_open((yyvsp[-1].data).val, NULL);
1826 struct data d = empty_data;
1827 @@ -1685,43 +1705,43 @@ yyreduce:
1828 (yyval.data) = data_merge((yyvsp[-4].data), d);
1831 -#line 1689 "dtc-parser.tab.c" /* yacc.c:1646 */
1832 +#line 1709 "dtc-parser.tab.c" /* yacc.c:1646 */
1836 -#line 261 "dtc-parser.y" /* yacc.c:1646 */
1838 +#line 277 "dtc-parser.y" /* yacc.c:1646 */
1840 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1842 -#line 1697 "dtc-parser.tab.c" /* yacc.c:1646 */
1843 +#line 1717 "dtc-parser.tab.c" /* yacc.c:1646 */
1847 -#line 268 "dtc-parser.y" /* yacc.c:1646 */
1849 +#line 284 "dtc-parser.y" /* yacc.c:1646 */
1851 (yyval.data) = empty_data;
1853 -#line 1705 "dtc-parser.tab.c" /* yacc.c:1646 */
1854 +#line 1725 "dtc-parser.tab.c" /* yacc.c:1646 */
1858 -#line 272 "dtc-parser.y" /* yacc.c:1646 */
1860 +#line 288 "dtc-parser.y" /* yacc.c:1646 */
1862 (yyval.data) = (yyvsp[-1].data);
1864 -#line 1713 "dtc-parser.tab.c" /* yacc.c:1646 */
1865 +#line 1733 "dtc-parser.tab.c" /* yacc.c:1646 */
1869 -#line 276 "dtc-parser.y" /* yacc.c:1646 */
1871 +#line 292 "dtc-parser.y" /* yacc.c:1646 */
1873 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1875 -#line 1721 "dtc-parser.tab.c" /* yacc.c:1646 */
1876 +#line 1741 "dtc-parser.tab.c" /* yacc.c:1646 */
1880 -#line 283 "dtc-parser.y" /* yacc.c:1646 */
1882 +#line 299 "dtc-parser.y" /* yacc.c:1646 */
1884 unsigned long long bits;
1886 @@ -1737,20 +1757,20 @@ yyreduce:
1887 (yyval.array).data = empty_data;
1888 (yyval.array).bits = bits;
1890 -#line 1741 "dtc-parser.tab.c" /* yacc.c:1646 */
1891 +#line 1761 "dtc-parser.tab.c" /* yacc.c:1646 */
1895 -#line 299 "dtc-parser.y" /* yacc.c:1646 */
1897 +#line 315 "dtc-parser.y" /* yacc.c:1646 */
1899 (yyval.array).data = empty_data;
1900 (yyval.array).bits = 32;
1902 -#line 1750 "dtc-parser.tab.c" /* yacc.c:1646 */
1903 +#line 1770 "dtc-parser.tab.c" /* yacc.c:1646 */
1907 -#line 304 "dtc-parser.y" /* yacc.c:1646 */
1909 +#line 320 "dtc-parser.y" /* yacc.c:1646 */
1911 if ((yyvsp[-1].array).bits < 64) {
1912 uint64_t mask = (1ULL << (yyvsp[-1].array).bits) - 1;
1913 @@ -1769,11 +1789,11 @@ yyreduce:
1915 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, (yyvsp[0].integer), (yyvsp[-1].array).bits);
1917 -#line 1773 "dtc-parser.tab.c" /* yacc.c:1646 */
1918 +#line 1793 "dtc-parser.tab.c" /* yacc.c:1646 */
1922 -#line 323 "dtc-parser.y" /* yacc.c:1646 */
1924 +#line 339 "dtc-parser.y" /* yacc.c:1646 */
1926 uint64_t val = ~0ULL >> (64 - (yyvsp[-1].array).bits);
1928 @@ -1787,233 +1807,233 @@ yyreduce:
1930 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, val, (yyvsp[-1].array).bits);
1932 -#line 1791 "dtc-parser.tab.c" /* yacc.c:1646 */
1933 +#line 1811 "dtc-parser.tab.c" /* yacc.c:1646 */
1937 -#line 337 "dtc-parser.y" /* yacc.c:1646 */
1939 +#line 353 "dtc-parser.y" /* yacc.c:1646 */
1941 (yyval.array).data = data_add_marker((yyvsp[-1].array).data, LABEL, (yyvsp[0].labelref));
1943 -#line 1799 "dtc-parser.tab.c" /* yacc.c:1646 */
1944 +#line 1819 "dtc-parser.tab.c" /* yacc.c:1646 */
1948 -#line 346 "dtc-parser.y" /* yacc.c:1646 */
1950 +#line 362 "dtc-parser.y" /* yacc.c:1646 */
1952 (yyval.integer) = (yyvsp[-1].integer);
1954 -#line 1807 "dtc-parser.tab.c" /* yacc.c:1646 */
1955 +#line 1827 "dtc-parser.tab.c" /* yacc.c:1646 */
1959 -#line 357 "dtc-parser.y" /* yacc.c:1646 */
1961 +#line 373 "dtc-parser.y" /* yacc.c:1646 */
1962 { (yyval.integer) = (yyvsp[-4].integer) ? (yyvsp[-2].integer) : (yyvsp[0].integer); }
1963 -#line 1813 "dtc-parser.tab.c" /* yacc.c:1646 */
1964 +#line 1833 "dtc-parser.tab.c" /* yacc.c:1646 */
1968 -#line 362 "dtc-parser.y" /* yacc.c:1646 */
1970 +#line 378 "dtc-parser.y" /* yacc.c:1646 */
1971 { (yyval.integer) = (yyvsp[-2].integer) || (yyvsp[0].integer); }
1972 -#line 1819 "dtc-parser.tab.c" /* yacc.c:1646 */
1973 +#line 1839 "dtc-parser.tab.c" /* yacc.c:1646 */
1977 -#line 367 "dtc-parser.y" /* yacc.c:1646 */
1979 +#line 383 "dtc-parser.y" /* yacc.c:1646 */
1980 { (yyval.integer) = (yyvsp[-2].integer) && (yyvsp[0].integer); }
1981 -#line 1825 "dtc-parser.tab.c" /* yacc.c:1646 */
1982 +#line 1845 "dtc-parser.tab.c" /* yacc.c:1646 */
1986 -#line 372 "dtc-parser.y" /* yacc.c:1646 */
1988 +#line 388 "dtc-parser.y" /* yacc.c:1646 */
1989 { (yyval.integer) = (yyvsp[-2].integer) | (yyvsp[0].integer); }
1990 -#line 1831 "dtc-parser.tab.c" /* yacc.c:1646 */
1991 +#line 1851 "dtc-parser.tab.c" /* yacc.c:1646 */
1995 -#line 377 "dtc-parser.y" /* yacc.c:1646 */
1997 +#line 393 "dtc-parser.y" /* yacc.c:1646 */
1998 { (yyval.integer) = (yyvsp[-2].integer) ^ (yyvsp[0].integer); }
1999 -#line 1837 "dtc-parser.tab.c" /* yacc.c:1646 */
2000 +#line 1857 "dtc-parser.tab.c" /* yacc.c:1646 */
2004 -#line 382 "dtc-parser.y" /* yacc.c:1646 */
2006 +#line 398 "dtc-parser.y" /* yacc.c:1646 */
2007 { (yyval.integer) = (yyvsp[-2].integer) & (yyvsp[0].integer); }
2008 -#line 1843 "dtc-parser.tab.c" /* yacc.c:1646 */
2009 +#line 1863 "dtc-parser.tab.c" /* yacc.c:1646 */
2013 -#line 387 "dtc-parser.y" /* yacc.c:1646 */
2015 +#line 403 "dtc-parser.y" /* yacc.c:1646 */
2016 { (yyval.integer) = (yyvsp[-2].integer) == (yyvsp[0].integer); }
2017 -#line 1849 "dtc-parser.tab.c" /* yacc.c:1646 */
2018 +#line 1869 "dtc-parser.tab.c" /* yacc.c:1646 */
2022 -#line 388 "dtc-parser.y" /* yacc.c:1646 */
2024 +#line 404 "dtc-parser.y" /* yacc.c:1646 */
2025 { (yyval.integer) = (yyvsp[-2].integer) != (yyvsp[0].integer); }
2026 -#line 1855 "dtc-parser.tab.c" /* yacc.c:1646 */
2027 +#line 1875 "dtc-parser.tab.c" /* yacc.c:1646 */
2031 -#line 393 "dtc-parser.y" /* yacc.c:1646 */
2033 +#line 409 "dtc-parser.y" /* yacc.c:1646 */
2034 { (yyval.integer) = (yyvsp[-2].integer) < (yyvsp[0].integer); }
2035 -#line 1861 "dtc-parser.tab.c" /* yacc.c:1646 */
2036 +#line 1881 "dtc-parser.tab.c" /* yacc.c:1646 */
2040 -#line 394 "dtc-parser.y" /* yacc.c:1646 */
2042 +#line 410 "dtc-parser.y" /* yacc.c:1646 */
2043 { (yyval.integer) = (yyvsp[-2].integer) > (yyvsp[0].integer); }
2044 -#line 1867 "dtc-parser.tab.c" /* yacc.c:1646 */
2045 +#line 1887 "dtc-parser.tab.c" /* yacc.c:1646 */
2049 -#line 395 "dtc-parser.y" /* yacc.c:1646 */
2051 +#line 411 "dtc-parser.y" /* yacc.c:1646 */
2052 { (yyval.integer) = (yyvsp[-2].integer) <= (yyvsp[0].integer); }
2053 -#line 1873 "dtc-parser.tab.c" /* yacc.c:1646 */
2054 +#line 1893 "dtc-parser.tab.c" /* yacc.c:1646 */
2058 -#line 396 "dtc-parser.y" /* yacc.c:1646 */
2060 +#line 412 "dtc-parser.y" /* yacc.c:1646 */
2061 { (yyval.integer) = (yyvsp[-2].integer) >= (yyvsp[0].integer); }
2062 -#line 1879 "dtc-parser.tab.c" /* yacc.c:1646 */
2063 +#line 1899 "dtc-parser.tab.c" /* yacc.c:1646 */
2067 -#line 400 "dtc-parser.y" /* yacc.c:1646 */
2069 +#line 416 "dtc-parser.y" /* yacc.c:1646 */
2070 { (yyval.integer) = (yyvsp[-2].integer) << (yyvsp[0].integer); }
2071 -#line 1885 "dtc-parser.tab.c" /* yacc.c:1646 */
2072 +#line 1905 "dtc-parser.tab.c" /* yacc.c:1646 */
2076 -#line 401 "dtc-parser.y" /* yacc.c:1646 */
2078 +#line 417 "dtc-parser.y" /* yacc.c:1646 */
2079 { (yyval.integer) = (yyvsp[-2].integer) >> (yyvsp[0].integer); }
2080 -#line 1891 "dtc-parser.tab.c" /* yacc.c:1646 */
2081 +#line 1911 "dtc-parser.tab.c" /* yacc.c:1646 */
2085 -#line 406 "dtc-parser.y" /* yacc.c:1646 */
2087 +#line 422 "dtc-parser.y" /* yacc.c:1646 */
2088 { (yyval.integer) = (yyvsp[-2].integer) + (yyvsp[0].integer); }
2089 -#line 1897 "dtc-parser.tab.c" /* yacc.c:1646 */
2090 +#line 1917 "dtc-parser.tab.c" /* yacc.c:1646 */
2094 -#line 407 "dtc-parser.y" /* yacc.c:1646 */
2096 +#line 423 "dtc-parser.y" /* yacc.c:1646 */
2097 { (yyval.integer) = (yyvsp[-2].integer) - (yyvsp[0].integer); }
2098 -#line 1903 "dtc-parser.tab.c" /* yacc.c:1646 */
2099 +#line 1923 "dtc-parser.tab.c" /* yacc.c:1646 */
2103 -#line 412 "dtc-parser.y" /* yacc.c:1646 */
2105 +#line 428 "dtc-parser.y" /* yacc.c:1646 */
2106 { (yyval.integer) = (yyvsp[-2].integer) * (yyvsp[0].integer); }
2107 -#line 1909 "dtc-parser.tab.c" /* yacc.c:1646 */
2108 +#line 1929 "dtc-parser.tab.c" /* yacc.c:1646 */
2112 -#line 413 "dtc-parser.y" /* yacc.c:1646 */
2114 +#line 429 "dtc-parser.y" /* yacc.c:1646 */
2115 { (yyval.integer) = (yyvsp[-2].integer) / (yyvsp[0].integer); }
2116 -#line 1915 "dtc-parser.tab.c" /* yacc.c:1646 */
2117 +#line 1935 "dtc-parser.tab.c" /* yacc.c:1646 */
2121 -#line 414 "dtc-parser.y" /* yacc.c:1646 */
2123 +#line 430 "dtc-parser.y" /* yacc.c:1646 */
2124 { (yyval.integer) = (yyvsp[-2].integer) % (yyvsp[0].integer); }
2125 -#line 1921 "dtc-parser.tab.c" /* yacc.c:1646 */
2126 +#line 1941 "dtc-parser.tab.c" /* yacc.c:1646 */
2130 -#line 420 "dtc-parser.y" /* yacc.c:1646 */
2132 +#line 436 "dtc-parser.y" /* yacc.c:1646 */
2133 { (yyval.integer) = -(yyvsp[0].integer); }
2134 -#line 1927 "dtc-parser.tab.c" /* yacc.c:1646 */
2135 +#line 1947 "dtc-parser.tab.c" /* yacc.c:1646 */
2139 -#line 421 "dtc-parser.y" /* yacc.c:1646 */
2141 +#line 437 "dtc-parser.y" /* yacc.c:1646 */
2142 { (yyval.integer) = ~(yyvsp[0].integer); }
2143 -#line 1933 "dtc-parser.tab.c" /* yacc.c:1646 */
2144 +#line 1953 "dtc-parser.tab.c" /* yacc.c:1646 */
2148 -#line 422 "dtc-parser.y" /* yacc.c:1646 */
2150 +#line 438 "dtc-parser.y" /* yacc.c:1646 */
2151 { (yyval.integer) = !(yyvsp[0].integer); }
2152 -#line 1939 "dtc-parser.tab.c" /* yacc.c:1646 */
2153 +#line 1959 "dtc-parser.tab.c" /* yacc.c:1646 */
2157 -#line 427 "dtc-parser.y" /* yacc.c:1646 */
2159 +#line 443 "dtc-parser.y" /* yacc.c:1646 */
2161 (yyval.data) = empty_data;
2163 -#line 1947 "dtc-parser.tab.c" /* yacc.c:1646 */
2164 +#line 1967 "dtc-parser.tab.c" /* yacc.c:1646 */
2168 -#line 431 "dtc-parser.y" /* yacc.c:1646 */
2170 +#line 447 "dtc-parser.y" /* yacc.c:1646 */
2172 (yyval.data) = data_append_byte((yyvsp[-1].data), (yyvsp[0].byte));
2174 -#line 1955 "dtc-parser.tab.c" /* yacc.c:1646 */
2175 +#line 1975 "dtc-parser.tab.c" /* yacc.c:1646 */
2179 -#line 435 "dtc-parser.y" /* yacc.c:1646 */
2181 +#line 451 "dtc-parser.y" /* yacc.c:1646 */
2183 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
2185 -#line 1963 "dtc-parser.tab.c" /* yacc.c:1646 */
2186 +#line 1983 "dtc-parser.tab.c" /* yacc.c:1646 */
2190 -#line 442 "dtc-parser.y" /* yacc.c:1646 */
2192 +#line 458 "dtc-parser.y" /* yacc.c:1646 */
2194 (yyval.nodelist) = NULL;
2196 -#line 1971 "dtc-parser.tab.c" /* yacc.c:1646 */
2197 +#line 1991 "dtc-parser.tab.c" /* yacc.c:1646 */
2201 -#line 446 "dtc-parser.y" /* yacc.c:1646 */
2203 +#line 462 "dtc-parser.y" /* yacc.c:1646 */
2205 (yyval.nodelist) = chain_node((yyvsp[-1].node), (yyvsp[0].nodelist));
2207 -#line 1979 "dtc-parser.tab.c" /* yacc.c:1646 */
2208 +#line 1999 "dtc-parser.tab.c" /* yacc.c:1646 */
2212 -#line 450 "dtc-parser.y" /* yacc.c:1646 */
2214 +#line 466 "dtc-parser.y" /* yacc.c:1646 */
2216 ERROR(&(yylsp[0]), "Properties must precede subnodes");
2219 -#line 1988 "dtc-parser.tab.c" /* yacc.c:1646 */
2220 +#line 2008 "dtc-parser.tab.c" /* yacc.c:1646 */
2224 -#line 458 "dtc-parser.y" /* yacc.c:1646 */
2226 +#line 474 "dtc-parser.y" /* yacc.c:1646 */
2228 (yyval.node) = name_node((yyvsp[0].node), (yyvsp[-1].propnodename));
2230 -#line 1996 "dtc-parser.tab.c" /* yacc.c:1646 */
2231 +#line 2016 "dtc-parser.tab.c" /* yacc.c:1646 */
2235 -#line 462 "dtc-parser.y" /* yacc.c:1646 */
2237 +#line 478 "dtc-parser.y" /* yacc.c:1646 */
2239 (yyval.node) = name_node(build_node_delete(), (yyvsp[-1].propnodename));
2241 -#line 2004 "dtc-parser.tab.c" /* yacc.c:1646 */
2242 +#line 2024 "dtc-parser.tab.c" /* yacc.c:1646 */
2246 -#line 466 "dtc-parser.y" /* yacc.c:1646 */
2248 +#line 482 "dtc-parser.y" /* yacc.c:1646 */
2250 add_label(&(yyvsp[0].node)->labels, (yyvsp[-1].labelref));
2251 (yyval.node) = (yyvsp[0].node);
2253 -#line 2013 "dtc-parser.tab.c" /* yacc.c:1646 */
2254 +#line 2033 "dtc-parser.tab.c" /* yacc.c:1646 */
2258 -#line 2017 "dtc-parser.tab.c" /* yacc.c:1646 */
2259 +#line 2037 "dtc-parser.tab.c" /* yacc.c:1646 */
2262 /* User semantic actions sometimes alter yychar, and that requires
2263 @@ -2248,7 +2268,7 @@ yyreturn:
2267 -#line 472 "dtc-parser.y" /* yacc.c:1906 */
2268 +#line 488 "dtc-parser.y" /* yacc.c:1906 */
2271 void yyerror(char const *s)
2272 --- a/scripts/dtc/dtc-parser.tab.h_shipped
2273 +++ b/scripts/dtc/dtc-parser.tab.h_shipped
2274 @@ -46,26 +46,27 @@ extern int yydebug;
2278 - DT_MEMRESERVE = 259,
2288 - DT_DEL_PROP = 269,
2289 - DT_DEL_NODE = 270,
2290 - DT_PROPNODENAME = 271,
2292 - DT_CHAR_LITERAL = 273,
2299 + DT_MEMRESERVE = 260,
2309 + DT_DEL_PROP = 270,
2310 + DT_DEL_NODE = 271,
2311 + DT_PROPNODENAME = 272,
2313 + DT_CHAR_LITERAL = 274,
2322 @@ -74,7 +75,7 @@ extern int yydebug;
2323 typedef union YYSTYPE YYSTYPE;
2326 -#line 38 "dtc-parser.y" /* yacc.c:1909 */
2327 +#line 39 "dtc-parser.y" /* yacc.c:1909 */
2331 @@ -92,8 +93,9 @@ union YYSTYPE
2332 struct node *nodelist;
2333 struct reserve_info *re;
2337 -#line 97 "dtc-parser.tab.h" /* yacc.c:1909 */
2338 +#line 99 "dtc-parser.tab.h" /* yacc.c:1909 */
2340 # define YYSTYPE_IS_TRIVIAL 1
2341 # define YYSTYPE_IS_DECLARED 1
2342 --- a/scripts/dtc/dtc-parser.y
2343 +++ b/scripts/dtc/dtc-parser.y
2348 +#include <inttypes.h>
2352 @@ -52,9 +53,11 @@ extern bool treesource_error;
2353 struct node *nodelist;
2354 struct reserve_info *re;
2361 %token DT_MEMRESERVE
2362 %token DT_LSHIFT DT_RSHIFT DT_LE DT_GE DT_EQ DT_NE DT_AND DT_OR
2364 @@ -71,6 +74,7 @@ extern bool treesource_error;
2366 %type <data> propdata
2367 %type <data> propdataprefix
2368 +%type <is_plugin> plugindecl
2369 %type <re> memreserve
2370 %type <re> memreserves
2371 %type <array> arrayprefix
2372 @@ -101,10 +105,22 @@ extern bool treesource_error;
2376 - DT_V1 ';' memreserves devicetree
2377 + DT_V1 ';' plugindecl memreserves devicetree
2379 - the_boot_info = build_boot_info($3, $4,
2380 - guess_boot_cpuid($4));
2381 + $5->is_plugin = $3;
2382 + the_boot_info = build_boot_info($4, $5,
2383 + guess_boot_cpuid($5));
2398 --- a/scripts/dtc/dtc.c
2399 +++ b/scripts/dtc/dtc.c
2400 @@ -29,6 +29,7 @@ int reservenum; /* Number of memory res
2401 int minsize; /* Minimum blob size */
2402 int padsize; /* Additional padding to blob */
2403 int phandle_format = PHANDLE_BOTH; /* Use linux,phandle or phandle properties */
2404 +int symbol_fixup_support = 0;
2406 static void fill_fullpaths(struct node *tree, const char *prefix)
2408 @@ -51,7 +52,7 @@ static void fill_fullpaths(struct node *
2409 #define FDT_VERSION(version) _FDT_VERSION(version)
2410 #define _FDT_VERSION(version) #version
2411 static const char usage_synopsis[] = "dtc [options] <input file>";
2412 -static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv";
2413 +static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:@hv";
2414 static struct option const usage_long_opts[] = {
2415 {"quiet", no_argument, NULL, 'q'},
2416 {"in-format", a_argument, NULL, 'I'},
2417 @@ -69,6 +70,7 @@ static struct option const usage_long_op
2418 {"phandle", a_argument, NULL, 'H'},
2419 {"warning", a_argument, NULL, 'W'},
2420 {"error", a_argument, NULL, 'E'},
2421 + {"symbols", no_argument, NULL, '@'},
2422 {"help", no_argument, NULL, 'h'},
2423 {"version", no_argument, NULL, 'v'},
2424 {NULL, no_argument, NULL, 0x0},
2425 @@ -99,6 +101,7 @@ static const char * const usage_opts_hel
2426 "\t\tboth - Both \"linux,phandle\" and \"phandle\" properties",
2427 "\n\tEnable/disable warnings (prefix with \"no-\")",
2428 "\n\tEnable/disable errors (prefix with \"no-\")",
2429 + "\n\tEnable symbols/fixup support",
2430 "\n\tPrint this help and exit",
2431 "\n\tPrint version and exit",
2433 @@ -186,7 +189,9 @@ int main(int argc, char *argv[])
2435 parse_checks_option(false, true, optarg);
2439 + symbol_fixup_support = 1;
2444 --- a/scripts/dtc/dtc.h
2445 +++ b/scripts/dtc/dtc.h
2446 @@ -54,6 +54,7 @@ extern int reservenum; /* Number of mem
2447 extern int minsize; /* Minimum blob size */
2448 extern int padsize; /* Additional padding to blob */
2449 extern int phandle_format; /* Use linux,phandle or phandle properties */
2450 +extern int symbol_fixup_support;/* enable symbols & fixup support */
2452 #define PHANDLE_LEGACY 0x1
2453 #define PHANDLE_EPAPR 0x2
2454 @@ -132,6 +133,26 @@ struct label {
2458 +struct fixup_entry {
2460 + struct node *node;
2461 + struct property *prop;
2462 + struct fixup_entry *next;
2463 + bool local_fixup_generated;
2468 + struct fixup_entry *entries;
2469 + struct fixup *next;
2473 + struct label *label;
2474 + struct node *node;
2475 + struct symbol *next;
2481 @@ -158,6 +179,13 @@ struct node {
2482 int addr_cells, size_cells;
2484 struct label *labels;
2486 + struct symbol *symbols;
2487 + struct fixup_entry *local_fixups;
2488 + bool emit_local_fixup_node;
2491 + struct fixup *fixups;
2494 #define for_each_label_withdel(l0, l) \
2495 @@ -181,6 +209,18 @@ struct node {
2496 for_each_child_withdel(n, c) \
2499 +#define for_each_fixup(n, f) \
2500 + for ((f) = (n)->fixups; (f); (f) = (f)->next)
2502 +#define for_each_fixup_entry(f, fe) \
2503 + for ((fe) = (f)->entries; (fe); (fe) = (fe)->next)
2505 +#define for_each_symbol(n, s) \
2506 + for ((s) = (n)->symbols; (s); (s) = (s)->next)
2508 +#define for_each_local_fixup_entry(n, fe) \
2509 + for ((fe) = (n)->local_fixups; (fe); (fe) = (fe)->next)
2511 void add_label(struct label **labels, char *label);
2512 void delete_labels(struct label **labels);
2514 --- a/scripts/dtc/flattree.c
2515 +++ b/scripts/dtc/flattree.c
2516 @@ -255,6 +255,204 @@ static int stringtable_insert(struct dat
2520 +static void emit_local_fixups(struct node *tree, struct emitter *emit,
2521 + void *etarget, struct data *strbuf, struct version_info *vi,
2522 + struct node *node)
2524 + struct fixup_entry *fe, *fen;
2525 + struct node *child;
2526 + int nameoff, count;
2530 + if (node->emit_local_fixup_node) {
2532 + /* emit the external fixups (do not emit /) */
2533 + if (node != tree) {
2534 + emit->beginnode(etarget, NULL);
2535 + emit->string(etarget, node->name, 0);
2536 + emit->align(etarget, sizeof(cell_t));
2539 + for_each_local_fixup_entry(tree, fe) {
2540 + if (fe->node != node || fe->local_fixup_generated)
2543 + /* count the number of fixup entries */
2545 + for_each_local_fixup_entry(tree, fen) {
2546 + if (fen->prop != fe->prop)
2548 + fen->local_fixup_generated = true;
2552 + /* allocate buffer */
2553 + buf = xmalloc(count * sizeof(cell_t));
2555 + /* collect all the offsets in buffer */
2557 + for_each_local_fixup_entry(tree, fen) {
2558 + if (fen->prop != fe->prop)
2560 + fen->local_fixup_generated = true;
2561 + buf[count++] = cpu_to_fdt32(fen->offset);
2564 + d.len = count * sizeof(cell_t);
2565 + d.val = (char *)buf;
2567 + nameoff = stringtable_insert(strbuf, fe->prop->name);
2568 + emit->property(etarget, fe->prop->labels);
2569 + emit->cell(etarget, count * sizeof(cell_t));
2570 + emit->cell(etarget, nameoff);
2572 + if ((vi->flags & FTF_VARALIGN) &&
2573 + (count * sizeof(cell_t)) >= 8)
2574 + emit->align(etarget, 8);
2576 + emit->data(etarget, d);
2577 + emit->align(etarget, sizeof(cell_t));
2583 + for_each_child(node, child)
2584 + emit_local_fixups(tree, emit, etarget, strbuf, vi, child);
2586 + if (node->emit_local_fixup_node && node != tree)
2587 + emit->endnode(etarget, tree->labels);
2590 +static void emit_symbols_node(struct node *tree, struct emitter *emit,
2591 + void *etarget, struct data *strbuf,
2592 + struct version_info *vi)
2594 + struct symbol *sym;
2595 + int nameoff, vallen;
2597 + /* do nothing if no symbols */
2598 + if (!tree->symbols)
2601 + emit->beginnode(etarget, NULL);
2602 + emit->string(etarget, "__symbols__", 0);
2603 + emit->align(etarget, sizeof(cell_t));
2605 + for_each_symbol(tree, sym) {
2607 + vallen = strlen(sym->node->fullpath);
2609 + nameoff = stringtable_insert(strbuf, sym->label->label);
2611 + emit->property(etarget, NULL);
2612 + emit->cell(etarget, vallen + 1);
2613 + emit->cell(etarget, nameoff);
2615 + if ((vi->flags & FTF_VARALIGN) && vallen >= 8)
2616 + emit->align(etarget, 8);
2618 + emit->string(etarget, sym->node->fullpath,
2619 + strlen(sym->node->fullpath));
2620 + emit->align(etarget, sizeof(cell_t));
2623 + emit->endnode(etarget, NULL);
2626 +static void emit_local_fixups_node(struct node *tree, struct emitter *emit,
2627 + void *etarget, struct data *strbuf,
2628 + struct version_info *vi)
2630 + struct fixup_entry *fe;
2631 + struct node *node;
2633 + /* do nothing if no local fixups */
2634 + if (!tree->local_fixups)
2637 + /* mark all nodes that need a local fixup generated (and parents) */
2638 + for_each_local_fixup_entry(tree, fe) {
2640 + while (node != NULL && !node->emit_local_fixup_node) {
2641 + node->emit_local_fixup_node = true;
2642 + node = node->parent;
2646 + /* emit the local fixups node now */
2647 + emit->beginnode(etarget, NULL);
2648 + emit->string(etarget, "__local_fixups__", 0);
2649 + emit->align(etarget, sizeof(cell_t));
2651 + emit_local_fixups(tree, emit, etarget, strbuf, vi, tree);
2653 + emit->endnode(etarget, tree->labels);
2656 +static void emit_fixups_node(struct node *tree, struct emitter *emit,
2657 + void *etarget, struct data *strbuf,
2658 + struct version_info *vi)
2661 + struct fixup_entry *fe;
2663 + const char *fullpath;
2664 + int namesz, nameoff, vallen;
2666 + /* do nothing if no fixups */
2667 + if (!tree->fixups)
2670 + /* emit the external fixups */
2671 + emit->beginnode(etarget, NULL);
2672 + emit->string(etarget, "__fixups__", 0);
2673 + emit->align(etarget, sizeof(cell_t));
2675 + for_each_fixup(tree, f) {
2678 + for_each_fixup_entry(f, fe) {
2679 + fullpath = fe->node->fullpath;
2680 + if (fullpath[0] == '\0')
2682 + namesz += strlen(fullpath) + 1;
2683 + namesz += strlen(fe->prop->name) + 1;
2684 + namesz += 32; /* space for :<number> + '\0' */
2687 + name = xmalloc(namesz);
2690 + for_each_fixup_entry(f, fe) {
2691 + fullpath = fe->node->fullpath;
2692 + if (fullpath[0] == '\0')
2694 + snprintf(s, name + namesz - s, "%s:%s:%d", fullpath,
2695 + fe->prop->name, fe->offset);
2696 + s += strlen(s) + 1;
2699 + nameoff = stringtable_insert(strbuf, f->ref);
2700 + vallen = s - name - 1;
2702 + emit->property(etarget, NULL);
2703 + emit->cell(etarget, vallen + 1);
2704 + emit->cell(etarget, nameoff);
2706 + if ((vi->flags & FTF_VARALIGN) && vallen >= 8)
2707 + emit->align(etarget, 8);
2709 + emit->string(etarget, name, vallen);
2710 + emit->align(etarget, sizeof(cell_t));
2715 + emit->endnode(etarget, tree->labels);
2718 static void flatten_tree(struct node *tree, struct emitter *emit,
2719 void *etarget, struct data *strbuf,
2720 struct version_info *vi)
2721 @@ -310,6 +508,10 @@ static void flatten_tree(struct node *tr
2722 flatten_tree(child, emit, etarget, strbuf, vi);
2725 + emit_symbols_node(tree, emit, etarget, strbuf, vi);
2726 + emit_local_fixups_node(tree, emit, etarget, strbuf, vi);
2727 + emit_fixups_node(tree, emit, etarget, strbuf, vi);
2729 emit->endnode(etarget, tree->labels);
2732 --- a/scripts/dtc/version_gen.h
2733 +++ b/scripts/dtc/version_gen.h
2735 -#define DTC_VERSION "DTC 1.4.1-g9d3649bd"
2736 +#define DTC_VERSION "DTC 1.4.1-g25efc119"