kernel: bump 4.9 to 4.9.109 for 18.06
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.9 / 950-0053-scripts-dtc-Update-to-upstream-version-1.4.1.patch
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
5
6 Includes the new localfixups format.
7
8 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
9
10 scripts/dtc: Fix UMR causing corrupt dtbo overlay files
11
12 struct fixup_entry is allocated from the heap but it's member
13 local_fixup_generated was never initialized. This lead to
14 corrupted dtbo files.
15
16 Fix this by initializing local_fixup_generated to false.
17
18 Signed-off-by: Matthias Reichl <hias@horus.com>
19
20 scripts/dtc: Only emit local fixups for overlays
21
22 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
23 ---
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(-)
35
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)
40 {
41 struct marker *m = prop->val.markers;
42 + struct fixup *f, **fp;
43 + struct fixup_entry *fe, **fep;
44 struct node *refnode;
45 cell_t phandle;
46
47 @@ -490,11 +492,70 @@ static void fixup_phandle_references(str
48
49 refnode = get_node_by_ref(dt, m->ref);
50 if (! refnode) {
51 - FAIL(c, "Reference to non-existent node or label \"%s\"\n",
52 - m->ref);
53 + if (!dt->is_plugin) {
54 + FAIL(c, "Reference to non-existent node or label \"%s\"\n",
55 + m->ref);
56 + continue;
57 + }
58 +
59 + /* allocate fixup entry */
60 + fe = xmalloc(sizeof(*fe));
61 +
62 + fe->node = node;
63 + fe->prop = prop;
64 + fe->offset = m->offset;
65 + fe->next = NULL;
66 +
67 + /* search for an already existing fixup */
68 + for_each_fixup(dt, f)
69 + if (strcmp(f->ref, m->ref) == 0)
70 + break;
71 +
72 + /* no fixup found, add new */
73 + if (f == NULL) {
74 + f = xmalloc(sizeof(*f));
75 + f->ref = m->ref;
76 + f->entries = NULL;
77 + f->next = NULL;
78 +
79 + /* add it to the tree */
80 + fp = &dt->fixups;
81 + while (*fp)
82 + fp = &(*fp)->next;
83 + *fp = f;
84 + }
85 +
86 + /* and now append fixup entry */
87 + fep = &f->entries;
88 + while (*fep)
89 + fep = &(*fep)->next;
90 + *fep = fe;
91 +
92 + /* mark the entry as unresolved */
93 + *((cell_t *)(prop->val.val + m->offset)) =
94 + cpu_to_fdt32(0xdeadbeef);
95 continue;
96 }
97
98 + /* if it's a local reference, we need to record it */
99 + if (symbol_fixup_support && dt->is_plugin) {
100 +
101 + /* allocate a new local fixup entry */
102 + fe = xmalloc(sizeof(*fe));
103 +
104 + fe->node = node;
105 + fe->prop = prop;
106 + fe->offset = m->offset;
107 + fe->next = NULL;
108 + fe->local_fixup_generated = false;
109 +
110 + /* append it to the local fixups */
111 + fep = &dt->local_fixups;
112 + while (*fep)
113 + fep = &(*fep)->next;
114 + *fep = fe;
115 + }
116 +
117 phandle = get_node_phandle(dt, refnode);
118 *((cell_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle);
119 }
120 @@ -676,6 +737,45 @@ static void check_obsolete_chosen_interr
121 }
122 TREE_WARNING(obsolete_chosen_interrupt_controller, NULL);
123
124 +static void check_auto_label_phandles(struct check *c, struct node *dt,
125 + struct node *node)
126 +{
127 + struct label *l;
128 + struct symbol *s, **sp;
129 + int has_label;
130 +
131 + if (!symbol_fixup_support)
132 + return;
133 +
134 + has_label = 0;
135 + for_each_label(node->labels, l) {
136 + has_label = 1;
137 + break;
138 + }
139 +
140 + if (!has_label)
141 + return;
142 +
143 + /* force allocation of a phandle for this node */
144 + (void)get_node_phandle(dt, node);
145 +
146 + /* add the symbol */
147 + for_each_label(node->labels, l) {
148 +
149 + s = xmalloc(sizeof(*s));
150 + s->label = l;
151 + s->node = node;
152 + s->next = NULL;
153 +
154 + /* add it to the symbols list */
155 + sp = &dt->symbols;
156 + while (*sp)
157 + sp = &((*sp)->next);
158 + *sp = s;
159 + }
160 +}
161 +NODE_WARNING(auto_label_phandles, NULL);
162 +
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,
169
170 + &auto_label_phandles,
171 +
172 &always_fail,
173 };
174
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
178 return DT_V1;
179 }
180
181 +<*>"/plugin/" {
182 + DPRINT("Keyword: /plugin/\n");
183 + return DT_PLUGIN;
184 + }
185 +
186 <*>"/memreserve/" {
187 DPRINT("Keyword: /memreserve/\n");
188 BEGIN_DEFAULT();
189 --- a/scripts/dtc/dtc-lexer.lex.c_shipped
190 +++ b/scripts/dtc/dtc-lexer.lex.c_shipped
191 @@ -9,7 +9,7 @@
192 #define FLEX_SCANNER
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
198 #define FLEX_BETA
199 #endif
200 @@ -162,12 +162,7 @@ typedef unsigned int flex_uint32_t;
201 typedef struct yy_buffer_state *YY_BUFFER_STATE;
202 #endif
203
204 -#ifndef YY_TYPEDEF_YY_SIZE_T
205 -#define YY_TYPEDEF_YY_SIZE_T
206 -typedef size_t yy_size_t;
207 -#endif
208 -
209 -extern yy_size_t yyleng;
210 +extern int yyleng;
211
212 extern FILE *yyin, *yyout;
213
214 @@ -176,7 +171,6 @@ extern FILE *yyin, *yyout;
215 #define EOB_ACT_LAST_MATCH 2
216
217 #define YY_LESS_LINENO(n)
218 - #define YY_LINENO_REWIND_TO(ptr)
219
220 /* Return all but the first "n" matched characters back to the input stream. */
221 #define yyless(n) \
222 @@ -194,6 +188,11 @@ extern FILE *yyin, *yyout;
223
224 #define unput(c) yyunput( c, (yytext_ptr) )
225
226 +#ifndef YY_TYPEDEF_YY_SIZE_T
227 +#define YY_TYPEDEF_YY_SIZE_T
228 +typedef size_t yy_size_t;
229 +#endif
230 +
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
236 * characters.
237 */
238 - yy_size_t yy_n_chars;
239 + int yy_n_chars;
240
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
244
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 */
248 -yy_size_t yyleng;
249 +static int yy_n_chars; /* number of characters read into yy_ch_buf */
250 +int yyleng;
251
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
255
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 );
260
261 void *yyalloc (yy_size_t );
262 void *yyrealloc (void *,yy_size_t );
263 @@ -342,7 +341,7 @@ void yyfree (void * );
264
265 /* Begin user sect3 */
266
267 -#define yywrap() 1
268 +#define yywrap(n) 1
269 #define YY_SKIP_YYWRAP
270
271 typedef unsigned char YY_CHAR;
272 @@ -373,8 +372,8 @@ static void yy_fatal_error (yyconst char
273 *yy_cp = '\0'; \
274 (yy_c_buf_p) = yy_cp;
275
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. */
282 struct yy_trans_info
283 @@ -382,25 +381,26 @@ struct yy_trans_info
284 flex_int32_t yy_verify;
285 flex_int32_t yy_nxt;
286 };
287 -static yyconst flex_int16_t yy_accept[159] =
288 +static yyconst flex_int16_t yy_accept[166] =
289 { 0,
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,
300 -
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,
317 +
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,
324 + 0, 0, 0, 8, 0
325 } ;
326
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,
331
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] =
342 1, 1, 1, 1, 1
343 } ;
344
345 -static yyconst flex_int32_t yy_meta[47] =
346 +static yyconst flex_int32_t yy_meta[48] =
347 { 0,
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,
352 - 8, 8, 8, 3, 1, 4
353 + 8, 8, 8, 8, 3, 1, 4
354 } ;
355
356 -static yyconst flex_int16_t yy_base[173] =
357 +static yyconst flex_int16_t yy_base[180] =
358 { 0,
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,
369 -
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,
377 - 318, 326
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,
388 +
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
397 } ;
398
399 -static yyconst flex_int16_t yy_def[173] =
400 +static yyconst flex_int16_t yy_def[180] =
401 { 0,
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,
412 -
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,
420 - 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,
431 +
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
440 } ;
441
442 -static yyconst flex_int16_t yy_nxt[438] =
443 +static yyconst flex_int16_t yy_nxt[449] =
444 { 0,
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,
455 -
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,
466 -
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,
477 -
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,
488 -
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,
499 +
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,
510 +
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,
521 +
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,
532 +
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
538 } ;
539
540 -static yyconst flex_int16_t yy_chk[438] =
541 +static yyconst flex_int16_t yy_chk[449] =
542 { 0,
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,
556
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,
567 -
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,
578 -
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,
596 +
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,
607 +
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,
619
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
629 } ;
630
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"
638
639 #define INITIAL 0
640 #define BYTESTRING 1
641 @@ -704,7 +706,7 @@ FILE *yyget_out (void );
642
643 void yyset_out (FILE * out_str );
644
645 -yy_size_t yyget_leng (void );
646 +int yyget_leng (void );
647
648 char *yyget_text (void );
649
650 @@ -853,6 +855,10 @@ YY_DECL
651 register char *yy_cp, *yy_bp;
652 register int yy_act;
653
654 +#line 68 "dtc-lexer.l"
655 +
656 +#line 861 "dtc-lexer.lex.c"
657 +
658 if ( !(yy_init) )
659 {
660 (yy_init) = 1;
661 @@ -879,11 +885,6 @@ YY_DECL
662 yy_load_buffer_state( );
663 }
664
665 - {
666 -#line 68 "dtc-lexer.l"
667 -
668 -#line 886 "dtc-lexer.lex.c"
669 -
670 while ( 1 ) /* loops until end-of-file is reached */
671 {
672 yy_cp = (yy_c_buf_p);
673 @@ -901,7 +902,7 @@ YY_DECL
674 yy_match:
675 do
676 {
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] )
680 {
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 )
684 {
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];
689 }
690 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
691 ++yy_cp;
692 }
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);
697
698 @@ -951,39 +952,31 @@ case 2:
699 YY_RULE_SETUP
700 #line 75 "dtc-lexer.l"
701 {
702 - char *line, *fnstart, *fnend;
703 - struct data fn;
704 + char *line, *tmp, *fn;
705 /* skip text before line # */
706 line = yytext;
707 while (!isdigit((unsigned char)*line))
708 line++;
709 -
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--)
716 - ;
717 - assert(fnstart && fnend && (fnend > fnstart));
718 -
719 - fn = data_copy_escape_string(fnstart + 1,
720 - fnend - fnstart - 1);
721 -
722 - /* Don't allow nuls in filenames */
723 - if (memchr(fn.val, '\0', fn.len - 1))
724 - lexical_error("nul in line number directive");
725 -
726 + /* skip digits in line # */
727 + tmp = line;
728 + while (!isspace((unsigned char)*tmp))
729 + tmp++;
730 + /* "NULL"-terminate line # */
731 + *tmp = '\0';
732 + /* start of filename */
733 + fn = strchr(tmp + 1, '"') + 1;
734 + /* strip trailing " from filename */
735 + tmp = strchr(fn, '"');
736 + *tmp = 0;
737 /* -1 since #line is the number of the next line */
738 - srcpos_set_line(xstrdup(fn.val), atoi(line) - 1);
739 - data_free(fn);
740 + srcpos_set_line(xstrdup(fn), atoi(line) - 1);
741 }
742 YY_BREAK
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"
749 {
750 if (!pop_input_file()) {
751 yyterminate();
752 @@ -993,7 +986,7 @@ case YY_STATE_EOF(V1):
753 case 3:
754 /* rule 3 can match eol */
755 YY_RULE_SETUP
756 -#line 110 "dtc-lexer.l"
757 +#line 102 "dtc-lexer.l"
758 {
759 DPRINT("String: %s\n", yytext);
760 yylval.data = data_copy_escape_string(yytext+1,
761 @@ -1003,7 +996,7 @@ YY_RULE_SETUP
762 YY_BREAK
763 case 4:
764 YY_RULE_SETUP
765 -#line 117 "dtc-lexer.l"
766 +#line 109 "dtc-lexer.l"
767 {
768 DPRINT("Keyword: /dts-v1/\n");
769 dts_version = 1;
770 @@ -1013,25 +1006,33 @@ YY_RULE_SETUP
771 YY_BREAK
772 case 5:
773 YY_RULE_SETUP
774 -#line 124 "dtc-lexer.l"
775 +#line 116 "dtc-lexer.l"
776 +{
777 + DPRINT("Keyword: /plugin/\n");
778 + return DT_PLUGIN;
779 + }
780 + YY_BREAK
781 +case 6:
782 +YY_RULE_SETUP
783 +#line 121 "dtc-lexer.l"
784 {
785 DPRINT("Keyword: /memreserve/\n");
786 BEGIN_DEFAULT();
787 return DT_MEMRESERVE;
788 }
789 YY_BREAK
790 -case 6:
791 +case 7:
792 YY_RULE_SETUP
793 -#line 130 "dtc-lexer.l"
794 +#line 127 "dtc-lexer.l"
795 {
796 DPRINT("Keyword: /bits/\n");
797 BEGIN_DEFAULT();
798 return DT_BITS;
799 }
800 YY_BREAK
801 -case 7:
802 +case 8:
803 YY_RULE_SETUP
804 -#line 136 "dtc-lexer.l"
805 +#line 133 "dtc-lexer.l"
806 {
807 DPRINT("Keyword: /delete-property/\n");
808 DPRINT("<PROPNODENAME>\n");
809 @@ -1039,9 +1040,9 @@ YY_RULE_SETUP
810 return DT_DEL_PROP;
811 }
812 YY_BREAK
813 -case 8:
814 +case 9:
815 YY_RULE_SETUP
816 -#line 143 "dtc-lexer.l"
817 +#line 140 "dtc-lexer.l"
818 {
819 DPRINT("Keyword: /delete-node/\n");
820 DPRINT("<PROPNODENAME>\n");
821 @@ -1049,9 +1050,9 @@ YY_RULE_SETUP
822 return DT_DEL_NODE;
823 }
824 YY_BREAK
825 -case 9:
826 +case 10:
827 YY_RULE_SETUP
828 -#line 150 "dtc-lexer.l"
829 +#line 147 "dtc-lexer.l"
830 {
831 DPRINT("Label: %s\n", yytext);
832 yylval.labelref = xstrdup(yytext);
833 @@ -1059,9 +1060,9 @@ YY_RULE_SETUP
834 return DT_LABEL;
835 }
836 YY_BREAK
837 -case 10:
838 +case 11:
839 YY_RULE_SETUP
840 -#line 157 "dtc-lexer.l"
841 +#line 154 "dtc-lexer.l"
842 {
843 char *e;
844 DPRINT("Integer Literal: '%s'\n", yytext);
845 @@ -1069,10 +1070,7 @@ YY_RULE_SETUP
846 errno = 0;
847 yylval.integer = strtoull(yytext, &e, 0);
848
849 - if (*e && e[strspn(e, "UL")]) {
850 - lexical_error("Bad integer literal '%s'",
851 - yytext);
852 - }
853 + assert(!(*e) || !e[strspn(e, "UL")]);
854
855 if (errno == ERANGE)
856 lexical_error("Integer literal '%s' out of range",
857 @@ -1084,10 +1082,10 @@ YY_RULE_SETUP
858 return DT_LITERAL;
859 }
860 YY_BREAK
861 -case 11:
862 -/* rule 11 can match eol */
863 +case 12:
864 +/* rule 12 can match eol */
865 YY_RULE_SETUP
866 -#line 179 "dtc-lexer.l"
867 +#line 173 "dtc-lexer.l"
868 {
869 struct data d;
870 DPRINT("Character literal: %s\n", yytext);
871 @@ -1109,18 +1107,18 @@ YY_RULE_SETUP
872 return DT_CHAR_LITERAL;
873 }
874 YY_BREAK
875 -case 12:
876 +case 13:
877 YY_RULE_SETUP
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);
883 return DT_REF;
884 }
885 YY_BREAK
886 -case 13:
887 +case 14:
888 YY_RULE_SETUP
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
895 return DT_REF;
896 }
897 YY_BREAK
898 -case 14:
899 +case 15:
900 YY_RULE_SETUP
901 -#line 213 "dtc-lexer.l"
902 +#line 207 "dtc-lexer.l"
903 {
904 yylval.byte = strtol(yytext, NULL, 16);
905 DPRINT("Byte: %02x\n", (int)yylval.byte);
906 return DT_BYTE;
907 }
908 YY_BREAK
909 -case 15:
910 +case 16:
911 YY_RULE_SETUP
912 -#line 219 "dtc-lexer.l"
913 +#line 213 "dtc-lexer.l"
914 {
915 DPRINT("/BYTESTRING\n");
916 BEGIN_DEFAULT();
917 return ']';
918 }
919 YY_BREAK
920 -case 16:
921 +case 17:
922 YY_RULE_SETUP
923 -#line 225 "dtc-lexer.l"
924 +#line 219 "dtc-lexer.l"
925 {
926 DPRINT("PropNodeName: %s\n", yytext);
927 yylval.propnodename = xstrdup((yytext[0] == '\\') ?
928 @@ -1157,75 +1155,75 @@ YY_RULE_SETUP
929 return DT_PROPNODENAME;
930 }
931 YY_BREAK
932 -case 17:
933 +case 18:
934 YY_RULE_SETUP
935 -#line 233 "dtc-lexer.l"
936 +#line 227 "dtc-lexer.l"
937 {
938 DPRINT("Binary Include\n");
939 return DT_INCBIN;
940 }
941 YY_BREAK
942 -case 18:
943 -/* rule 18 can match eol */
944 -YY_RULE_SETUP
945 -#line 238 "dtc-lexer.l"
946 -/* eat whitespace */
947 - YY_BREAK
948 case 19:
949 /* rule 19 can match eol */
950 YY_RULE_SETUP
951 -#line 239 "dtc-lexer.l"
952 -/* eat C-style comments */
953 +#line 232 "dtc-lexer.l"
954 +/* eat whitespace */
955 YY_BREAK
956 case 20:
957 /* rule 20 can match eol */
958 YY_RULE_SETUP
959 -#line 240 "dtc-lexer.l"
960 -/* eat C++-style comments */
961 +#line 233 "dtc-lexer.l"
962 +/* eat C-style comments */
963 YY_BREAK
964 case 21:
965 +/* rule 21 can match eol */
966 YY_RULE_SETUP
967 -#line 242 "dtc-lexer.l"
968 -{ return DT_LSHIFT; };
969 +#line 234 "dtc-lexer.l"
970 +/* eat C++-style comments */
971 YY_BREAK
972 case 22:
973 YY_RULE_SETUP
974 -#line 243 "dtc-lexer.l"
975 -{ return DT_RSHIFT; };
976 +#line 236 "dtc-lexer.l"
977 +{ return DT_LSHIFT; };
978 YY_BREAK
979 case 23:
980 YY_RULE_SETUP
981 -#line 244 "dtc-lexer.l"
982 -{ return DT_LE; };
983 +#line 237 "dtc-lexer.l"
984 +{ return DT_RSHIFT; };
985 YY_BREAK
986 case 24:
987 YY_RULE_SETUP
988 -#line 245 "dtc-lexer.l"
989 -{ return DT_GE; };
990 +#line 238 "dtc-lexer.l"
991 +{ return DT_LE; };
992 YY_BREAK
993 case 25:
994 YY_RULE_SETUP
995 -#line 246 "dtc-lexer.l"
996 -{ return DT_EQ; };
997 +#line 239 "dtc-lexer.l"
998 +{ return DT_GE; };
999 YY_BREAK
1000 case 26:
1001 YY_RULE_SETUP
1002 -#line 247 "dtc-lexer.l"
1003 -{ return DT_NE; };
1004 +#line 240 "dtc-lexer.l"
1005 +{ return DT_EQ; };
1006 YY_BREAK
1007 case 27:
1008 YY_RULE_SETUP
1009 -#line 248 "dtc-lexer.l"
1010 -{ return DT_AND; };
1011 +#line 241 "dtc-lexer.l"
1012 +{ return DT_NE; };
1013 YY_BREAK
1014 case 28:
1015 YY_RULE_SETUP
1016 -#line 249 "dtc-lexer.l"
1017 -{ return DT_OR; };
1018 +#line 242 "dtc-lexer.l"
1019 +{ return DT_AND; };
1020 YY_BREAK
1021 case 29:
1022 YY_RULE_SETUP
1023 -#line 251 "dtc-lexer.l"
1024 +#line 243 "dtc-lexer.l"
1025 +{ return DT_OR; };
1026 + YY_BREAK
1027 +case 30:
1028 +YY_RULE_SETUP
1029 +#line 245 "dtc-lexer.l"
1030 {
1031 DPRINT("Char: %c (\\x%02x)\n", yytext[0],
1032 (unsigned)yytext[0]);
1033 @@ -1241,12 +1239,12 @@ YY_RULE_SETUP
1034 return yytext[0];
1035 }
1036 YY_BREAK
1037 -case 30:
1038 +case 31:
1039 YY_RULE_SETUP
1040 -#line 266 "dtc-lexer.l"
1041 +#line 260 "dtc-lexer.l"
1042 ECHO;
1043 YY_BREAK
1044 -#line 1250 "dtc-lexer.lex.c"
1045 +#line 1248 "dtc-lexer.lex.c"
1046
1047 case YY_END_OF_BUFFER:
1048 {
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 */
1055
1056 /* yy_get_next_buffer - try to read in a new buffer
1057 @@ -1432,21 +1429,21 @@ static int yy_get_next_buffer (void)
1058
1059 else
1060 {
1061 - yy_size_t num_to_read =
1062 + int num_to_read =
1063 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1064
1065 while ( num_to_read <= 0 )
1066 { /* Not enough room in the buffer - grow it. */
1067
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;
1071
1072 int yy_c_buf_p_offset =
1073 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1074
1075 if ( b->yy_is_our_buffer )
1076 {
1077 - yy_size_t new_size = b->yy_buf_size * 2;
1078 + int new_size = b->yy_buf_size * 2;
1079
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)
1083
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 );
1088
1089 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1090 }
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 )
1093 {
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];
1098 }
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 )
1102 {
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];
1107 }
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);
1111
1112 - return yy_is_jam ? 0 : yy_current_state;
1113 + return yy_is_jam ? 0 : yy_current_state;
1114 }
1115
1116 #ifndef YY_NO_INPUT
1117 @@ -1600,7 +1597,7 @@ static int yy_get_next_buffer (void)
1118
1119 else
1120 { /* need more input */
1121 - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1122 + int offset = (yy_c_buf_p) - (yytext_ptr);
1123 ++(yy_c_buf_p);
1124
1125 switch ( yy_get_next_buffer( ) )
1126 @@ -1874,7 +1871,7 @@ void yypop_buffer_state (void)
1127 */
1128 static void yyensure_buffer_stack (void)
1129 {
1130 - yy_size_t num_to_alloc;
1131 + int num_to_alloc;
1132
1133 if (!(yy_buffer_stack)) {
1134
1135 @@ -1971,12 +1968,12 @@ YY_BUFFER_STATE yy_scan_string (yyconst
1136 *
1137 * @return the newly allocated buffer state object.
1138 */
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 )
1141 {
1142 YY_BUFFER_STATE b;
1143 char *buf;
1144 yy_size_t n;
1145 - yy_size_t i;
1146 + int i;
1147
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.
1152 *
1153 */
1154 -yy_size_t yyget_leng (void)
1155 +int yyget_leng (void)
1156 {
1157 return yyleng;
1158 }
1159 @@ -2206,7 +2203,7 @@ void yyfree (void * ptr )
1160
1161 #define YYTABLES_NAME "yytables"
1162
1163 -#line 265 "dtc-lexer.l"
1164 +#line 260 "dtc-lexer.l"
1165
1166
1167
1168 --- a/scripts/dtc/dtc-parser.tab.c_shipped
1169 +++ b/scripts/dtc/dtc-parser.tab.c_shipped
1170 @@ -65,6 +65,7 @@
1171 #line 20 "dtc-parser.y" /* yacc.c:339 */
1172
1173 #include <stdio.h>
1174 +#include <inttypes.h>
1175
1176 #include "dtc.h"
1177 #include "srcpos.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;
1181
1182 -#line 84 "dtc-parser.tab.c" /* yacc.c:339 */
1183 +#line 85 "dtc-parser.tab.c" /* yacc.c:339 */
1184
1185 # ifndef YY_NULLPTR
1186 # if defined __cplusplus && 201103L <= __cplusplus
1187 @@ -116,26 +117,27 @@ extern int yydebug;
1188 enum yytokentype
1189 {
1190 DT_V1 = 258,
1191 - DT_MEMRESERVE = 259,
1192 - DT_LSHIFT = 260,
1193 - DT_RSHIFT = 261,
1194 - DT_LE = 262,
1195 - DT_GE = 263,
1196 - DT_EQ = 264,
1197 - DT_NE = 265,
1198 - DT_AND = 266,
1199 - DT_OR = 267,
1200 - DT_BITS = 268,
1201 - DT_DEL_PROP = 269,
1202 - DT_DEL_NODE = 270,
1203 - DT_PROPNODENAME = 271,
1204 - DT_LITERAL = 272,
1205 - DT_CHAR_LITERAL = 273,
1206 - DT_BYTE = 274,
1207 - DT_STRING = 275,
1208 - DT_LABEL = 276,
1209 - DT_REF = 277,
1210 - DT_INCBIN = 278
1211 + DT_PLUGIN = 259,
1212 + DT_MEMRESERVE = 260,
1213 + DT_LSHIFT = 261,
1214 + DT_RSHIFT = 262,
1215 + DT_LE = 263,
1216 + DT_GE = 264,
1217 + DT_EQ = 265,
1218 + DT_NE = 266,
1219 + DT_AND = 267,
1220 + DT_OR = 268,
1221 + DT_BITS = 269,
1222 + DT_DEL_PROP = 270,
1223 + DT_DEL_NODE = 271,
1224 + DT_PROPNODENAME = 272,
1225 + DT_LITERAL = 273,
1226 + DT_CHAR_LITERAL = 274,
1227 + DT_BYTE = 275,
1228 + DT_STRING = 276,
1229 + DT_LABEL = 277,
1230 + DT_REF = 278,
1231 + DT_INCBIN = 279
1232 };
1233 #endif
1234
1235 @@ -144,7 +146,7 @@ extern int yydebug;
1236 typedef union YYSTYPE YYSTYPE;
1237 union YYSTYPE
1238 {
1239 -#line 38 "dtc-parser.y" /* yacc.c:355 */
1240 +#line 39 "dtc-parser.y" /* yacc.c:355 */
1241
1242 char *propnodename;
1243 char *labelref;
1244 @@ -162,8 +164,9 @@ union YYSTYPE
1245 struct node *nodelist;
1246 struct reserve_info *re;
1247 uint64_t integer;
1248 + bool is_plugin;
1249
1250 -#line 167 "dtc-parser.tab.c" /* yacc.c:355 */
1251 +#line 170 "dtc-parser.tab.c" /* yacc.c:355 */
1252 };
1253 # define YYSTYPE_IS_TRIVIAL 1
1254 # define YYSTYPE_IS_DECLARED 1
1255 @@ -192,7 +195,7 @@ int yyparse (void);
1256
1257 /* Copy the second part of user declarations. */
1258
1259 -#line 196 "dtc-parser.tab.c" /* yacc.c:358 */
1260 +#line 199 "dtc-parser.tab.c" /* yacc.c:358 */
1261
1262 #ifdef short
1263 # undef short
1264 @@ -439,18 +442,18 @@ union yyalloc
1265 #define YYLAST 136
1266
1267 /* YYNTOKENS -- Number of terminals. */
1268 -#define YYNTOKENS 47
1269 +#define YYNTOKENS 48
1270 /* YYNNTS -- Number of nonterminals. */
1271 -#define YYNNTS 28
1272 +#define YYNNTS 29
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
1279
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
1285
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
1317 };
1318
1319 #if YYDEBUG
1320 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
1321 static const yytype_uint16 yyrline[] =
1322 {
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,
1331 - 481
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,
1340 + 473, 477, 481
1341 };
1342 #endif
1343
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[] =
1347 {
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
1374 };
1375 #endif
1376
1377 @@ -533,16 +536,16 @@ static const yytype_uint16 yytoknum[] =
1378 {
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
1387 };
1388 # endif
1389
1390 -#define YYPACT_NINF -81
1391 +#define YYPACT_NINF -84
1392
1393 #define yypact_value_is_default(Yystate) \
1394 - (!!((Yystate) == (-81)))
1395 + (!!((Yystate) == (-84)))
1396
1397 #define YYTABLE_NINF -1
1398
1399 @@ -553,21 +556,21 @@ static const yytype_uint16 yytoknum[] =
1400 STATE-NUM. */
1401 static const yytype_int8 yypact[] =
1402 {
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,
1417 - 74, 25, 75, -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
1433 };
1434
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[] =
1439 {
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,
1459 - 0, 0, 0, 23
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
1469 };
1470
1471 /* YYPGOTO[NTERM-NUM]. */
1472 static const yytype_int8 yypgoto[] =
1473 {
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
1480 };
1481
1482 /* YYDEFGOTO[NTERM-NUM]. */
1483 static const yytype_int16 yydefgoto[] =
1484 {
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
1491 };
1492
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[] =
1497 {
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
1526 };
1527
1528 static const yytype_int16 yycheck[] =
1529 {
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
1558 };
1559
1560 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1561 symbol of state STATE-NUM. */
1562 static const yytype_uint8 yystos[] =
1563 {
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,
1578 - 58, 33, 58, 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
1594 };
1595
1596 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1597 static const yytype_uint8 yyr1[] =
1598 {
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,
1607 - 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,
1616 + 76, 76, 76
1617 };
1618
1619 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
1620 static const yytype_uint8 yyr2[] =
1621 {
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,
1630 - 2
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,
1639 + 2, 3, 2
1640 };
1641
1642
1643 @@ -1463,65 +1466,82 @@ yyreduce:
1644 switch (yyn)
1645 {
1646 case 2:
1647 -#line 105 "dtc-parser.y" /* yacc.c:1646 */
1648 +#line 109 "dtc-parser.y" /* yacc.c:1646 */
1649 {
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)));
1653 }
1654 -#line 1472 "dtc-parser.tab.c" /* yacc.c:1646 */
1655 +#line 1476 "dtc-parser.tab.c" /* yacc.c:1646 */
1656 break;
1657
1658 case 3:
1659 -#line 113 "dtc-parser.y" /* yacc.c:1646 */
1660 +#line 118 "dtc-parser.y" /* yacc.c:1646 */
1661 {
1662 - (yyval.re) = NULL;
1663 + (yyval.is_plugin) = false;
1664 }
1665 -#line 1480 "dtc-parser.tab.c" /* yacc.c:1646 */
1666 +#line 1484 "dtc-parser.tab.c" /* yacc.c:1646 */
1667 break;
1668
1669 case 4:
1670 -#line 117 "dtc-parser.y" /* yacc.c:1646 */
1671 +#line 122 "dtc-parser.y" /* yacc.c:1646 */
1672 {
1673 - (yyval.re) = chain_reserve_entry((yyvsp[-1].re), (yyvsp[0].re));
1674 + (yyval.is_plugin) = true;
1675 }
1676 -#line 1488 "dtc-parser.tab.c" /* yacc.c:1646 */
1677 +#line 1492 "dtc-parser.tab.c" /* yacc.c:1646 */
1678 break;
1679
1680 case 5:
1681 -#line 124 "dtc-parser.y" /* yacc.c:1646 */
1682 +#line 129 "dtc-parser.y" /* yacc.c:1646 */
1683 {
1684 - (yyval.re) = build_reserve_entry((yyvsp[-2].integer), (yyvsp[-1].integer));
1685 + (yyval.re) = NULL;
1686 }
1687 -#line 1496 "dtc-parser.tab.c" /* yacc.c:1646 */
1688 +#line 1500 "dtc-parser.tab.c" /* yacc.c:1646 */
1689 break;
1690
1691 case 6:
1692 -#line 128 "dtc-parser.y" /* yacc.c:1646 */
1693 +#line 133 "dtc-parser.y" /* yacc.c:1646 */
1694 + {
1695 + (yyval.re) = chain_reserve_entry((yyvsp[-1].re), (yyvsp[0].re));
1696 + }
1697 +#line 1508 "dtc-parser.tab.c" /* yacc.c:1646 */
1698 + break;
1699 +
1700 + case 7:
1701 +#line 140 "dtc-parser.y" /* yacc.c:1646 */
1702 + {
1703 + (yyval.re) = build_reserve_entry((yyvsp[-2].integer), (yyvsp[-1].integer));
1704 + }
1705 +#line 1516 "dtc-parser.tab.c" /* yacc.c:1646 */
1706 + break;
1707 +
1708 + case 8:
1709 +#line 144 "dtc-parser.y" /* yacc.c:1646 */
1710 {
1711 add_label(&(yyvsp[0].re)->labels, (yyvsp[-1].labelref));
1712 (yyval.re) = (yyvsp[0].re);
1713 }
1714 -#line 1505 "dtc-parser.tab.c" /* yacc.c:1646 */
1715 +#line 1525 "dtc-parser.tab.c" /* yacc.c:1646 */
1716 break;
1717
1718 - case 7:
1719 -#line 136 "dtc-parser.y" /* yacc.c:1646 */
1720 + case 9:
1721 +#line 152 "dtc-parser.y" /* yacc.c:1646 */
1722 {
1723 (yyval.node) = name_node((yyvsp[0].node), "");
1724 }
1725 -#line 1513 "dtc-parser.tab.c" /* yacc.c:1646 */
1726 +#line 1533 "dtc-parser.tab.c" /* yacc.c:1646 */
1727 break;
1728
1729 - case 8:
1730 -#line 140 "dtc-parser.y" /* yacc.c:1646 */
1731 + case 10:
1732 +#line 156 "dtc-parser.y" /* yacc.c:1646 */
1733 {
1734 (yyval.node) = merge_nodes((yyvsp[-2].node), (yyvsp[0].node));
1735 }
1736 -#line 1521 "dtc-parser.tab.c" /* yacc.c:1646 */
1737 +#line 1541 "dtc-parser.tab.c" /* yacc.c:1646 */
1738 break;
1739
1740 - case 9:
1741 -#line 145 "dtc-parser.y" /* yacc.c:1646 */
1742 + case 11:
1743 +#line 161 "dtc-parser.y" /* yacc.c:1646 */
1744 {
1745 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1746
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);
1750 }
1751 -#line 1536 "dtc-parser.tab.c" /* yacc.c:1646 */
1752 +#line 1556 "dtc-parser.tab.c" /* yacc.c:1646 */
1753 break;
1754
1755 - case 10:
1756 -#line 156 "dtc-parser.y" /* yacc.c:1646 */
1757 + case 12:
1758 +#line 172 "dtc-parser.y" /* yacc.c:1646 */
1759 {
1760 struct node *target = get_node_by_ref((yyvsp[-2].node), (yyvsp[-1].labelref));
1761
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);
1765 }
1766 -#line 1550 "dtc-parser.tab.c" /* yacc.c:1646 */
1767 +#line 1570 "dtc-parser.tab.c" /* yacc.c:1646 */
1768 break;
1769
1770 - case 11:
1771 -#line 166 "dtc-parser.y" /* yacc.c:1646 */
1772 + case 13:
1773 +#line 182 "dtc-parser.y" /* yacc.c:1646 */
1774 {
1775 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1776
1777 @@ -1562,100 +1582,100 @@ yyreduce:
1778
1779 (yyval.node) = (yyvsp[-3].node);
1780 }
1781 -#line 1566 "dtc-parser.tab.c" /* yacc.c:1646 */
1782 +#line 1586 "dtc-parser.tab.c" /* yacc.c:1646 */
1783 break;
1784
1785 - case 12:
1786 -#line 181 "dtc-parser.y" /* yacc.c:1646 */
1787 + case 14:
1788 +#line 197 "dtc-parser.y" /* yacc.c:1646 */
1789 {
1790 (yyval.node) = build_node((yyvsp[-3].proplist), (yyvsp[-2].nodelist));
1791 }
1792 -#line 1574 "dtc-parser.tab.c" /* yacc.c:1646 */
1793 +#line 1594 "dtc-parser.tab.c" /* yacc.c:1646 */
1794 break;
1795
1796 - case 13:
1797 -#line 188 "dtc-parser.y" /* yacc.c:1646 */
1798 + case 15:
1799 +#line 204 "dtc-parser.y" /* yacc.c:1646 */
1800 {
1801 (yyval.proplist) = NULL;
1802 }
1803 -#line 1582 "dtc-parser.tab.c" /* yacc.c:1646 */
1804 +#line 1602 "dtc-parser.tab.c" /* yacc.c:1646 */
1805 break;
1806
1807 - case 14:
1808 -#line 192 "dtc-parser.y" /* yacc.c:1646 */
1809 + case 16:
1810 +#line 208 "dtc-parser.y" /* yacc.c:1646 */
1811 {
1812 (yyval.proplist) = chain_property((yyvsp[0].prop), (yyvsp[-1].proplist));
1813 }
1814 -#line 1590 "dtc-parser.tab.c" /* yacc.c:1646 */
1815 +#line 1610 "dtc-parser.tab.c" /* yacc.c:1646 */
1816 break;
1817
1818 - case 15:
1819 -#line 199 "dtc-parser.y" /* yacc.c:1646 */
1820 + case 17:
1821 +#line 215 "dtc-parser.y" /* yacc.c:1646 */
1822 {
1823 (yyval.prop) = build_property((yyvsp[-3].propnodename), (yyvsp[-1].data));
1824 }
1825 -#line 1598 "dtc-parser.tab.c" /* yacc.c:1646 */
1826 +#line 1618 "dtc-parser.tab.c" /* yacc.c:1646 */
1827 break;
1828
1829 - case 16:
1830 -#line 203 "dtc-parser.y" /* yacc.c:1646 */
1831 + case 18:
1832 +#line 219 "dtc-parser.y" /* yacc.c:1646 */
1833 {
1834 (yyval.prop) = build_property((yyvsp[-1].propnodename), empty_data);
1835 }
1836 -#line 1606 "dtc-parser.tab.c" /* yacc.c:1646 */
1837 +#line 1626 "dtc-parser.tab.c" /* yacc.c:1646 */
1838 break;
1839
1840 - case 17:
1841 -#line 207 "dtc-parser.y" /* yacc.c:1646 */
1842 + case 19:
1843 +#line 223 "dtc-parser.y" /* yacc.c:1646 */
1844 {
1845 (yyval.prop) = build_property_delete((yyvsp[-1].propnodename));
1846 }
1847 -#line 1614 "dtc-parser.tab.c" /* yacc.c:1646 */
1848 +#line 1634 "dtc-parser.tab.c" /* yacc.c:1646 */
1849 break;
1850
1851 - case 18:
1852 -#line 211 "dtc-parser.y" /* yacc.c:1646 */
1853 + case 20:
1854 +#line 227 "dtc-parser.y" /* yacc.c:1646 */
1855 {
1856 add_label(&(yyvsp[0].prop)->labels, (yyvsp[-1].labelref));
1857 (yyval.prop) = (yyvsp[0].prop);
1858 }
1859 -#line 1623 "dtc-parser.tab.c" /* yacc.c:1646 */
1860 +#line 1643 "dtc-parser.tab.c" /* yacc.c:1646 */
1861 break;
1862
1863 - case 19:
1864 -#line 219 "dtc-parser.y" /* yacc.c:1646 */
1865 + case 21:
1866 +#line 235 "dtc-parser.y" /* yacc.c:1646 */
1867 {
1868 (yyval.data) = data_merge((yyvsp[-1].data), (yyvsp[0].data));
1869 }
1870 -#line 1631 "dtc-parser.tab.c" /* yacc.c:1646 */
1871 +#line 1651 "dtc-parser.tab.c" /* yacc.c:1646 */
1872 break;
1873
1874 - case 20:
1875 -#line 223 "dtc-parser.y" /* yacc.c:1646 */
1876 + case 22:
1877 +#line 239 "dtc-parser.y" /* yacc.c:1646 */
1878 {
1879 (yyval.data) = data_merge((yyvsp[-2].data), (yyvsp[-1].array).data);
1880 }
1881 -#line 1639 "dtc-parser.tab.c" /* yacc.c:1646 */
1882 +#line 1659 "dtc-parser.tab.c" /* yacc.c:1646 */
1883 break;
1884
1885 - case 21:
1886 -#line 227 "dtc-parser.y" /* yacc.c:1646 */
1887 + case 23:
1888 +#line 243 "dtc-parser.y" /* yacc.c:1646 */
1889 {
1890 (yyval.data) = data_merge((yyvsp[-3].data), (yyvsp[-1].data));
1891 }
1892 -#line 1647 "dtc-parser.tab.c" /* yacc.c:1646 */
1893 +#line 1667 "dtc-parser.tab.c" /* yacc.c:1646 */
1894 break;
1895
1896 - case 22:
1897 -#line 231 "dtc-parser.y" /* yacc.c:1646 */
1898 + case 24:
1899 +#line 247 "dtc-parser.y" /* yacc.c:1646 */
1900 {
1901 (yyval.data) = data_add_marker((yyvsp[-1].data), REF_PATH, (yyvsp[0].labelref));
1902 }
1903 -#line 1655 "dtc-parser.tab.c" /* yacc.c:1646 */
1904 +#line 1675 "dtc-parser.tab.c" /* yacc.c:1646 */
1905 break;
1906
1907 - case 23:
1908 -#line 235 "dtc-parser.y" /* yacc.c:1646 */
1909 + case 25:
1910 +#line 251 "dtc-parser.y" /* yacc.c:1646 */
1911 {
1912 FILE *f = srcfile_relative_open((yyvsp[-5].data).val, NULL);
1913 struct data d;
1914 @@ -1671,11 +1691,11 @@ yyreduce:
1915 (yyval.data) = data_merge((yyvsp[-8].data), d);
1916 fclose(f);
1917 }
1918 -#line 1675 "dtc-parser.tab.c" /* yacc.c:1646 */
1919 +#line 1695 "dtc-parser.tab.c" /* yacc.c:1646 */
1920 break;
1921
1922 - case 24:
1923 -#line 251 "dtc-parser.y" /* yacc.c:1646 */
1924 + case 26:
1925 +#line 267 "dtc-parser.y" /* yacc.c:1646 */
1926 {
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);
1931 fclose(f);
1932 }
1933 -#line 1689 "dtc-parser.tab.c" /* yacc.c:1646 */
1934 +#line 1709 "dtc-parser.tab.c" /* yacc.c:1646 */
1935 break;
1936
1937 - case 25:
1938 -#line 261 "dtc-parser.y" /* yacc.c:1646 */
1939 + case 27:
1940 +#line 277 "dtc-parser.y" /* yacc.c:1646 */
1941 {
1942 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1943 }
1944 -#line 1697 "dtc-parser.tab.c" /* yacc.c:1646 */
1945 +#line 1717 "dtc-parser.tab.c" /* yacc.c:1646 */
1946 break;
1947
1948 - case 26:
1949 -#line 268 "dtc-parser.y" /* yacc.c:1646 */
1950 + case 28:
1951 +#line 284 "dtc-parser.y" /* yacc.c:1646 */
1952 {
1953 (yyval.data) = empty_data;
1954 }
1955 -#line 1705 "dtc-parser.tab.c" /* yacc.c:1646 */
1956 +#line 1725 "dtc-parser.tab.c" /* yacc.c:1646 */
1957 break;
1958
1959 - case 27:
1960 -#line 272 "dtc-parser.y" /* yacc.c:1646 */
1961 + case 29:
1962 +#line 288 "dtc-parser.y" /* yacc.c:1646 */
1963 {
1964 (yyval.data) = (yyvsp[-1].data);
1965 }
1966 -#line 1713 "dtc-parser.tab.c" /* yacc.c:1646 */
1967 +#line 1733 "dtc-parser.tab.c" /* yacc.c:1646 */
1968 break;
1969
1970 - case 28:
1971 -#line 276 "dtc-parser.y" /* yacc.c:1646 */
1972 + case 30:
1973 +#line 292 "dtc-parser.y" /* yacc.c:1646 */
1974 {
1975 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1976 }
1977 -#line 1721 "dtc-parser.tab.c" /* yacc.c:1646 */
1978 +#line 1741 "dtc-parser.tab.c" /* yacc.c:1646 */
1979 break;
1980
1981 - case 29:
1982 -#line 283 "dtc-parser.y" /* yacc.c:1646 */
1983 + case 31:
1984 +#line 299 "dtc-parser.y" /* yacc.c:1646 */
1985 {
1986 unsigned long long bits;
1987
1988 @@ -1737,20 +1757,20 @@ yyreduce:
1989 (yyval.array).data = empty_data;
1990 (yyval.array).bits = bits;
1991 }
1992 -#line 1741 "dtc-parser.tab.c" /* yacc.c:1646 */
1993 +#line 1761 "dtc-parser.tab.c" /* yacc.c:1646 */
1994 break;
1995
1996 - case 30:
1997 -#line 299 "dtc-parser.y" /* yacc.c:1646 */
1998 + case 32:
1999 +#line 315 "dtc-parser.y" /* yacc.c:1646 */
2000 {
2001 (yyval.array).data = empty_data;
2002 (yyval.array).bits = 32;
2003 }
2004 -#line 1750 "dtc-parser.tab.c" /* yacc.c:1646 */
2005 +#line 1770 "dtc-parser.tab.c" /* yacc.c:1646 */
2006 break;
2007
2008 - case 31:
2009 -#line 304 "dtc-parser.y" /* yacc.c:1646 */
2010 + case 33:
2011 +#line 320 "dtc-parser.y" /* yacc.c:1646 */
2012 {
2013 if ((yyvsp[-1].array).bits < 64) {
2014 uint64_t mask = (1ULL << (yyvsp[-1].array).bits) - 1;
2015 @@ -1769,11 +1789,11 @@ yyreduce:
2016
2017 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, (yyvsp[0].integer), (yyvsp[-1].array).bits);
2018 }
2019 -#line 1773 "dtc-parser.tab.c" /* yacc.c:1646 */
2020 +#line 1793 "dtc-parser.tab.c" /* yacc.c:1646 */
2021 break;
2022
2023 - case 32:
2024 -#line 323 "dtc-parser.y" /* yacc.c:1646 */
2025 + case 34:
2026 +#line 339 "dtc-parser.y" /* yacc.c:1646 */
2027 {
2028 uint64_t val = ~0ULL >> (64 - (yyvsp[-1].array).bits);
2029
2030 @@ -1787,247 +1807,233 @@ yyreduce:
2031
2032 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, val, (yyvsp[-1].array).bits);
2033 }
2034 -#line 1791 "dtc-parser.tab.c" /* yacc.c:1646 */
2035 +#line 1811 "dtc-parser.tab.c" /* yacc.c:1646 */
2036 break;
2037
2038 - case 33:
2039 -#line 337 "dtc-parser.y" /* yacc.c:1646 */
2040 + case 35:
2041 +#line 353 "dtc-parser.y" /* yacc.c:1646 */
2042 {
2043 (yyval.array).data = data_add_marker((yyvsp[-1].array).data, LABEL, (yyvsp[0].labelref));
2044 }
2045 -#line 1799 "dtc-parser.tab.c" /* yacc.c:1646 */
2046 +#line 1819 "dtc-parser.tab.c" /* yacc.c:1646 */
2047 break;
2048
2049 - case 36:
2050 -#line 346 "dtc-parser.y" /* yacc.c:1646 */
2051 + case 38:
2052 +#line 362 "dtc-parser.y" /* yacc.c:1646 */
2053 {
2054 (yyval.integer) = (yyvsp[-1].integer);
2055 }
2056 -#line 1807 "dtc-parser.tab.c" /* yacc.c:1646 */
2057 +#line 1827 "dtc-parser.tab.c" /* yacc.c:1646 */
2058 break;
2059
2060 - case 39:
2061 -#line 357 "dtc-parser.y" /* yacc.c:1646 */
2062 + case 41:
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 */
2067 break;
2068
2069 - case 41:
2070 -#line 362 "dtc-parser.y" /* yacc.c:1646 */
2071 + case 43:
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 */
2076 break;
2077
2078 - case 43:
2079 -#line 367 "dtc-parser.y" /* yacc.c:1646 */
2080 + case 45:
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 */
2085 break;
2086
2087 - case 45:
2088 -#line 372 "dtc-parser.y" /* yacc.c:1646 */
2089 + case 47:
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 */
2094 break;
2095
2096 - case 47:
2097 -#line 377 "dtc-parser.y" /* yacc.c:1646 */
2098 + case 49:
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 */
2103 break;
2104
2105 - case 49:
2106 -#line 382 "dtc-parser.y" /* yacc.c:1646 */
2107 + case 51:
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 */
2112 break;
2113
2114 - case 51:
2115 -#line 387 "dtc-parser.y" /* yacc.c:1646 */
2116 + case 53:
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 */
2121 break;
2122
2123 - case 52:
2124 -#line 388 "dtc-parser.y" /* yacc.c:1646 */
2125 + case 54:
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 */
2130 break;
2131
2132 - case 54:
2133 -#line 393 "dtc-parser.y" /* yacc.c:1646 */
2134 + case 56:
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 */
2139 break;
2140
2141 - case 55:
2142 -#line 394 "dtc-parser.y" /* yacc.c:1646 */
2143 + case 57:
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 */
2148 break;
2149
2150 - case 56:
2151 -#line 395 "dtc-parser.y" /* yacc.c:1646 */
2152 + case 58:
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 */
2157 break;
2158
2159 - case 57:
2160 -#line 396 "dtc-parser.y" /* yacc.c:1646 */
2161 + case 59:
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 */
2166 break;
2167
2168 - case 58:
2169 -#line 400 "dtc-parser.y" /* yacc.c:1646 */
2170 + case 60:
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 */
2175 break;
2176
2177 - case 59:
2178 -#line 401 "dtc-parser.y" /* yacc.c:1646 */
2179 + case 61:
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 */
2184 break;
2185
2186 - case 61:
2187 -#line 406 "dtc-parser.y" /* yacc.c:1646 */
2188 + case 63:
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 */
2193 break;
2194
2195 - case 62:
2196 -#line 407 "dtc-parser.y" /* yacc.c:1646 */
2197 + case 64:
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 */
2202 break;
2203
2204 - case 64:
2205 -#line 412 "dtc-parser.y" /* yacc.c:1646 */
2206 + case 66:
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 */
2211 break;
2212
2213 - case 65:
2214 -#line 414 "dtc-parser.y" /* yacc.c:1646 */
2215 - {
2216 - if ((yyvsp[0].integer) != 0) {
2217 - (yyval.integer) = (yyvsp[-2].integer) / (yyvsp[0].integer);
2218 - } else {
2219 - ERROR(&(yyloc), "Division by zero");
2220 - (yyval.integer) = 0;
2221 - }
2222 - }
2223 -#line 1922 "dtc-parser.tab.c" /* yacc.c:1646 */
2224 + case 67:
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 */
2228 break;
2229
2230 - case 66:
2231 -#line 423 "dtc-parser.y" /* yacc.c:1646 */
2232 - {
2233 - if ((yyvsp[0].integer) != 0) {
2234 - (yyval.integer) = (yyvsp[-2].integer) % (yyvsp[0].integer);
2235 - } else {
2236 - ERROR(&(yyloc), "Division by zero");
2237 - (yyval.integer) = 0;
2238 - }
2239 - }
2240 -#line 1935 "dtc-parser.tab.c" /* yacc.c:1646 */
2241 + case 68:
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 */
2245 break;
2246
2247 - case 69:
2248 + case 71:
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 */
2253 break;
2254
2255 - case 70:
2256 + case 72:
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 */
2261 break;
2262
2263 - case 71:
2264 + case 73:
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 */
2269 break;
2270
2271 - case 72:
2272 + case 74:
2273 #line 443 "dtc-parser.y" /* yacc.c:1646 */
2274 {
2275 (yyval.data) = empty_data;
2276 }
2277 -#line 1961 "dtc-parser.tab.c" /* yacc.c:1646 */
2278 +#line 1967 "dtc-parser.tab.c" /* yacc.c:1646 */
2279 break;
2280
2281 - case 73:
2282 + case 75:
2283 #line 447 "dtc-parser.y" /* yacc.c:1646 */
2284 {
2285 (yyval.data) = data_append_byte((yyvsp[-1].data), (yyvsp[0].byte));
2286 }
2287 -#line 1969 "dtc-parser.tab.c" /* yacc.c:1646 */
2288 +#line 1975 "dtc-parser.tab.c" /* yacc.c:1646 */
2289 break;
2290
2291 - case 74:
2292 + case 76:
2293 #line 451 "dtc-parser.y" /* yacc.c:1646 */
2294 {
2295 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
2296 }
2297 -#line 1977 "dtc-parser.tab.c" /* yacc.c:1646 */
2298 +#line 1983 "dtc-parser.tab.c" /* yacc.c:1646 */
2299 break;
2300
2301 - case 75:
2302 + case 77:
2303 #line 458 "dtc-parser.y" /* yacc.c:1646 */
2304 {
2305 (yyval.nodelist) = NULL;
2306 }
2307 -#line 1985 "dtc-parser.tab.c" /* yacc.c:1646 */
2308 +#line 1991 "dtc-parser.tab.c" /* yacc.c:1646 */
2309 break;
2310
2311 - case 76:
2312 + case 78:
2313 #line 462 "dtc-parser.y" /* yacc.c:1646 */
2314 {
2315 (yyval.nodelist) = chain_node((yyvsp[-1].node), (yyvsp[0].nodelist));
2316 }
2317 -#line 1993 "dtc-parser.tab.c" /* yacc.c:1646 */
2318 +#line 1999 "dtc-parser.tab.c" /* yacc.c:1646 */
2319 break;
2320
2321 - case 77:
2322 + case 79:
2323 #line 466 "dtc-parser.y" /* yacc.c:1646 */
2324 {
2325 ERROR(&(yylsp[0]), "Properties must precede subnodes");
2326 YYERROR;
2327 }
2328 -#line 2002 "dtc-parser.tab.c" /* yacc.c:1646 */
2329 +#line 2008 "dtc-parser.tab.c" /* yacc.c:1646 */
2330 break;
2331
2332 - case 78:
2333 + case 80:
2334 #line 474 "dtc-parser.y" /* yacc.c:1646 */
2335 {
2336 (yyval.node) = name_node((yyvsp[0].node), (yyvsp[-1].propnodename));
2337 }
2338 -#line 2010 "dtc-parser.tab.c" /* yacc.c:1646 */
2339 +#line 2016 "dtc-parser.tab.c" /* yacc.c:1646 */
2340 break;
2341
2342 - case 79:
2343 + case 81:
2344 #line 478 "dtc-parser.y" /* yacc.c:1646 */
2345 {
2346 (yyval.node) = name_node(build_node_delete(), (yyvsp[-1].propnodename));
2347 }
2348 -#line 2018 "dtc-parser.tab.c" /* yacc.c:1646 */
2349 +#line 2024 "dtc-parser.tab.c" /* yacc.c:1646 */
2350 break;
2351
2352 - case 80:
2353 + case 82:
2354 #line 482 "dtc-parser.y" /* yacc.c:1646 */
2355 {
2356 add_label(&(yyvsp[0].node)->labels, (yyvsp[-1].labelref));
2357 (yyval.node) = (yyvsp[0].node);
2358 }
2359 -#line 2027 "dtc-parser.tab.c" /* yacc.c:1646 */
2360 +#line 2033 "dtc-parser.tab.c" /* yacc.c:1646 */
2361 break;
2362
2363
2364 -#line 2031 "dtc-parser.tab.c" /* yacc.c:1646 */
2365 +#line 2037 "dtc-parser.tab.c" /* yacc.c:1646 */
2366 default: break;
2367 }
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;
2372 enum yytokentype
2373 {
2374 DT_V1 = 258,
2375 - DT_MEMRESERVE = 259,
2376 - DT_LSHIFT = 260,
2377 - DT_RSHIFT = 261,
2378 - DT_LE = 262,
2379 - DT_GE = 263,
2380 - DT_EQ = 264,
2381 - DT_NE = 265,
2382 - DT_AND = 266,
2383 - DT_OR = 267,
2384 - DT_BITS = 268,
2385 - DT_DEL_PROP = 269,
2386 - DT_DEL_NODE = 270,
2387 - DT_PROPNODENAME = 271,
2388 - DT_LITERAL = 272,
2389 - DT_CHAR_LITERAL = 273,
2390 - DT_BYTE = 274,
2391 - DT_STRING = 275,
2392 - DT_LABEL = 276,
2393 - DT_REF = 277,
2394 - DT_INCBIN = 278
2395 + DT_PLUGIN = 259,
2396 + DT_MEMRESERVE = 260,
2397 + DT_LSHIFT = 261,
2398 + DT_RSHIFT = 262,
2399 + DT_LE = 263,
2400 + DT_GE = 264,
2401 + DT_EQ = 265,
2402 + DT_NE = 266,
2403 + DT_AND = 267,
2404 + DT_OR = 268,
2405 + DT_BITS = 269,
2406 + DT_DEL_PROP = 270,
2407 + DT_DEL_NODE = 271,
2408 + DT_PROPNODENAME = 272,
2409 + DT_LITERAL = 273,
2410 + DT_CHAR_LITERAL = 274,
2411 + DT_BYTE = 275,
2412 + DT_STRING = 276,
2413 + DT_LABEL = 277,
2414 + DT_REF = 278,
2415 + DT_INCBIN = 279
2416 };
2417 #endif
2418
2419 @@ -74,7 +75,7 @@ extern int yydebug;
2420 typedef union YYSTYPE YYSTYPE;
2421 union YYSTYPE
2422 {
2423 -#line 38 "dtc-parser.y" /* yacc.c:1909 */
2424 +#line 39 "dtc-parser.y" /* yacc.c:1909 */
2425
2426 char *propnodename;
2427 char *labelref;
2428 @@ -92,8 +93,9 @@ union YYSTYPE
2429 struct node *nodelist;
2430 struct reserve_info *re;
2431 uint64_t integer;
2432 + bool is_plugin;
2433
2434 -#line 97 "dtc-parser.tab.h" /* yacc.c:1909 */
2435 +#line 99 "dtc-parser.tab.h" /* yacc.c:1909 */
2436 };
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
2441 @@ -19,6 +19,7 @@
2442 */
2443 %{
2444 #include <stdio.h>
2445 +#include <inttypes.h>
2446
2447 #include "dtc.h"
2448 #include "srcpos.h"
2449 @@ -52,9 +53,11 @@ extern bool treesource_error;
2450 struct node *nodelist;
2451 struct reserve_info *re;
2452 uint64_t integer;
2453 + bool is_plugin;
2454 }
2455
2456 %token DT_V1
2457 +%token DT_PLUGIN
2458 %token DT_MEMRESERVE
2459 %token DT_LSHIFT DT_RSHIFT DT_LE DT_GE DT_EQ DT_NE DT_AND DT_OR
2460 %token DT_BITS
2461 @@ -71,6 +74,7 @@ extern bool treesource_error;
2462
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;
2470 %%
2471
2472 sourcefile:
2473 - DT_V1 ';' memreserves devicetree
2474 + DT_V1 ';' plugindecl memreserves devicetree
2475 {
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));
2481 + }
2482 + ;
2483 +
2484 +plugindecl:
2485 + /* empty */
2486 + {
2487 + $$ = false;
2488 + }
2489 + | DT_PLUGIN ';'
2490 + {
2491 + $$ = true;
2492 }
2493 ;
2494
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;
2502
2503 static void fill_fullpaths(struct node *tree, const char *prefix)
2504 {
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",
2529 NULL,
2530 @@ -233,7 +236,9 @@ int main(int argc, char *argv[])
2531 case 'E':
2532 parse_checks_option(false, true, optarg);
2533 break;
2534 -
2535 + case '@':
2536 + symbol_fixup_support = 1;
2537 + break;
2538 case 'h':
2539 usage(NULL);
2540 default:
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 */
2548
2549 #define PHANDLE_LEGACY 0x1
2550 #define PHANDLE_EPAPR 0x2
2551 @@ -132,6 +133,26 @@ struct label {
2552 struct label *next;
2553 };
2554
2555 +struct fixup_entry {
2556 + int offset;
2557 + struct node *node;
2558 + struct property *prop;
2559 + struct fixup_entry *next;
2560 + bool local_fixup_generated;
2561 +};
2562 +
2563 +struct fixup {
2564 + char *ref;
2565 + struct fixup_entry *entries;
2566 + struct fixup *next;
2567 +};
2568 +
2569 +struct symbol {
2570 + struct label *label;
2571 + struct node *node;
2572 + struct symbol *next;
2573 +};
2574 +
2575 struct property {
2576 bool deleted;
2577 char *name;
2578 @@ -158,6 +179,13 @@ struct node {
2579 int addr_cells, size_cells;
2580
2581 struct label *labels;
2582 +
2583 + struct symbol *symbols;
2584 + struct fixup_entry *local_fixups;
2585 + bool emit_local_fixup_node;
2586 +
2587 + bool is_plugin;
2588 + struct fixup *fixups;
2589 };
2590
2591 #define for_each_label_withdel(l0, l) \
2592 @@ -181,6 +209,18 @@ struct node {
2593 for_each_child_withdel(n, c) \
2594 if (!(c)->deleted)
2595
2596 +#define for_each_fixup(n, f) \
2597 + for ((f) = (n)->fixups; (f); (f) = (f)->next)
2598 +
2599 +#define for_each_fixup_entry(f, fe) \
2600 + for ((fe) = (f)->entries; (fe); (fe) = (fe)->next)
2601 +
2602 +#define for_each_symbol(n, s) \
2603 + for ((s) = (n)->symbols; (s); (s) = (s)->next)
2604 +
2605 +#define for_each_local_fixup_entry(n, fe) \
2606 + for ((fe) = (n)->local_fixups; (fe); (fe) = (fe)->next)
2607 +
2608 void add_label(struct label **labels, char *label);
2609 void delete_labels(struct label **labels);
2610
2611 --- a/scripts/dtc/flattree.c
2612 +++ b/scripts/dtc/flattree.c
2613 @@ -255,6 +255,204 @@ static int stringtable_insert(struct dat
2614 return i;
2615 }
2616
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)
2620 +{
2621 + struct fixup_entry *fe, *fen;
2622 + struct node *child;
2623 + int nameoff, count;
2624 + cell_t *buf;
2625 + struct data d;
2626 +
2627 + if (node->emit_local_fixup_node) {
2628 +
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));
2634 + }
2635 +
2636 + for_each_local_fixup_entry(tree, fe) {
2637 + if (fe->node != node || fe->local_fixup_generated)
2638 + continue;
2639 +
2640 + /* count the number of fixup entries */
2641 + count = 0;
2642 + for_each_local_fixup_entry(tree, fen) {
2643 + if (fen->prop != fe->prop)
2644 + continue;
2645 + fen->local_fixup_generated = true;
2646 + count++;
2647 + }
2648 +
2649 + /* allocate buffer */
2650 + buf = xmalloc(count * sizeof(cell_t));
2651 +
2652 + /* collect all the offsets in buffer */
2653 + count = 0;
2654 + for_each_local_fixup_entry(tree, fen) {
2655 + if (fen->prop != fe->prop)
2656 + continue;
2657 + fen->local_fixup_generated = true;
2658 + buf[count++] = cpu_to_fdt32(fen->offset);
2659 + }
2660 + d = empty_data;
2661 + d.len = count * sizeof(cell_t);
2662 + d.val = (char *)buf;
2663 +
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);
2668 +
2669 + if ((vi->flags & FTF_VARALIGN) &&
2670 + (count * sizeof(cell_t)) >= 8)
2671 + emit->align(etarget, 8);
2672 +
2673 + emit->data(etarget, d);
2674 + emit->align(etarget, sizeof(cell_t));
2675 +
2676 + free(buf);
2677 + }
2678 + }
2679 +
2680 + for_each_child(node, child)
2681 + emit_local_fixups(tree, emit, etarget, strbuf, vi, child);
2682 +
2683 + if (node->emit_local_fixup_node && node != tree)
2684 + emit->endnode(etarget, tree->labels);
2685 +}
2686 +
2687 +static void emit_symbols_node(struct node *tree, struct emitter *emit,
2688 + void *etarget, struct data *strbuf,
2689 + struct version_info *vi)
2690 +{
2691 + struct symbol *sym;
2692 + int nameoff, vallen;
2693 +
2694 + /* do nothing if no symbols */
2695 + if (!tree->symbols)
2696 + return;
2697 +
2698 + emit->beginnode(etarget, NULL);
2699 + emit->string(etarget, "__symbols__", 0);
2700 + emit->align(etarget, sizeof(cell_t));
2701 +
2702 + for_each_symbol(tree, sym) {
2703 +
2704 + vallen = strlen(sym->node->fullpath);
2705 +
2706 + nameoff = stringtable_insert(strbuf, sym->label->label);
2707 +
2708 + emit->property(etarget, NULL);
2709 + emit->cell(etarget, vallen + 1);
2710 + emit->cell(etarget, nameoff);
2711 +
2712 + if ((vi->flags & FTF_VARALIGN) && vallen >= 8)
2713 + emit->align(etarget, 8);
2714 +
2715 + emit->string(etarget, sym->node->fullpath,
2716 + strlen(sym->node->fullpath));
2717 + emit->align(etarget, sizeof(cell_t));
2718 + }
2719 +
2720 + emit->endnode(etarget, NULL);
2721 +}
2722 +
2723 +static void emit_local_fixups_node(struct node *tree, struct emitter *emit,
2724 + void *etarget, struct data *strbuf,
2725 + struct version_info *vi)
2726 +{
2727 + struct fixup_entry *fe;
2728 + struct node *node;
2729 +
2730 + /* do nothing if no local fixups */
2731 + if (!tree->local_fixups)
2732 + return;
2733 +
2734 + /* mark all nodes that need a local fixup generated (and parents) */
2735 + for_each_local_fixup_entry(tree, fe) {
2736 + node = fe->node;
2737 + while (node != NULL && !node->emit_local_fixup_node) {
2738 + node->emit_local_fixup_node = true;
2739 + node = node->parent;
2740 + }
2741 + }
2742 +
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));
2747 +
2748 + emit_local_fixups(tree, emit, etarget, strbuf, vi, tree);
2749 +
2750 + emit->endnode(etarget, tree->labels);
2751 +}
2752 +
2753 +static void emit_fixups_node(struct node *tree, struct emitter *emit,
2754 + void *etarget, struct data *strbuf,
2755 + struct version_info *vi)
2756 +{
2757 + struct fixup *f;
2758 + struct fixup_entry *fe;
2759 + char *name, *s;
2760 + const char *fullpath;
2761 + int namesz, nameoff, vallen;
2762 +
2763 + /* do nothing if no fixups */
2764 + if (!tree->fixups)
2765 + return;
2766 +
2767 + /* emit the external fixups */
2768 + emit->beginnode(etarget, NULL);
2769 + emit->string(etarget, "__fixups__", 0);
2770 + emit->align(etarget, sizeof(cell_t));
2771 +
2772 + for_each_fixup(tree, f) {
2773 +
2774 + namesz = 0;
2775 + for_each_fixup_entry(f, fe) {
2776 + fullpath = fe->node->fullpath;
2777 + if (fullpath[0] == '\0')
2778 + fullpath = "/";
2779 + namesz += strlen(fullpath) + 1;
2780 + namesz += strlen(fe->prop->name) + 1;
2781 + namesz += 32; /* space for :<number> + '\0' */
2782 + }
2783 +
2784 + name = xmalloc(namesz);
2785 +
2786 + s = name;
2787 + for_each_fixup_entry(f, fe) {
2788 + fullpath = fe->node->fullpath;
2789 + if (fullpath[0] == '\0')
2790 + fullpath = "/";
2791 + snprintf(s, name + namesz - s, "%s:%s:%d", fullpath,
2792 + fe->prop->name, fe->offset);
2793 + s += strlen(s) + 1;
2794 + }
2795 +
2796 + nameoff = stringtable_insert(strbuf, f->ref);
2797 + vallen = s - name - 1;
2798 +
2799 + emit->property(etarget, NULL);
2800 + emit->cell(etarget, vallen + 1);
2801 + emit->cell(etarget, nameoff);
2802 +
2803 + if ((vi->flags & FTF_VARALIGN) && vallen >= 8)
2804 + emit->align(etarget, 8);
2805 +
2806 + emit->string(etarget, name, vallen);
2807 + emit->align(etarget, sizeof(cell_t));
2808 +
2809 + free(name);
2810 + }
2811 +
2812 + emit->endnode(etarget, tree->labels);
2813 +}
2814 +
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);
2820 }
2821
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);
2825 +
2826 emit->endnode(etarget, tree->labels);
2827 }
2828
2829 --- a/scripts/dtc/version_gen.h
2830 +++ b/scripts/dtc/version_gen.h
2831 @@ -1 +1 @@
2832 -#define DTC_VERSION "DTC 1.4.1-g53bf130b"
2833 +#define DTC_VERSION "DTC 1.4.1-g25efc119"