brcm2708: update linux 4.4 patches to latest version
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0176-scripts-dtc-Update-to-upstream-version-1.4.1.patch
1 From 0b65cac4de4a82ca44fdb9e1a448efa8e7d4c939 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/checks.c | 105 ++++-
11 scripts/dtc/dtc-lexer.l | 5 +
12 scripts/dtc/dtc-lexer.lex.c_shipped | 490 ++++++++++++------------
13 scripts/dtc/dtc-parser.tab.c_shipped | 722 ++++++++++++++++++-----------------
14 scripts/dtc/dtc-parser.tab.h_shipped | 46 +--
15 scripts/dtc/dtc-parser.y | 22 +-
16 scripts/dtc/dtc.c | 9 +-
17 scripts/dtc/dtc.h | 40 ++
18 scripts/dtc/flattree.c | 202 ++++++++++
19 scripts/dtc/version_gen.h | 2 +-
20 10 files changed, 1021 insertions(+), 622 deletions(-)
21
22 --- a/scripts/dtc/checks.c
23 +++ b/scripts/dtc/checks.c
24 @@ -458,6 +458,8 @@ static void fixup_phandle_references(str
25 struct node *node, struct property *prop)
26 {
27 struct marker *m = prop->val.markers;
28 + struct fixup *f, **fp;
29 + struct fixup_entry *fe, **fep;
30 struct node *refnode;
31 cell_t phandle;
32
33 @@ -466,11 +468,69 @@ static void fixup_phandle_references(str
34
35 refnode = get_node_by_ref(dt, m->ref);
36 if (! refnode) {
37 - FAIL(c, "Reference to non-existent node or label \"%s\"\n",
38 - m->ref);
39 + if (!dt->is_plugin) {
40 + FAIL(c, "Reference to non-existent node or label \"%s\"\n",
41 + m->ref);
42 + continue;
43 + }
44 +
45 + /* allocate fixup entry */
46 + fe = xmalloc(sizeof(*fe));
47 +
48 + fe->node = node;
49 + fe->prop = prop;
50 + fe->offset = m->offset;
51 + fe->next = NULL;
52 +
53 + /* search for an already existing fixup */
54 + for_each_fixup(dt, f)
55 + if (strcmp(f->ref, m->ref) == 0)
56 + break;
57 +
58 + /* no fixup found, add new */
59 + if (f == NULL) {
60 + f = xmalloc(sizeof(*f));
61 + f->ref = m->ref;
62 + f->entries = NULL;
63 + f->next = NULL;
64 +
65 + /* add it to the tree */
66 + fp = &dt->fixups;
67 + while (*fp)
68 + fp = &(*fp)->next;
69 + *fp = f;
70 + }
71 +
72 + /* and now append fixup entry */
73 + fep = &f->entries;
74 + while (*fep)
75 + fep = &(*fep)->next;
76 + *fep = fe;
77 +
78 + /* mark the entry as unresolved */
79 + *((cell_t *)(prop->val.val + m->offset)) =
80 + cpu_to_fdt32(0xdeadbeef);
81 continue;
82 }
83
84 + /* if it's a local reference, we need to record it */
85 + if (symbol_fixup_support) {
86 +
87 + /* allocate a new local fixup entry */
88 + fe = xmalloc(sizeof(*fe));
89 +
90 + fe->node = node;
91 + fe->prop = prop;
92 + fe->offset = m->offset;
93 + fe->next = NULL;
94 +
95 + /* append it to the local fixups */
96 + fep = &dt->local_fixups;
97 + while (*fep)
98 + fep = &(*fep)->next;
99 + *fep = fe;
100 + }
101 +
102 phandle = get_node_phandle(dt, refnode);
103 *((cell_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle);
104 }
105 @@ -652,6 +712,45 @@ static void check_obsolete_chosen_interr
106 }
107 TREE_WARNING(obsolete_chosen_interrupt_controller, NULL);
108
109 +static void check_auto_label_phandles(struct check *c, struct node *dt,
110 + struct node *node)
111 +{
112 + struct label *l;
113 + struct symbol *s, **sp;
114 + int has_label;
115 +
116 + if (!symbol_fixup_support)
117 + return;
118 +
119 + has_label = 0;
120 + for_each_label(node->labels, l) {
121 + has_label = 1;
122 + break;
123 + }
124 +
125 + if (!has_label)
126 + return;
127 +
128 + /* force allocation of a phandle for this node */
129 + (void)get_node_phandle(dt, node);
130 +
131 + /* add the symbol */
132 + for_each_label(node->labels, l) {
133 +
134 + s = xmalloc(sizeof(*s));
135 + s->label = l;
136 + s->node = node;
137 + s->next = NULL;
138 +
139 + /* add it to the symbols list */
140 + sp = &dt->symbols;
141 + while (*sp)
142 + sp = &((*sp)->next);
143 + *sp = s;
144 + }
145 +}
146 +NODE_WARNING(auto_label_phandles, NULL);
147 +
148 static struct check *check_table[] = {
149 &duplicate_node_names, &duplicate_property_names,
150 &node_name_chars, &node_name_format, &property_name_chars,
151 @@ -670,6 +769,8 @@ static struct check *check_table[] = {
152 &avoid_default_addr_size,
153 &obsolete_chosen_interrupt_controller,
154
155 + &auto_label_phandles,
156 +
157 &always_fail,
158 };
159
160 --- a/scripts/dtc/dtc-lexer.l
161 +++ b/scripts/dtc/dtc-lexer.l
162 @@ -113,6 +113,11 @@ static void lexical_error(const char *fm
163 return DT_V1;
164 }
165
166 +<*>"/plugin/" {
167 + DPRINT("Keyword: /plugin/\n");
168 + return DT_PLUGIN;
169 + }
170 +
171 <*>"/memreserve/" {
172 DPRINT("Keyword: /memreserve/\n");
173 BEGIN_DEFAULT();
174 --- a/scripts/dtc/dtc-lexer.lex.c_shipped
175 +++ b/scripts/dtc/dtc-lexer.lex.c_shipped
176 @@ -9,7 +9,7 @@
177 #define FLEX_SCANNER
178 #define YY_FLEX_MAJOR_VERSION 2
179 #define YY_FLEX_MINOR_VERSION 5
180 -#define YY_FLEX_SUBMINOR_VERSION 39
181 +#define YY_FLEX_SUBMINOR_VERSION 35
182 #if YY_FLEX_SUBMINOR_VERSION > 0
183 #define FLEX_BETA
184 #endif
185 @@ -162,12 +162,7 @@ typedef unsigned int flex_uint32_t;
186 typedef struct yy_buffer_state *YY_BUFFER_STATE;
187 #endif
188
189 -#ifndef YY_TYPEDEF_YY_SIZE_T
190 -#define YY_TYPEDEF_YY_SIZE_T
191 -typedef size_t yy_size_t;
192 -#endif
193 -
194 -extern yy_size_t yyleng;
195 +extern int yyleng;
196
197 extern FILE *yyin, *yyout;
198
199 @@ -176,7 +171,6 @@ extern FILE *yyin, *yyout;
200 #define EOB_ACT_LAST_MATCH 2
201
202 #define YY_LESS_LINENO(n)
203 - #define YY_LINENO_REWIND_TO(ptr)
204
205 /* Return all but the first "n" matched characters back to the input stream. */
206 #define yyless(n) \
207 @@ -194,6 +188,11 @@ extern FILE *yyin, *yyout;
208
209 #define unput(c) yyunput( c, (yytext_ptr) )
210
211 +#ifndef YY_TYPEDEF_YY_SIZE_T
212 +#define YY_TYPEDEF_YY_SIZE_T
213 +typedef size_t yy_size_t;
214 +#endif
215 +
216 #ifndef YY_STRUCT_YY_BUFFER_STATE
217 #define YY_STRUCT_YY_BUFFER_STATE
218 struct yy_buffer_state
219 @@ -211,7 +210,7 @@ struct yy_buffer_state
220 /* Number of characters read into yy_ch_buf, not including EOB
221 * characters.
222 */
223 - yy_size_t yy_n_chars;
224 + int yy_n_chars;
225
226 /* Whether we "own" the buffer - i.e., we know we created it,
227 * and can realloc() it to grow it, and should free() it to
228 @@ -281,8 +280,8 @@ static YY_BUFFER_STATE * yy_buffer_stack
229
230 /* yy_hold_char holds the character lost when yytext is formed. */
231 static char yy_hold_char;
232 -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
233 -yy_size_t yyleng;
234 +static int yy_n_chars; /* number of characters read into yy_ch_buf */
235 +int yyleng;
236
237 /* Points to current character in buffer. */
238 static char *yy_c_buf_p = (char *) 0;
239 @@ -310,7 +309,7 @@ static void yy_init_buffer (YY_BUFFER_ST
240
241 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
242 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
243 -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
244 +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
245
246 void *yyalloc (yy_size_t );
247 void *yyrealloc (void *,yy_size_t );
248 @@ -342,7 +341,7 @@ void yyfree (void * );
249
250 /* Begin user sect3 */
251
252 -#define yywrap() 1
253 +#define yywrap(n) 1
254 #define YY_SKIP_YYWRAP
255
256 typedef unsigned char YY_CHAR;
257 @@ -373,8 +372,8 @@ static void yy_fatal_error (yyconst char
258 *yy_cp = '\0'; \
259 (yy_c_buf_p) = yy_cp;
260
261 -#define YY_NUM_RULES 30
262 -#define YY_END_OF_BUFFER 31
263 +#define YY_NUM_RULES 31
264 +#define YY_END_OF_BUFFER 32
265 /* This struct is not used in this scanner,
266 but its presence is necessary. */
267 struct yy_trans_info
268 @@ -382,25 +381,26 @@ struct yy_trans_info
269 flex_int32_t yy_verify;
270 flex_int32_t yy_nxt;
271 };
272 -static yyconst flex_int16_t yy_accept[159] =
273 +static yyconst flex_int16_t yy_accept[166] =
274 { 0,
275 - 0, 0, 0, 0, 0, 0, 0, 0, 31, 29,
276 - 18, 18, 29, 29, 29, 29, 29, 29, 29, 29,
277 - 29, 29, 29, 29, 29, 29, 15, 16, 16, 29,
278 - 16, 10, 10, 18, 26, 0, 3, 0, 27, 12,
279 - 0, 0, 11, 0, 0, 0, 0, 0, 0, 0,
280 - 21, 23, 25, 24, 22, 0, 9, 28, 0, 0,
281 - 0, 14, 14, 16, 16, 16, 10, 10, 10, 0,
282 - 12, 0, 11, 0, 0, 0, 20, 0, 0, 0,
283 - 0, 0, 0, 0, 0, 16, 10, 10, 10, 0,
284 - 13, 19, 0, 0, 0, 0, 0, 0, 0, 0,
285 -
286 - 0, 16, 0, 0, 0, 0, 0, 0, 0, 0,
287 - 0, 16, 6, 0, 0, 0, 0, 0, 0, 2,
288 - 0, 0, 0, 0, 0, 0, 0, 0, 4, 17,
289 - 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
290 - 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
291 - 5, 8, 0, 0, 0, 0, 7, 0
292 + 0, 0, 0, 0, 0, 0, 0, 0, 32, 30,
293 + 19, 19, 30, 30, 30, 30, 30, 30, 30, 30,
294 + 30, 30, 30, 30, 30, 30, 16, 17, 17, 30,
295 + 17, 11, 11, 19, 27, 0, 3, 0, 28, 13,
296 + 0, 0, 12, 0, 0, 0, 0, 0, 0, 0,
297 + 0, 22, 24, 26, 25, 23, 0, 10, 29, 0,
298 + 0, 0, 15, 15, 17, 17, 17, 11, 11, 11,
299 + 0, 13, 0, 12, 0, 0, 0, 21, 0, 0,
300 + 0, 0, 0, 0, 0, 0, 0, 17, 11, 11,
301 + 11, 0, 14, 20, 0, 0, 0, 0, 0, 0,
302 +
303 + 0, 0, 0, 0, 17, 0, 0, 0, 0, 0,
304 + 0, 0, 0, 0, 0, 17, 7, 0, 0, 0,
305 + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
306 + 0, 0, 0, 0, 4, 18, 0, 0, 5, 2,
307 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
308 + 0, 0, 1, 0, 0, 0, 0, 6, 9, 0,
309 + 0, 0, 0, 8, 0
310 } ;
311
312 static yyconst flex_int32_t yy_ec[256] =
313 @@ -416,9 +416,9 @@ static yyconst flex_int32_t yy_ec[256] =
314 22, 22, 22, 22, 24, 22, 22, 25, 22, 22,
315 1, 26, 27, 1, 22, 1, 21, 28, 29, 30,
316
317 - 31, 21, 22, 22, 32, 22, 22, 33, 34, 35,
318 - 36, 37, 22, 38, 39, 40, 41, 42, 22, 25,
319 - 43, 22, 44, 45, 46, 1, 1, 1, 1, 1,
320 + 31, 21, 32, 22, 33, 22, 22, 34, 35, 36,
321 + 37, 38, 22, 39, 40, 41, 42, 43, 22, 25,
322 + 44, 22, 45, 46, 47, 1, 1, 1, 1, 1,
323 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
324 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
325 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
326 @@ -435,163 +435,165 @@ static yyconst flex_int32_t yy_ec[256] =
327 1, 1, 1, 1, 1
328 } ;
329
330 -static yyconst flex_int32_t yy_meta[47] =
331 +static yyconst flex_int32_t yy_meta[48] =
332 { 0,
333 1, 1, 1, 1, 1, 1, 2, 3, 1, 2,
334 2, 2, 4, 5, 5, 5, 6, 1, 1, 1,
335 7, 8, 8, 8, 8, 1, 1, 7, 7, 7,
336 7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
337 - 8, 8, 8, 3, 1, 4
338 + 8, 8, 8, 8, 3, 1, 4
339 } ;
340
341 -static yyconst flex_int16_t yy_base[173] =
342 +static yyconst flex_int16_t yy_base[180] =
343 { 0,
344 - 0, 383, 34, 382, 65, 381, 37, 105, 387, 391,
345 - 54, 111, 367, 110, 109, 109, 112, 41, 366, 104,
346 - 367, 338, 124, 117, 0, 144, 391, 0, 121, 0,
347 - 135, 155, 140, 179, 391, 160, 391, 379, 391, 0,
348 - 368, 141, 391, 167, 370, 376, 346, 103, 342, 345,
349 - 391, 391, 391, 391, 391, 358, 391, 391, 175, 342,
350 - 338, 391, 355, 0, 185, 339, 184, 347, 346, 0,
351 - 0, 322, 175, 357, 175, 363, 352, 324, 330, 323,
352 - 332, 326, 201, 324, 329, 322, 391, 333, 181, 309,
353 - 391, 341, 340, 313, 320, 338, 178, 311, 146, 317,
354 -
355 - 314, 315, 335, 331, 303, 300, 309, 299, 308, 188,
356 - 336, 335, 391, 305, 320, 281, 283, 271, 203, 288,
357 - 281, 271, 266, 264, 245, 242, 208, 104, 391, 391,
358 - 244, 218, 204, 219, 206, 224, 201, 212, 204, 229,
359 - 215, 208, 207, 200, 219, 391, 233, 221, 200, 181,
360 - 391, 391, 149, 122, 86, 41, 391, 391, 245, 251,
361 - 259, 263, 267, 273, 280, 284, 292, 300, 304, 310,
362 - 318, 326
363 + 0, 393, 35, 392, 66, 391, 38, 107, 397, 401,
364 + 55, 113, 377, 112, 111, 111, 114, 42, 376, 106,
365 + 377, 347, 126, 120, 0, 147, 401, 0, 124, 0,
366 + 137, 158, 170, 163, 401, 153, 401, 389, 401, 0,
367 + 378, 120, 401, 131, 380, 386, 355, 139, 351, 355,
368 + 351, 401, 401, 401, 401, 401, 367, 401, 401, 185,
369 + 350, 346, 401, 364, 0, 185, 347, 189, 356, 355,
370 + 0, 0, 330, 180, 366, 141, 372, 361, 332, 338,
371 + 331, 341, 334, 326, 205, 331, 337, 329, 401, 341,
372 + 167, 316, 401, 349, 348, 320, 328, 346, 180, 318,
373 +
374 + 324, 209, 324, 320, 322, 342, 338, 309, 306, 315,
375 + 305, 315, 312, 192, 342, 341, 401, 293, 306, 282,
376 + 268, 252, 255, 203, 285, 282, 272, 268, 252, 233,
377 + 232, 239, 208, 107, 401, 401, 238, 211, 401, 211,
378 + 212, 208, 228, 203, 215, 207, 233, 222, 212, 211,
379 + 203, 227, 401, 237, 225, 204, 185, 401, 401, 149,
380 + 128, 88, 42, 401, 401, 253, 259, 267, 271, 275,
381 + 281, 288, 292, 300, 308, 312, 318, 326, 334
382 } ;
383
384 -static yyconst flex_int16_t yy_def[173] =
385 +static yyconst flex_int16_t yy_def[180] =
386 { 0,
387 - 158, 1, 1, 3, 158, 5, 1, 1, 158, 158,
388 - 158, 158, 158, 159, 160, 161, 158, 158, 158, 158,
389 - 162, 158, 158, 158, 163, 162, 158, 164, 165, 164,
390 - 164, 158, 158, 158, 158, 159, 158, 159, 158, 166,
391 - 158, 161, 158, 161, 167, 168, 158, 158, 158, 158,
392 - 158, 158, 158, 158, 158, 162, 158, 158, 158, 158,
393 - 158, 158, 162, 164, 165, 164, 158, 158, 158, 169,
394 - 166, 170, 161, 167, 167, 168, 158, 158, 158, 158,
395 - 158, 158, 158, 158, 158, 164, 158, 158, 169, 170,
396 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
397 -
398 - 158, 164, 158, 158, 158, 158, 158, 158, 158, 171,
399 - 158, 164, 158, 158, 158, 158, 158, 158, 171, 158,
400 - 171, 158, 158, 158, 158, 158, 158, 158, 158, 158,
401 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
402 - 172, 158, 158, 158, 172, 158, 172, 158, 158, 158,
403 - 158, 158, 158, 158, 158, 158, 158, 0, 158, 158,
404 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
405 - 158, 158
406 + 165, 1, 1, 3, 165, 5, 1, 1, 165, 165,
407 + 165, 165, 165, 166, 167, 168, 165, 165, 165, 165,
408 + 169, 165, 165, 165, 170, 169, 165, 171, 172, 171,
409 + 171, 165, 165, 165, 165, 166, 165, 166, 165, 173,
410 + 165, 168, 165, 168, 174, 175, 165, 165, 165, 165,
411 + 165, 165, 165, 165, 165, 165, 169, 165, 165, 165,
412 + 165, 165, 165, 169, 171, 172, 171, 165, 165, 165,
413 + 176, 173, 177, 168, 174, 174, 175, 165, 165, 165,
414 + 165, 165, 165, 165, 165, 165, 165, 171, 165, 165,
415 + 176, 177, 165, 165, 165, 165, 165, 165, 165, 165,
416 +
417 + 165, 165, 165, 165, 171, 165, 165, 165, 165, 165,
418 + 165, 165, 165, 178, 165, 171, 165, 165, 165, 165,
419 + 165, 165, 165, 178, 165, 178, 165, 165, 165, 165,
420 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
421 + 165, 165, 165, 165, 165, 165, 165, 179, 165, 165,
422 + 165, 179, 165, 179, 165, 165, 165, 165, 165, 165,
423 + 165, 165, 165, 165, 0, 165, 165, 165, 165, 165,
424 + 165, 165, 165, 165, 165, 165, 165, 165, 165
425 } ;
426
427 -static yyconst flex_int16_t yy_nxt[438] =
428 +static yyconst flex_int16_t yy_nxt[449] =
429 { 0,
430 10, 11, 12, 11, 13, 14, 10, 15, 16, 10,
431 10, 10, 17, 10, 10, 10, 10, 18, 19, 20,
432 21, 21, 21, 21, 21, 10, 10, 21, 21, 21,
433 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
434 - 21, 21, 21, 10, 22, 10, 24, 25, 25, 25,
435 - 32, 33, 33, 157, 26, 34, 34, 34, 51, 52,
436 - 27, 26, 26, 26, 26, 10, 11, 12, 11, 13,
437 - 14, 28, 15, 16, 28, 28, 28, 24, 28, 28,
438 - 28, 10, 18, 19, 20, 29, 29, 29, 29, 29,
439 - 30, 10, 29, 29, 29, 29, 29, 29, 29, 29,
440 -
441 - 29, 29, 29, 29, 29, 29, 29, 29, 10, 22,
442 - 10, 23, 34, 34, 34, 37, 39, 43, 32, 33,
443 - 33, 45, 54, 55, 46, 59, 45, 64, 156, 46,
444 - 64, 64, 64, 79, 44, 38, 59, 57, 134, 47,
445 - 135, 48, 80, 49, 47, 50, 48, 99, 61, 43,
446 - 50, 110, 41, 67, 67, 67, 60, 63, 63, 63,
447 - 57, 155, 68, 69, 63, 37, 44, 66, 67, 67,
448 - 67, 63, 63, 63, 63, 73, 59, 68, 69, 70,
449 - 34, 34, 34, 43, 75, 38, 154, 92, 83, 83,
450 - 83, 64, 44, 120, 64, 64, 64, 67, 67, 67,
451 -
452 - 44, 57, 99, 68, 69, 107, 68, 69, 120, 127,
453 - 108, 153, 152, 121, 83, 83, 83, 133, 133, 133,
454 - 146, 133, 133, 133, 146, 140, 140, 140, 121, 141,
455 - 140, 140, 140, 151, 141, 158, 150, 149, 148, 144,
456 - 147, 143, 142, 139, 147, 36, 36, 36, 36, 36,
457 - 36, 36, 36, 40, 138, 137, 136, 40, 40, 42,
458 - 42, 42, 42, 42, 42, 42, 42, 56, 56, 56,
459 - 56, 62, 132, 62, 64, 131, 130, 64, 129, 64,
460 - 64, 65, 128, 158, 65, 65, 65, 65, 71, 127,
461 - 71, 71, 74, 74, 74, 74, 74, 74, 74, 74,
462 -
463 - 76, 76, 76, 76, 76, 76, 76, 76, 89, 126,
464 - 89, 90, 125, 90, 90, 124, 90, 90, 119, 119,
465 - 119, 119, 119, 119, 119, 119, 145, 145, 145, 145,
466 - 145, 145, 145, 145, 123, 122, 59, 59, 118, 117,
467 - 116, 115, 114, 113, 45, 112, 108, 111, 109, 106,
468 - 105, 104, 46, 103, 91, 87, 102, 101, 100, 98,
469 - 97, 96, 95, 94, 93, 77, 75, 91, 88, 87,
470 - 86, 57, 85, 84, 57, 82, 81, 78, 77, 75,
471 - 72, 158, 58, 57, 53, 35, 158, 31, 23, 23,
472 - 9, 158, 158, 158, 158, 158, 158, 158, 158, 158,
473 -
474 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
475 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
476 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
477 - 158, 158, 158, 158, 158, 158, 158
478 + 21, 21, 21, 21, 10, 22, 10, 24, 25, 25,
479 + 25, 32, 33, 33, 164, 26, 34, 34, 34, 52,
480 + 53, 27, 26, 26, 26, 26, 10, 11, 12, 11,
481 + 13, 14, 28, 15, 16, 28, 28, 28, 24, 28,
482 + 28, 28, 10, 18, 19, 20, 29, 29, 29, 29,
483 + 29, 30, 10, 29, 29, 29, 29, 29, 29, 29,
484 +
485 + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
486 + 10, 22, 10, 23, 34, 34, 34, 37, 39, 43,
487 + 32, 33, 33, 45, 55, 56, 46, 60, 43, 45,
488 + 65, 163, 46, 65, 65, 65, 44, 38, 60, 74,
489 + 58, 47, 141, 48, 142, 44, 49, 47, 50, 48,
490 + 76, 51, 62, 94, 50, 41, 44, 51, 37, 61,
491 + 64, 64, 64, 58, 34, 34, 34, 64, 162, 80,
492 + 67, 68, 68, 68, 64, 64, 64, 64, 38, 81,
493 + 69, 70, 71, 68, 68, 68, 60, 161, 43, 69,
494 + 70, 65, 69, 70, 65, 65, 65, 125, 85, 85,
495 +
496 + 85, 58, 68, 68, 68, 44, 102, 110, 125, 133,
497 + 102, 69, 70, 111, 114, 160, 159, 126, 85, 85,
498 + 85, 140, 140, 140, 140, 140, 140, 153, 126, 147,
499 + 147, 147, 153, 148, 147, 147, 147, 158, 148, 165,
500 + 157, 156, 155, 151, 150, 149, 146, 154, 145, 144,
501 + 143, 139, 154, 36, 36, 36, 36, 36, 36, 36,
502 + 36, 40, 138, 137, 136, 40, 40, 42, 42, 42,
503 + 42, 42, 42, 42, 42, 57, 57, 57, 57, 63,
504 + 135, 63, 65, 134, 165, 65, 133, 65, 65, 66,
505 + 132, 131, 66, 66, 66, 66, 72, 130, 72, 72,
506 +
507 + 75, 75, 75, 75, 75, 75, 75, 75, 77, 77,
508 + 77, 77, 77, 77, 77, 77, 91, 129, 91, 92,
509 + 128, 92, 92, 127, 92, 92, 124, 124, 124, 124,
510 + 124, 124, 124, 124, 152, 152, 152, 152, 152, 152,
511 + 152, 152, 60, 60, 123, 122, 121, 120, 119, 118,
512 + 117, 45, 116, 111, 115, 113, 112, 109, 108, 107,
513 + 46, 106, 93, 89, 105, 104, 103, 101, 100, 99,
514 + 98, 97, 96, 95, 78, 76, 93, 90, 89, 88,
515 + 58, 87, 86, 58, 84, 83, 82, 79, 78, 76,
516 + 73, 165, 59, 58, 54, 35, 165, 31, 23, 23,
517 +
518 + 9, 165, 165, 165, 165, 165, 165, 165, 165, 165,
519 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
520 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
521 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
522 + 165, 165, 165, 165, 165, 165, 165, 165
523 } ;
524
525 -static yyconst flex_int16_t yy_chk[438] =
526 +static yyconst flex_int16_t yy_chk[449] =
527 { 0,
528 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
529 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
530 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
531 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
532 - 1, 1, 1, 1, 1, 1, 3, 3, 3, 3,
533 - 7, 7, 7, 156, 3, 11, 11, 11, 18, 18,
534 - 3, 3, 3, 3, 3, 5, 5, 5, 5, 5,
535 + 1, 1, 1, 1, 1, 1, 1, 3, 3, 3,
536 + 3, 7, 7, 7, 163, 3, 11, 11, 11, 18,
537 + 18, 3, 3, 3, 3, 3, 5, 5, 5, 5,
538 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
539 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
540 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
541
542 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
543 - 5, 8, 12, 12, 12, 14, 15, 16, 8, 8,
544 - 8, 17, 20, 20, 17, 23, 24, 29, 155, 24,
545 - 29, 29, 29, 48, 16, 14, 31, 29, 128, 17,
546 - 128, 17, 48, 17, 24, 17, 24, 99, 24, 42,
547 - 24, 99, 15, 33, 33, 33, 23, 26, 26, 26,
548 - 26, 154, 33, 33, 26, 36, 42, 31, 32, 32,
549 - 32, 26, 26, 26, 26, 44, 59, 32, 32, 32,
550 - 34, 34, 34, 73, 75, 36, 153, 75, 59, 59,
551 - 59, 65, 44, 110, 65, 65, 65, 67, 67, 67,
552 -
553 - 73, 65, 83, 89, 89, 97, 67, 67, 119, 127,
554 - 97, 150, 149, 110, 83, 83, 83, 133, 133, 133,
555 - 141, 127, 127, 127, 145, 136, 136, 136, 119, 136,
556 - 140, 140, 140, 148, 140, 147, 144, 143, 142, 139,
557 - 141, 138, 137, 135, 145, 159, 159, 159, 159, 159,
558 - 159, 159, 159, 160, 134, 132, 131, 160, 160, 161,
559 - 161, 161, 161, 161, 161, 161, 161, 162, 162, 162,
560 - 162, 163, 126, 163, 164, 125, 124, 164, 123, 164,
561 - 164, 165, 122, 121, 165, 165, 165, 165, 166, 120,
562 - 166, 166, 167, 167, 167, 167, 167, 167, 167, 167,
563 -
564 - 168, 168, 168, 168, 168, 168, 168, 168, 169, 118,
565 - 169, 170, 117, 170, 170, 116, 170, 170, 171, 171,
566 - 171, 171, 171, 171, 171, 171, 172, 172, 172, 172,
567 - 172, 172, 172, 172, 115, 114, 112, 111, 109, 108,
568 - 107, 106, 105, 104, 103, 102, 101, 100, 98, 96,
569 - 95, 94, 93, 92, 90, 88, 86, 85, 84, 82,
570 - 81, 80, 79, 78, 77, 76, 74, 72, 69, 68,
571 - 66, 63, 61, 60, 56, 50, 49, 47, 46, 45,
572 + 5, 5, 5, 8, 12, 12, 12, 14, 15, 16,
573 + 8, 8, 8, 17, 20, 20, 17, 23, 42, 24,
574 + 29, 162, 24, 29, 29, 29, 16, 14, 31, 44,
575 + 29, 17, 134, 17, 134, 42, 17, 24, 17, 24,
576 + 76, 17, 24, 76, 24, 15, 44, 24, 36, 23,
577 + 26, 26, 26, 26, 34, 34, 34, 26, 161, 48,
578 + 31, 32, 32, 32, 26, 26, 26, 26, 36, 48,
579 + 32, 32, 32, 33, 33, 33, 60, 160, 74, 91,
580 + 91, 66, 33, 33, 66, 66, 66, 114, 60, 60,
581 +
582 + 60, 66, 68, 68, 68, 74, 85, 99, 124, 133,
583 + 102, 68, 68, 99, 102, 157, 156, 114, 85, 85,
584 + 85, 133, 133, 133, 140, 140, 140, 148, 124, 143,
585 + 143, 143, 152, 143, 147, 147, 147, 155, 147, 154,
586 + 151, 150, 149, 146, 145, 144, 142, 148, 141, 138,
587 + 137, 132, 152, 166, 166, 166, 166, 166, 166, 166,
588 + 166, 167, 131, 130, 129, 167, 167, 168, 168, 168,
589 + 168, 168, 168, 168, 168, 169, 169, 169, 169, 170,
590 + 128, 170, 171, 127, 126, 171, 125, 171, 171, 172,
591 + 123, 122, 172, 172, 172, 172, 173, 121, 173, 173,
592 +
593 + 174, 174, 174, 174, 174, 174, 174, 174, 175, 175,
594 + 175, 175, 175, 175, 175, 175, 176, 120, 176, 177,
595 + 119, 177, 177, 118, 177, 177, 178, 178, 178, 178,
596 + 178, 178, 178, 178, 179, 179, 179, 179, 179, 179,
597 + 179, 179, 116, 115, 113, 112, 111, 110, 109, 108,
598 + 107, 106, 105, 104, 103, 101, 100, 98, 97, 96,
599 + 95, 94, 92, 90, 88, 87, 86, 84, 83, 82,
600 + 81, 80, 79, 78, 77, 75, 73, 70, 69, 67,
601 + 64, 62, 61, 57, 51, 50, 49, 47, 46, 45,
602 41, 38, 22, 21, 19, 13, 9, 6, 4, 2,
603 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
604
605 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
606 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
607 - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
608 - 158, 158, 158, 158, 158, 158, 158
609 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
610 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
611 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
612 + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
613 + 165, 165, 165, 165, 165, 165, 165, 165
614 } ;
615
616 static yy_state_type yy_last_accepting_state;
617 @@ -662,7 +664,7 @@ static int dts_version = 1;
618 static void push_input_file(const char *filename);
619 static bool pop_input_file(void);
620 static void lexical_error(const char *fmt, ...);
621 -#line 666 "dtc-lexer.lex.c"
622 +#line 668 "dtc-lexer.lex.c"
623
624 #define INITIAL 0
625 #define BYTESTRING 1
626 @@ -704,7 +706,7 @@ FILE *yyget_out (void );
627
628 void yyset_out (FILE * out_str );
629
630 -yy_size_t yyget_leng (void );
631 +int yyget_leng (void );
632
633 char *yyget_text (void );
634
635 @@ -853,6 +855,10 @@ YY_DECL
636 register char *yy_cp, *yy_bp;
637 register int yy_act;
638
639 +#line 68 "dtc-lexer.l"
640 +
641 +#line 861 "dtc-lexer.lex.c"
642 +
643 if ( !(yy_init) )
644 {
645 (yy_init) = 1;
646 @@ -879,11 +885,6 @@ YY_DECL
647 yy_load_buffer_state( );
648 }
649
650 - {
651 -#line 68 "dtc-lexer.l"
652 -
653 -#line 886 "dtc-lexer.lex.c"
654 -
655 while ( 1 ) /* loops until end-of-file is reached */
656 {
657 yy_cp = (yy_c_buf_p);
658 @@ -901,7 +902,7 @@ YY_DECL
659 yy_match:
660 do
661 {
662 - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
663 + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
664 if ( yy_accept[yy_current_state] )
665 {
666 (yy_last_accepting_state) = yy_current_state;
667 @@ -910,13 +911,13 @@ yy_match:
668 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
669 {
670 yy_current_state = (int) yy_def[yy_current_state];
671 - if ( yy_current_state >= 159 )
672 + if ( yy_current_state >= 166 )
673 yy_c = yy_meta[(unsigned int) yy_c];
674 }
675 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
676 ++yy_cp;
677 }
678 - while ( yy_current_state != 158 );
679 + while ( yy_current_state != 165 );
680 yy_cp = (yy_last_accepting_cpos);
681 yy_current_state = (yy_last_accepting_state);
682
683 @@ -1007,23 +1008,31 @@ case 5:
684 YY_RULE_SETUP
685 #line 116 "dtc-lexer.l"
686 {
687 + DPRINT("Keyword: /plugin/\n");
688 + return DT_PLUGIN;
689 + }
690 + YY_BREAK
691 +case 6:
692 +YY_RULE_SETUP
693 +#line 121 "dtc-lexer.l"
694 +{
695 DPRINT("Keyword: /memreserve/\n");
696 BEGIN_DEFAULT();
697 return DT_MEMRESERVE;
698 }
699 YY_BREAK
700 -case 6:
701 +case 7:
702 YY_RULE_SETUP
703 -#line 122 "dtc-lexer.l"
704 +#line 127 "dtc-lexer.l"
705 {
706 DPRINT("Keyword: /bits/\n");
707 BEGIN_DEFAULT();
708 return DT_BITS;
709 }
710 YY_BREAK
711 -case 7:
712 +case 8:
713 YY_RULE_SETUP
714 -#line 128 "dtc-lexer.l"
715 +#line 133 "dtc-lexer.l"
716 {
717 DPRINT("Keyword: /delete-property/\n");
718 DPRINT("<PROPNODENAME>\n");
719 @@ -1031,9 +1040,9 @@ YY_RULE_SETUP
720 return DT_DEL_PROP;
721 }
722 YY_BREAK
723 -case 8:
724 +case 9:
725 YY_RULE_SETUP
726 -#line 135 "dtc-lexer.l"
727 +#line 140 "dtc-lexer.l"
728 {
729 DPRINT("Keyword: /delete-node/\n");
730 DPRINT("<PROPNODENAME>\n");
731 @@ -1041,9 +1050,9 @@ YY_RULE_SETUP
732 return DT_DEL_NODE;
733 }
734 YY_BREAK
735 -case 9:
736 +case 10:
737 YY_RULE_SETUP
738 -#line 142 "dtc-lexer.l"
739 +#line 147 "dtc-lexer.l"
740 {
741 DPRINT("Label: %s\n", yytext);
742 yylval.labelref = xstrdup(yytext);
743 @@ -1051,9 +1060,9 @@ YY_RULE_SETUP
744 return DT_LABEL;
745 }
746 YY_BREAK
747 -case 10:
748 +case 11:
749 YY_RULE_SETUP
750 -#line 149 "dtc-lexer.l"
751 +#line 154 "dtc-lexer.l"
752 {
753 char *e;
754 DPRINT("Integer Literal: '%s'\n", yytext);
755 @@ -1073,10 +1082,10 @@ YY_RULE_SETUP
756 return DT_LITERAL;
757 }
758 YY_BREAK
759 -case 11:
760 -/* rule 11 can match eol */
761 +case 12:
762 +/* rule 12 can match eol */
763 YY_RULE_SETUP
764 -#line 168 "dtc-lexer.l"
765 +#line 173 "dtc-lexer.l"
766 {
767 struct data d;
768 DPRINT("Character literal: %s\n", yytext);
769 @@ -1098,18 +1107,18 @@ YY_RULE_SETUP
770 return DT_CHAR_LITERAL;
771 }
772 YY_BREAK
773 -case 12:
774 +case 13:
775 YY_RULE_SETUP
776 -#line 189 "dtc-lexer.l"
777 +#line 194 "dtc-lexer.l"
778 { /* label reference */
779 DPRINT("Ref: %s\n", yytext+1);
780 yylval.labelref = xstrdup(yytext+1);
781 return DT_REF;
782 }
783 YY_BREAK
784 -case 13:
785 +case 14:
786 YY_RULE_SETUP
787 -#line 195 "dtc-lexer.l"
788 +#line 200 "dtc-lexer.l"
789 { /* new-style path reference */
790 yytext[yyleng-1] = '\0';
791 DPRINT("Ref: %s\n", yytext+2);
792 @@ -1117,27 +1126,27 @@ YY_RULE_SETUP
793 return DT_REF;
794 }
795 YY_BREAK
796 -case 14:
797 +case 15:
798 YY_RULE_SETUP
799 -#line 202 "dtc-lexer.l"
800 +#line 207 "dtc-lexer.l"
801 {
802 yylval.byte = strtol(yytext, NULL, 16);
803 DPRINT("Byte: %02x\n", (int)yylval.byte);
804 return DT_BYTE;
805 }
806 YY_BREAK
807 -case 15:
808 +case 16:
809 YY_RULE_SETUP
810 -#line 208 "dtc-lexer.l"
811 +#line 213 "dtc-lexer.l"
812 {
813 DPRINT("/BYTESTRING\n");
814 BEGIN_DEFAULT();
815 return ']';
816 }
817 YY_BREAK
818 -case 16:
819 +case 17:
820 YY_RULE_SETUP
821 -#line 214 "dtc-lexer.l"
822 +#line 219 "dtc-lexer.l"
823 {
824 DPRINT("PropNodeName: %s\n", yytext);
825 yylval.propnodename = xstrdup((yytext[0] == '\\') ?
826 @@ -1146,75 +1155,75 @@ YY_RULE_SETUP
827 return DT_PROPNODENAME;
828 }
829 YY_BREAK
830 -case 17:
831 +case 18:
832 YY_RULE_SETUP
833 -#line 222 "dtc-lexer.l"
834 +#line 227 "dtc-lexer.l"
835 {
836 DPRINT("Binary Include\n");
837 return DT_INCBIN;
838 }
839 YY_BREAK
840 -case 18:
841 -/* rule 18 can match eol */
842 -YY_RULE_SETUP
843 -#line 227 "dtc-lexer.l"
844 -/* eat whitespace */
845 - YY_BREAK
846 case 19:
847 /* rule 19 can match eol */
848 YY_RULE_SETUP
849 -#line 228 "dtc-lexer.l"
850 -/* eat C-style comments */
851 +#line 232 "dtc-lexer.l"
852 +/* eat whitespace */
853 YY_BREAK
854 case 20:
855 /* rule 20 can match eol */
856 YY_RULE_SETUP
857 -#line 229 "dtc-lexer.l"
858 -/* eat C++-style comments */
859 +#line 233 "dtc-lexer.l"
860 +/* eat C-style comments */
861 YY_BREAK
862 case 21:
863 +/* rule 21 can match eol */
864 YY_RULE_SETUP
865 -#line 231 "dtc-lexer.l"
866 -{ return DT_LSHIFT; };
867 +#line 234 "dtc-lexer.l"
868 +/* eat C++-style comments */
869 YY_BREAK
870 case 22:
871 YY_RULE_SETUP
872 -#line 232 "dtc-lexer.l"
873 -{ return DT_RSHIFT; };
874 +#line 236 "dtc-lexer.l"
875 +{ return DT_LSHIFT; };
876 YY_BREAK
877 case 23:
878 YY_RULE_SETUP
879 -#line 233 "dtc-lexer.l"
880 -{ return DT_LE; };
881 +#line 237 "dtc-lexer.l"
882 +{ return DT_RSHIFT; };
883 YY_BREAK
884 case 24:
885 YY_RULE_SETUP
886 -#line 234 "dtc-lexer.l"
887 -{ return DT_GE; };
888 +#line 238 "dtc-lexer.l"
889 +{ return DT_LE; };
890 YY_BREAK
891 case 25:
892 YY_RULE_SETUP
893 -#line 235 "dtc-lexer.l"
894 -{ return DT_EQ; };
895 +#line 239 "dtc-lexer.l"
896 +{ return DT_GE; };
897 YY_BREAK
898 case 26:
899 YY_RULE_SETUP
900 -#line 236 "dtc-lexer.l"
901 -{ return DT_NE; };
902 +#line 240 "dtc-lexer.l"
903 +{ return DT_EQ; };
904 YY_BREAK
905 case 27:
906 YY_RULE_SETUP
907 -#line 237 "dtc-lexer.l"
908 -{ return DT_AND; };
909 +#line 241 "dtc-lexer.l"
910 +{ return DT_NE; };
911 YY_BREAK
912 case 28:
913 YY_RULE_SETUP
914 -#line 238 "dtc-lexer.l"
915 -{ return DT_OR; };
916 +#line 242 "dtc-lexer.l"
917 +{ return DT_AND; };
918 YY_BREAK
919 case 29:
920 YY_RULE_SETUP
921 -#line 240 "dtc-lexer.l"
922 +#line 243 "dtc-lexer.l"
923 +{ return DT_OR; };
924 + YY_BREAK
925 +case 30:
926 +YY_RULE_SETUP
927 +#line 245 "dtc-lexer.l"
928 {
929 DPRINT("Char: %c (\\x%02x)\n", yytext[0],
930 (unsigned)yytext[0]);
931 @@ -1230,12 +1239,12 @@ YY_RULE_SETUP
932 return yytext[0];
933 }
934 YY_BREAK
935 -case 30:
936 +case 31:
937 YY_RULE_SETUP
938 -#line 255 "dtc-lexer.l"
939 +#line 260 "dtc-lexer.l"
940 ECHO;
941 YY_BREAK
942 -#line 1239 "dtc-lexer.lex.c"
943 +#line 1248 "dtc-lexer.lex.c"
944
945 case YY_END_OF_BUFFER:
946 {
947 @@ -1365,7 +1374,6 @@ ECHO;
948 "fatal flex scanner internal error--no action found" );
949 } /* end of action switch */
950 } /* end of scanning one token */
951 - } /* end of user's declarations */
952 } /* end of yylex */
953
954 /* yy_get_next_buffer - try to read in a new buffer
955 @@ -1421,21 +1429,21 @@ static int yy_get_next_buffer (void)
956
957 else
958 {
959 - yy_size_t num_to_read =
960 + int num_to_read =
961 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
962
963 while ( num_to_read <= 0 )
964 { /* Not enough room in the buffer - grow it. */
965
966 /* just a shorter name for the current buffer */
967 - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
968 + YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
969
970 int yy_c_buf_p_offset =
971 (int) ((yy_c_buf_p) - b->yy_ch_buf);
972
973 if ( b->yy_is_our_buffer )
974 {
975 - yy_size_t new_size = b->yy_buf_size * 2;
976 + int new_size = b->yy_buf_size * 2;
977
978 if ( new_size <= 0 )
979 b->yy_buf_size += b->yy_buf_size / 8;
980 @@ -1466,7 +1474,7 @@ static int yy_get_next_buffer (void)
981
982 /* Read in more data. */
983 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
984 - (yy_n_chars), num_to_read );
985 + (yy_n_chars), (size_t) num_to_read );
986
987 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
988 }
989 @@ -1528,7 +1536,7 @@ static int yy_get_next_buffer (void)
990 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
991 {
992 yy_current_state = (int) yy_def[yy_current_state];
993 - if ( yy_current_state >= 159 )
994 + if ( yy_current_state >= 166 )
995 yy_c = yy_meta[(unsigned int) yy_c];
996 }
997 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
998 @@ -1556,13 +1564,13 @@ static int yy_get_next_buffer (void)
999 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1000 {
1001 yy_current_state = (int) yy_def[yy_current_state];
1002 - if ( yy_current_state >= 159 )
1003 + if ( yy_current_state >= 166 )
1004 yy_c = yy_meta[(unsigned int) yy_c];
1005 }
1006 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1007 - yy_is_jam = (yy_current_state == 158);
1008 + yy_is_jam = (yy_current_state == 165);
1009
1010 - return yy_is_jam ? 0 : yy_current_state;
1011 + return yy_is_jam ? 0 : yy_current_state;
1012 }
1013
1014 #ifndef YY_NO_INPUT
1015 @@ -1589,7 +1597,7 @@ static int yy_get_next_buffer (void)
1016
1017 else
1018 { /* need more input */
1019 - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1020 + int offset = (yy_c_buf_p) - (yytext_ptr);
1021 ++(yy_c_buf_p);
1022
1023 switch ( yy_get_next_buffer( ) )
1024 @@ -1863,7 +1871,7 @@ void yypop_buffer_state (void)
1025 */
1026 static void yyensure_buffer_stack (void)
1027 {
1028 - yy_size_t num_to_alloc;
1029 + int num_to_alloc;
1030
1031 if (!(yy_buffer_stack)) {
1032
1033 @@ -1960,12 +1968,12 @@ YY_BUFFER_STATE yy_scan_string (yyconst
1034 *
1035 * @return the newly allocated buffer state object.
1036 */
1037 -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1038 +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1039 {
1040 YY_BUFFER_STATE b;
1041 char *buf;
1042 yy_size_t n;
1043 - yy_size_t i;
1044 + int i;
1045
1046 /* Get memory for full buffer, including space for trailing EOB's. */
1047 n = _yybytes_len + 2;
1048 @@ -2047,7 +2055,7 @@ FILE *yyget_out (void)
1049 /** Get the length of the current token.
1050 *
1051 */
1052 -yy_size_t yyget_leng (void)
1053 +int yyget_leng (void)
1054 {
1055 return yyleng;
1056 }
1057 @@ -2195,7 +2203,7 @@ void yyfree (void * ptr )
1058
1059 #define YYTABLES_NAME "yytables"
1060
1061 -#line 254 "dtc-lexer.l"
1062 +#line 260 "dtc-lexer.l"
1063
1064
1065
1066 --- a/scripts/dtc/dtc-parser.tab.c_shipped
1067 +++ b/scripts/dtc/dtc-parser.tab.c_shipped
1068 @@ -65,6 +65,7 @@
1069 #line 20 "dtc-parser.y" /* yacc.c:339 */
1070
1071 #include <stdio.h>
1072 +#include <inttypes.h>
1073
1074 #include "dtc.h"
1075 #include "srcpos.h"
1076 @@ -80,7 +81,7 @@ extern void yyerror(char const *s);
1077 extern struct boot_info *the_boot_info;
1078 extern bool treesource_error;
1079
1080 -#line 84 "dtc-parser.tab.c" /* yacc.c:339 */
1081 +#line 85 "dtc-parser.tab.c" /* yacc.c:339 */
1082
1083 # ifndef YY_NULLPTR
1084 # if defined __cplusplus && 201103L <= __cplusplus
1085 @@ -116,26 +117,27 @@ extern int yydebug;
1086 enum yytokentype
1087 {
1088 DT_V1 = 258,
1089 - DT_MEMRESERVE = 259,
1090 - DT_LSHIFT = 260,
1091 - DT_RSHIFT = 261,
1092 - DT_LE = 262,
1093 - DT_GE = 263,
1094 - DT_EQ = 264,
1095 - DT_NE = 265,
1096 - DT_AND = 266,
1097 - DT_OR = 267,
1098 - DT_BITS = 268,
1099 - DT_DEL_PROP = 269,
1100 - DT_DEL_NODE = 270,
1101 - DT_PROPNODENAME = 271,
1102 - DT_LITERAL = 272,
1103 - DT_CHAR_LITERAL = 273,
1104 - DT_BYTE = 274,
1105 - DT_STRING = 275,
1106 - DT_LABEL = 276,
1107 - DT_REF = 277,
1108 - DT_INCBIN = 278
1109 + DT_PLUGIN = 259,
1110 + DT_MEMRESERVE = 260,
1111 + DT_LSHIFT = 261,
1112 + DT_RSHIFT = 262,
1113 + DT_LE = 263,
1114 + DT_GE = 264,
1115 + DT_EQ = 265,
1116 + DT_NE = 266,
1117 + DT_AND = 267,
1118 + DT_OR = 268,
1119 + DT_BITS = 269,
1120 + DT_DEL_PROP = 270,
1121 + DT_DEL_NODE = 271,
1122 + DT_PROPNODENAME = 272,
1123 + DT_LITERAL = 273,
1124 + DT_CHAR_LITERAL = 274,
1125 + DT_BYTE = 275,
1126 + DT_STRING = 276,
1127 + DT_LABEL = 277,
1128 + DT_REF = 278,
1129 + DT_INCBIN = 279
1130 };
1131 #endif
1132
1133 @@ -144,7 +146,7 @@ extern int yydebug;
1134 typedef union YYSTYPE YYSTYPE;
1135 union YYSTYPE
1136 {
1137 -#line 38 "dtc-parser.y" /* yacc.c:355 */
1138 +#line 39 "dtc-parser.y" /* yacc.c:355 */
1139
1140 char *propnodename;
1141 char *labelref;
1142 @@ -162,8 +164,9 @@ union YYSTYPE
1143 struct node *nodelist;
1144 struct reserve_info *re;
1145 uint64_t integer;
1146 + bool is_plugin;
1147
1148 -#line 167 "dtc-parser.tab.c" /* yacc.c:355 */
1149 +#line 170 "dtc-parser.tab.c" /* yacc.c:355 */
1150 };
1151 # define YYSTYPE_IS_TRIVIAL 1
1152 # define YYSTYPE_IS_DECLARED 1
1153 @@ -192,7 +195,7 @@ int yyparse (void);
1154
1155 /* Copy the second part of user declarations. */
1156
1157 -#line 196 "dtc-parser.tab.c" /* yacc.c:358 */
1158 +#line 199 "dtc-parser.tab.c" /* yacc.c:358 */
1159
1160 #ifdef short
1161 # undef short
1162 @@ -439,18 +442,18 @@ union yyalloc
1163 #define YYLAST 136
1164
1165 /* YYNTOKENS -- Number of terminals. */
1166 -#define YYNTOKENS 47
1167 +#define YYNTOKENS 48
1168 /* YYNNTS -- Number of nonterminals. */
1169 -#define YYNNTS 28
1170 +#define YYNNTS 29
1171 /* YYNRULES -- Number of rules. */
1172 -#define YYNRULES 80
1173 +#define YYNRULES 82
1174 /* YYNSTATES -- Number of states. */
1175 -#define YYNSTATES 144
1176 +#define YYNSTATES 147
1177
1178 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
1179 by yylex, with out-of-bounds checking. */
1180 #define YYUNDEFTOK 2
1181 -#define YYMAXUTOK 278
1182 +#define YYMAXUTOK 279
1183
1184 #define YYTRANSLATE(YYX) \
1185 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1186 @@ -462,16 +465,16 @@ static const yytype_uint8 yytranslate[]
1187 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1188 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1189 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1190 - 2, 2, 2, 46, 2, 2, 2, 44, 40, 2,
1191 - 32, 34, 43, 41, 33, 42, 2, 25, 2, 2,
1192 - 2, 2, 2, 2, 2, 2, 2, 2, 37, 24,
1193 - 35, 28, 29, 36, 2, 2, 2, 2, 2, 2,
1194 + 2, 2, 2, 47, 2, 2, 2, 45, 41, 2,
1195 + 33, 35, 44, 42, 34, 43, 2, 26, 2, 2,
1196 + 2, 2, 2, 2, 2, 2, 2, 2, 38, 25,
1197 + 36, 29, 30, 37, 2, 2, 2, 2, 2, 2,
1198 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1199 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1200 - 2, 30, 2, 31, 39, 2, 2, 2, 2, 2,
1201 + 2, 31, 2, 32, 40, 2, 2, 2, 2, 2,
1202 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1203 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1204 - 2, 2, 2, 26, 38, 27, 45, 2, 2, 2,
1205 + 2, 2, 2, 27, 39, 28, 46, 2, 2, 2,
1206 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1207 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1208 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1209 @@ -486,22 +489,22 @@ static const yytype_uint8 yytranslate[]
1210 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1211 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1212 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1213 - 15, 16, 17, 18, 19, 20, 21, 22, 23
1214 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24
1215 };
1216
1217 #if YYDEBUG
1218 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
1219 static const yytype_uint16 yyrline[] =
1220 {
1221 - 0, 104, 104, 113, 116, 123, 127, 135, 139, 144,
1222 - 155, 165, 180, 188, 191, 198, 202, 206, 210, 218,
1223 - 222, 226, 230, 234, 250, 260, 268, 271, 275, 282,
1224 - 298, 303, 322, 336, 343, 344, 345, 352, 356, 357,
1225 - 361, 362, 366, 367, 371, 372, 376, 377, 381, 382,
1226 - 386, 387, 388, 392, 393, 394, 395, 396, 400, 401,
1227 - 402, 406, 407, 408, 412, 413, 414, 415, 419, 420,
1228 - 421, 422, 427, 430, 434, 442, 445, 449, 457, 461,
1229 - 465
1230 + 0, 108, 108, 118, 121, 129, 132, 139, 143, 151,
1231 + 155, 160, 171, 181, 196, 204, 207, 214, 218, 222,
1232 + 226, 234, 238, 242, 246, 250, 266, 276, 284, 287,
1233 + 291, 298, 314, 319, 338, 352, 359, 360, 361, 368,
1234 + 372, 373, 377, 378, 382, 383, 387, 388, 392, 393,
1235 + 397, 398, 402, 403, 404, 408, 409, 410, 411, 412,
1236 + 416, 417, 418, 422, 423, 424, 428, 429, 430, 431,
1237 + 435, 436, 437, 438, 443, 446, 450, 458, 461, 465,
1238 + 473, 477, 481
1239 };
1240 #endif
1241
1242 @@ -510,19 +513,19 @@ static const yytype_uint16 yyrline[] =
1243 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1244 static const char *const yytname[] =
1245 {
1246 - "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE", "DT_LSHIFT",
1247 - "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ", "DT_NE", "DT_AND", "DT_OR",
1248 - "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE", "DT_PROPNODENAME", "DT_LITERAL",
1249 - "DT_CHAR_LITERAL", "DT_BYTE", "DT_STRING", "DT_LABEL", "DT_REF",
1250 - "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['", "']'",
1251 - "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'", "'+'",
1252 - "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile",
1253 - "memreserves", "memreserve", "devicetree", "nodedef", "proplist",
1254 - "propdef", "propdata", "propdataprefix", "arrayprefix", "integer_prim",
1255 - "integer_expr", "integer_trinary", "integer_or", "integer_and",
1256 - "integer_bitor", "integer_bitxor", "integer_bitand", "integer_eq",
1257 - "integer_rela", "integer_shift", "integer_add", "integer_mul",
1258 - "integer_unary", "bytestring", "subnodes", "subnode", YY_NULLPTR
1259 + "$end", "error", "$undefined", "DT_V1", "DT_PLUGIN", "DT_MEMRESERVE",
1260 + "DT_LSHIFT", "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ", "DT_NE", "DT_AND",
1261 + "DT_OR", "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE", "DT_PROPNODENAME",
1262 + "DT_LITERAL", "DT_CHAR_LITERAL", "DT_BYTE", "DT_STRING", "DT_LABEL",
1263 + "DT_REF", "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['",
1264 + "']'", "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'",
1265 + "'+'", "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile",
1266 + "plugindecl", "memreserves", "memreserve", "devicetree", "nodedef",
1267 + "proplist", "propdef", "propdata", "propdataprefix", "arrayprefix",
1268 + "integer_prim", "integer_expr", "integer_trinary", "integer_or",
1269 + "integer_and", "integer_bitor", "integer_bitxor", "integer_bitand",
1270 + "integer_eq", "integer_rela", "integer_shift", "integer_add",
1271 + "integer_mul", "integer_unary", "bytestring", "subnodes", "subnode", YY_NULLPTR
1272 };
1273 #endif
1274
1275 @@ -533,16 +536,16 @@ static const yytype_uint16 yytoknum[] =
1276 {
1277 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1278 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1279 - 275, 276, 277, 278, 59, 47, 123, 125, 61, 62,
1280 - 91, 93, 40, 44, 41, 60, 63, 58, 124, 94,
1281 - 38, 43, 45, 42, 37, 126, 33
1282 + 275, 276, 277, 278, 279, 59, 47, 123, 125, 61,
1283 + 62, 91, 93, 40, 44, 41, 60, 63, 58, 124,
1284 + 94, 38, 43, 45, 42, 37, 126, 33
1285 };
1286 # endif
1287
1288 -#define YYPACT_NINF -81
1289 +#define YYPACT_NINF -84
1290
1291 #define yypact_value_is_default(Yystate) \
1292 - (!!((Yystate) == (-81)))
1293 + (!!((Yystate) == (-84)))
1294
1295 #define YYTABLE_NINF -1
1296
1297 @@ -553,21 +556,21 @@ static const yytype_uint16 yytoknum[] =
1298 STATE-NUM. */
1299 static const yytype_int8 yypact[] =
1300 {
1301 - 16, -11, 21, 10, -81, 25, 10, 19, 10, -81,
1302 - -81, -9, 25, -81, 2, 51, -81, -9, -9, -9,
1303 - -81, 1, -81, -6, 50, 14, 28, 29, 36, 3,
1304 - 58, 44, -3, -81, 47, -81, -81, 65, 68, 2,
1305 - 2, -81, -81, -81, -81, -9, -9, -9, -9, -9,
1306 - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
1307 - -9, -9, -9, -9, -81, 63, 69, 2, -81, -81,
1308 - 50, 57, 14, 28, 29, 36, 3, 3, 58, 58,
1309 - 58, 58, 44, 44, -3, -3, -81, -81, -81, 79,
1310 - 80, -8, 63, -81, 72, 63, -81, -81, -9, 76,
1311 - 77, -81, -81, -81, -81, -81, 78, -81, -81, -81,
1312 - -81, -81, 35, 4, -81, -81, -81, -81, 86, -81,
1313 - -81, -81, 73, -81, -81, 33, 71, 84, 39, -81,
1314 - -81, -81, -81, -81, 41, -81, -81, -81, 25, -81,
1315 - 74, 25, 75, -81
1316 + 15, -12, 35, 42, -84, 27, 9, -84, 24, 9,
1317 + 43, 9, -84, -84, -10, 24, -84, 60, 44, -84,
1318 + -10, -10, -10, -84, 55, -84, -7, 52, 53, 51,
1319 + 54, 10, 2, 38, 37, -4, -84, 68, -84, -84,
1320 + 71, 73, 60, 60, -84, -84, -84, -84, -10, -10,
1321 + -10, -10, -10, -10, -10, -10, -10, -10, -10, -10,
1322 + -10, -10, -10, -10, -10, -10, -10, -84, 56, 72,
1323 + 60, -84, -84, 52, 61, 53, 51, 54, 10, 2,
1324 + 2, 38, 38, 38, 38, 37, 37, -4, -4, -84,
1325 + -84, -84, 81, 83, 34, 56, -84, 74, 56, -84,
1326 + -84, -10, 76, 78, -84, -84, -84, -84, -84, 79,
1327 + -84, -84, -84, -84, -84, -6, 3, -84, -84, -84,
1328 + -84, 87, -84, -84, -84, 75, -84, -84, 32, 70,
1329 + 86, 36, -84, -84, -84, -84, -84, 47, -84, -84,
1330 + -84, 24, -84, 77, 24, 80, -84
1331 };
1332
1333 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1334 @@ -575,37 +578,37 @@ static const yytype_int8 yypact[] =
1335 means the default is an error. */
1336 static const yytype_uint8 yydefact[] =
1337 {
1338 - 0, 0, 0, 3, 1, 0, 0, 0, 3, 34,
1339 - 35, 0, 0, 6, 0, 2, 4, 0, 0, 0,
1340 - 68, 0, 37, 38, 40, 42, 44, 46, 48, 50,
1341 - 53, 60, 63, 67, 0, 13, 7, 0, 0, 0,
1342 - 0, 69, 70, 71, 36, 0, 0, 0, 0, 0,
1343 + 0, 0, 0, 3, 1, 0, 5, 4, 0, 0,
1344 + 0, 5, 36, 37, 0, 0, 8, 0, 2, 6,
1345 + 0, 0, 0, 70, 0, 39, 40, 42, 44, 46,
1346 + 48, 50, 52, 55, 62, 65, 69, 0, 15, 9,
1347 + 0, 0, 0, 0, 71, 72, 73, 38, 0, 0,
1348 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1349 - 0, 0, 0, 0, 5, 75, 0, 0, 10, 8,
1350 - 41, 0, 43, 45, 47, 49, 51, 52, 56, 57,
1351 - 55, 54, 58, 59, 61, 62, 65, 64, 66, 0,
1352 - 0, 0, 0, 14, 0, 75, 11, 9, 0, 0,
1353 - 0, 16, 26, 78, 18, 80, 0, 77, 76, 39,
1354 - 17, 79, 0, 0, 12, 25, 15, 27, 0, 19,
1355 - 28, 22, 0, 72, 30, 0, 0, 0, 0, 33,
1356 - 32, 20, 31, 29, 0, 73, 74, 21, 0, 24,
1357 - 0, 0, 0, 23
1358 + 0, 0, 0, 0, 0, 0, 0, 7, 77, 0,
1359 + 0, 12, 10, 43, 0, 45, 47, 49, 51, 53,
1360 + 54, 58, 59, 57, 56, 60, 61, 63, 64, 67,
1361 + 66, 68, 0, 0, 0, 0, 16, 0, 77, 13,
1362 + 11, 0, 0, 0, 18, 28, 80, 20, 82, 0,
1363 + 79, 78, 41, 19, 81, 0, 0, 14, 27, 17,
1364 + 29, 0, 21, 30, 24, 0, 74, 32, 0, 0,
1365 + 0, 0, 35, 34, 22, 33, 31, 0, 75, 76,
1366 + 23, 0, 26, 0, 0, 0, 25
1367 };
1368
1369 /* YYPGOTO[NTERM-NUM]. */
1370 static const yytype_int8 yypgoto[] =
1371 {
1372 - -81, -81, 100, 104, -81, -38, -81, -80, -81, -81,
1373 - -81, -5, 66, 13, -81, 70, 67, 81, 64, 82,
1374 - 37, 27, 34, 38, -14, -81, 22, 24
1375 + -84, -84, -84, 98, 101, -84, -41, -84, -83, -84,
1376 + -84, -84, -8, 63, 12, -84, 66, 67, 65, 69,
1377 + 82, 29, 18, 25, 26, -17, -84, 20, 28
1378 };
1379
1380 /* YYDEFGOTO[NTERM-NUM]. */
1381 static const yytype_int16 yydefgoto[] =
1382 {
1383 - -1, 2, 7, 8, 15, 36, 65, 93, 112, 113,
1384 - 125, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1385 - 29, 30, 31, 32, 33, 128, 94, 95
1386 + -1, 2, 6, 10, 11, 18, 39, 68, 96, 115,
1387 + 116, 128, 23, 24, 25, 26, 27, 28, 29, 30,
1388 + 31, 32, 33, 34, 35, 36, 131, 97, 98
1389 };
1390
1391 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1392 @@ -613,87 +616,87 @@ static const yytype_int16 yydefgoto[] =
1393 number is the opposite. If YYTABLE_NINF, syntax error. */
1394 static const yytype_uint8 yytable[] =
1395 {
1396 - 12, 68, 69, 41, 42, 43, 45, 34, 9, 10,
1397 - 53, 54, 104, 3, 5, 107, 101, 118, 35, 1,
1398 - 102, 4, 61, 11, 119, 120, 121, 122, 35, 97,
1399 - 46, 6, 55, 17, 123, 44, 18, 19, 56, 124,
1400 - 62, 63, 9, 10, 14, 51, 52, 86, 87, 88,
1401 - 9, 10, 48, 103, 129, 130, 115, 11, 135, 116,
1402 - 136, 47, 131, 57, 58, 11, 37, 49, 117, 50,
1403 - 137, 64, 38, 39, 138, 139, 40, 89, 90, 91,
1404 - 78, 79, 80, 81, 92, 59, 60, 66, 76, 77,
1405 - 67, 82, 83, 96, 98, 99, 100, 84, 85, 106,
1406 - 110, 111, 114, 126, 134, 127, 133, 141, 16, 143,
1407 - 13, 109, 71, 74, 72, 70, 105, 108, 0, 0,
1408 - 132, 0, 0, 0, 0, 0, 0, 0, 0, 73,
1409 - 0, 0, 75, 140, 0, 0, 142
1410 + 15, 71, 72, 44, 45, 46, 48, 37, 12, 13,
1411 + 56, 57, 107, 3, 8, 110, 118, 121, 1, 119,
1412 + 54, 55, 64, 14, 122, 123, 124, 125, 120, 100,
1413 + 49, 9, 58, 20, 126, 4, 21, 22, 59, 127,
1414 + 65, 66, 12, 13, 60, 61, 5, 89, 90, 91,
1415 + 12, 13, 7, 106, 132, 133, 138, 14, 139, 104,
1416 + 40, 38, 134, 105, 50, 14, 41, 42, 140, 17,
1417 + 43, 92, 93, 94, 81, 82, 83, 84, 95, 62,
1418 + 63, 141, 142, 79, 80, 85, 86, 38, 87, 88,
1419 + 47, 52, 51, 67, 69, 53, 70, 99, 102, 101,
1420 + 103, 113, 109, 114, 117, 129, 136, 137, 130, 19,
1421 + 16, 144, 74, 112, 73, 146, 76, 75, 111, 0,
1422 + 135, 77, 0, 108, 0, 0, 0, 0, 0, 0,
1423 + 0, 0, 0, 143, 0, 78, 145
1424 };
1425
1426 static const yytype_int16 yycheck[] =
1427 {
1428 - 5, 39, 40, 17, 18, 19, 12, 12, 17, 18,
1429 - 7, 8, 92, 24, 4, 95, 24, 13, 26, 3,
1430 - 28, 0, 25, 32, 20, 21, 22, 23, 26, 67,
1431 - 36, 21, 29, 42, 30, 34, 45, 46, 35, 35,
1432 - 43, 44, 17, 18, 25, 9, 10, 61, 62, 63,
1433 - 17, 18, 38, 91, 21, 22, 21, 32, 19, 24,
1434 - 21, 11, 29, 5, 6, 32, 15, 39, 33, 40,
1435 - 31, 24, 21, 22, 33, 34, 25, 14, 15, 16,
1436 - 53, 54, 55, 56, 21, 41, 42, 22, 51, 52,
1437 - 22, 57, 58, 24, 37, 16, 16, 59, 60, 27,
1438 - 24, 24, 24, 17, 20, 32, 35, 33, 8, 34,
1439 - 6, 98, 46, 49, 47, 45, 92, 95, -1, -1,
1440 - 125, -1, -1, -1, -1, -1, -1, -1, -1, 48,
1441 - -1, -1, 50, 138, -1, -1, 141
1442 + 8, 42, 43, 20, 21, 22, 13, 15, 18, 19,
1443 + 8, 9, 95, 25, 5, 98, 22, 14, 3, 25,
1444 + 10, 11, 26, 33, 21, 22, 23, 24, 34, 70,
1445 + 37, 22, 30, 43, 31, 0, 46, 47, 36, 36,
1446 + 44, 45, 18, 19, 6, 7, 4, 64, 65, 66,
1447 + 18, 19, 25, 94, 22, 23, 20, 33, 22, 25,
1448 + 16, 27, 30, 29, 12, 33, 22, 23, 32, 26,
1449 + 26, 15, 16, 17, 56, 57, 58, 59, 22, 42,
1450 + 43, 34, 35, 54, 55, 60, 61, 27, 62, 63,
1451 + 35, 40, 39, 25, 23, 41, 23, 25, 17, 38,
1452 + 17, 25, 28, 25, 25, 18, 36, 21, 33, 11,
1453 + 9, 34, 49, 101, 48, 35, 51, 50, 98, -1,
1454 + 128, 52, -1, 95, -1, -1, -1, -1, -1, -1,
1455 + -1, -1, -1, 141, -1, 53, 144
1456 };
1457
1458 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1459 symbol of state STATE-NUM. */
1460 static const yytype_uint8 yystos[] =
1461 {
1462 - 0, 3, 48, 24, 0, 4, 21, 49, 50, 17,
1463 - 18, 32, 58, 50, 25, 51, 49, 42, 45, 46,
1464 - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
1465 - 68, 69, 70, 71, 58, 26, 52, 15, 21, 22,
1466 - 25, 71, 71, 71, 34, 12, 36, 11, 38, 39,
1467 - 40, 9, 10, 7, 8, 29, 35, 5, 6, 41,
1468 - 42, 25, 43, 44, 24, 53, 22, 22, 52, 52,
1469 - 62, 59, 63, 64, 65, 66, 67, 67, 68, 68,
1470 - 68, 68, 69, 69, 70, 70, 71, 71, 71, 14,
1471 - 15, 16, 21, 54, 73, 74, 24, 52, 37, 16,
1472 - 16, 24, 28, 52, 54, 74, 27, 54, 73, 60,
1473 - 24, 24, 55, 56, 24, 21, 24, 33, 13, 20,
1474 - 21, 22, 23, 30, 35, 57, 17, 32, 72, 21,
1475 - 22, 29, 58, 35, 20, 19, 21, 31, 33, 34,
1476 - 58, 33, 58, 34
1477 + 0, 3, 49, 25, 0, 4, 50, 25, 5, 22,
1478 + 51, 52, 18, 19, 33, 60, 52, 26, 53, 51,
1479 + 43, 46, 47, 60, 61, 62, 63, 64, 65, 66,
1480 + 67, 68, 69, 70, 71, 72, 73, 60, 27, 54,
1481 + 16, 22, 23, 26, 73, 73, 73, 35, 13, 37,
1482 + 12, 39, 40, 41, 10, 11, 8, 9, 30, 36,
1483 + 6, 7, 42, 43, 26, 44, 45, 25, 55, 23,
1484 + 23, 54, 54, 64, 61, 65, 66, 67, 68, 69,
1485 + 69, 70, 70, 70, 70, 71, 71, 72, 72, 73,
1486 + 73, 73, 15, 16, 17, 22, 56, 75, 76, 25,
1487 + 54, 38, 17, 17, 25, 29, 54, 56, 76, 28,
1488 + 56, 75, 62, 25, 25, 57, 58, 25, 22, 25,
1489 + 34, 14, 21, 22, 23, 24, 31, 36, 59, 18,
1490 + 33, 74, 22, 23, 30, 60, 36, 21, 20, 22,
1491 + 32, 34, 35, 60, 34, 60, 35
1492 };
1493
1494 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1495 static const yytype_uint8 yyr1[] =
1496 {
1497 - 0, 47, 48, 49, 49, 50, 50, 51, 51, 51,
1498 - 51, 51, 52, 53, 53, 54, 54, 54, 54, 55,
1499 - 55, 55, 55, 55, 55, 55, 56, 56, 56, 57,
1500 - 57, 57, 57, 57, 58, 58, 58, 59, 60, 60,
1501 - 61, 61, 62, 62, 63, 63, 64, 64, 65, 65,
1502 - 66, 66, 66, 67, 67, 67, 67, 67, 68, 68,
1503 - 68, 69, 69, 69, 70, 70, 70, 70, 71, 71,
1504 - 71, 71, 72, 72, 72, 73, 73, 73, 74, 74,
1505 - 74
1506 + 0, 48, 49, 50, 50, 51, 51, 52, 52, 53,
1507 + 53, 53, 53, 53, 54, 55, 55, 56, 56, 56,
1508 + 56, 57, 57, 57, 57, 57, 57, 57, 58, 58,
1509 + 58, 59, 59, 59, 59, 59, 60, 60, 60, 61,
1510 + 62, 62, 63, 63, 64, 64, 65, 65, 66, 66,
1511 + 67, 67, 68, 68, 68, 69, 69, 69, 69, 69,
1512 + 70, 70, 70, 71, 71, 71, 72, 72, 72, 72,
1513 + 73, 73, 73, 73, 74, 74, 74, 75, 75, 75,
1514 + 76, 76, 76
1515 };
1516
1517 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
1518 static const yytype_uint8 yyr2[] =
1519 {
1520 - 0, 2, 4, 0, 2, 4, 2, 2, 3, 4,
1521 - 3, 4, 5, 0, 2, 4, 2, 3, 2, 2,
1522 - 3, 4, 2, 9, 5, 2, 0, 2, 2, 3,
1523 - 1, 2, 2, 2, 1, 1, 3, 1, 1, 5,
1524 - 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
1525 - 1, 3, 3, 1, 3, 3, 3, 3, 3, 3,
1526 - 1, 3, 3, 1, 3, 3, 3, 1, 1, 2,
1527 - 2, 2, 0, 2, 2, 0, 2, 2, 2, 3,
1528 - 2
1529 + 0, 2, 5, 0, 2, 0, 2, 4, 2, 2,
1530 + 3, 4, 3, 4, 5, 0, 2, 4, 2, 3,
1531 + 2, 2, 3, 4, 2, 9, 5, 2, 0, 2,
1532 + 2, 3, 1, 2, 2, 2, 1, 1, 3, 1,
1533 + 1, 5, 1, 3, 1, 3, 1, 3, 1, 3,
1534 + 1, 3, 1, 3, 3, 1, 3, 3, 3, 3,
1535 + 3, 3, 1, 3, 3, 1, 3, 3, 3, 1,
1536 + 1, 2, 2, 2, 0, 2, 2, 0, 2, 2,
1537 + 2, 3, 2
1538 };
1539
1540
1541 @@ -1463,65 +1466,82 @@ yyreduce:
1542 switch (yyn)
1543 {
1544 case 2:
1545 -#line 105 "dtc-parser.y" /* yacc.c:1646 */
1546 +#line 109 "dtc-parser.y" /* yacc.c:1646 */
1547 {
1548 + (yyvsp[0].node)->is_plugin = (yyvsp[-2].is_plugin);
1549 the_boot_info = build_boot_info((yyvsp[-1].re), (yyvsp[0].node),
1550 guess_boot_cpuid((yyvsp[0].node)));
1551 }
1552 -#line 1472 "dtc-parser.tab.c" /* yacc.c:1646 */
1553 +#line 1476 "dtc-parser.tab.c" /* yacc.c:1646 */
1554 break;
1555
1556 case 3:
1557 -#line 113 "dtc-parser.y" /* yacc.c:1646 */
1558 +#line 118 "dtc-parser.y" /* yacc.c:1646 */
1559 {
1560 - (yyval.re) = NULL;
1561 + (yyval.is_plugin) = false;
1562 }
1563 -#line 1480 "dtc-parser.tab.c" /* yacc.c:1646 */
1564 +#line 1484 "dtc-parser.tab.c" /* yacc.c:1646 */
1565 break;
1566
1567 case 4:
1568 -#line 117 "dtc-parser.y" /* yacc.c:1646 */
1569 +#line 122 "dtc-parser.y" /* yacc.c:1646 */
1570 {
1571 - (yyval.re) = chain_reserve_entry((yyvsp[-1].re), (yyvsp[0].re));
1572 + (yyval.is_plugin) = true;
1573 }
1574 -#line 1488 "dtc-parser.tab.c" /* yacc.c:1646 */
1575 +#line 1492 "dtc-parser.tab.c" /* yacc.c:1646 */
1576 break;
1577
1578 case 5:
1579 -#line 124 "dtc-parser.y" /* yacc.c:1646 */
1580 +#line 129 "dtc-parser.y" /* yacc.c:1646 */
1581 {
1582 - (yyval.re) = build_reserve_entry((yyvsp[-2].integer), (yyvsp[-1].integer));
1583 + (yyval.re) = NULL;
1584 }
1585 -#line 1496 "dtc-parser.tab.c" /* yacc.c:1646 */
1586 +#line 1500 "dtc-parser.tab.c" /* yacc.c:1646 */
1587 break;
1588
1589 case 6:
1590 -#line 128 "dtc-parser.y" /* yacc.c:1646 */
1591 +#line 133 "dtc-parser.y" /* yacc.c:1646 */
1592 + {
1593 + (yyval.re) = chain_reserve_entry((yyvsp[-1].re), (yyvsp[0].re));
1594 + }
1595 +#line 1508 "dtc-parser.tab.c" /* yacc.c:1646 */
1596 + break;
1597 +
1598 + case 7:
1599 +#line 140 "dtc-parser.y" /* yacc.c:1646 */
1600 + {
1601 + (yyval.re) = build_reserve_entry((yyvsp[-2].integer), (yyvsp[-1].integer));
1602 + }
1603 +#line 1516 "dtc-parser.tab.c" /* yacc.c:1646 */
1604 + break;
1605 +
1606 + case 8:
1607 +#line 144 "dtc-parser.y" /* yacc.c:1646 */
1608 {
1609 add_label(&(yyvsp[0].re)->labels, (yyvsp[-1].labelref));
1610 (yyval.re) = (yyvsp[0].re);
1611 }
1612 -#line 1505 "dtc-parser.tab.c" /* yacc.c:1646 */
1613 +#line 1525 "dtc-parser.tab.c" /* yacc.c:1646 */
1614 break;
1615
1616 - case 7:
1617 -#line 136 "dtc-parser.y" /* yacc.c:1646 */
1618 + case 9:
1619 +#line 152 "dtc-parser.y" /* yacc.c:1646 */
1620 {
1621 (yyval.node) = name_node((yyvsp[0].node), "");
1622 }
1623 -#line 1513 "dtc-parser.tab.c" /* yacc.c:1646 */
1624 +#line 1533 "dtc-parser.tab.c" /* yacc.c:1646 */
1625 break;
1626
1627 - case 8:
1628 -#line 140 "dtc-parser.y" /* yacc.c:1646 */
1629 + case 10:
1630 +#line 156 "dtc-parser.y" /* yacc.c:1646 */
1631 {
1632 (yyval.node) = merge_nodes((yyvsp[-2].node), (yyvsp[0].node));
1633 }
1634 -#line 1521 "dtc-parser.tab.c" /* yacc.c:1646 */
1635 +#line 1541 "dtc-parser.tab.c" /* yacc.c:1646 */
1636 break;
1637
1638 - case 9:
1639 -#line 145 "dtc-parser.y" /* yacc.c:1646 */
1640 + case 11:
1641 +#line 161 "dtc-parser.y" /* yacc.c:1646 */
1642 {
1643 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1644
1645 @@ -1532,11 +1552,11 @@ yyreduce:
1646 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1647 (yyval.node) = (yyvsp[-3].node);
1648 }
1649 -#line 1536 "dtc-parser.tab.c" /* yacc.c:1646 */
1650 +#line 1556 "dtc-parser.tab.c" /* yacc.c:1646 */
1651 break;
1652
1653 - case 10:
1654 -#line 156 "dtc-parser.y" /* yacc.c:1646 */
1655 + case 12:
1656 +#line 172 "dtc-parser.y" /* yacc.c:1646 */
1657 {
1658 struct node *target = get_node_by_ref((yyvsp[-2].node), (yyvsp[-1].labelref));
1659
1660 @@ -1546,11 +1566,11 @@ yyreduce:
1661 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1662 (yyval.node) = (yyvsp[-2].node);
1663 }
1664 -#line 1550 "dtc-parser.tab.c" /* yacc.c:1646 */
1665 +#line 1570 "dtc-parser.tab.c" /* yacc.c:1646 */
1666 break;
1667
1668 - case 11:
1669 -#line 166 "dtc-parser.y" /* yacc.c:1646 */
1670 + case 13:
1671 +#line 182 "dtc-parser.y" /* yacc.c:1646 */
1672 {
1673 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1674
1675 @@ -1562,100 +1582,100 @@ yyreduce:
1676
1677 (yyval.node) = (yyvsp[-3].node);
1678 }
1679 -#line 1566 "dtc-parser.tab.c" /* yacc.c:1646 */
1680 +#line 1586 "dtc-parser.tab.c" /* yacc.c:1646 */
1681 break;
1682
1683 - case 12:
1684 -#line 181 "dtc-parser.y" /* yacc.c:1646 */
1685 + case 14:
1686 +#line 197 "dtc-parser.y" /* yacc.c:1646 */
1687 {
1688 (yyval.node) = build_node((yyvsp[-3].proplist), (yyvsp[-2].nodelist));
1689 }
1690 -#line 1574 "dtc-parser.tab.c" /* yacc.c:1646 */
1691 +#line 1594 "dtc-parser.tab.c" /* yacc.c:1646 */
1692 break;
1693
1694 - case 13:
1695 -#line 188 "dtc-parser.y" /* yacc.c:1646 */
1696 + case 15:
1697 +#line 204 "dtc-parser.y" /* yacc.c:1646 */
1698 {
1699 (yyval.proplist) = NULL;
1700 }
1701 -#line 1582 "dtc-parser.tab.c" /* yacc.c:1646 */
1702 +#line 1602 "dtc-parser.tab.c" /* yacc.c:1646 */
1703 break;
1704
1705 - case 14:
1706 -#line 192 "dtc-parser.y" /* yacc.c:1646 */
1707 + case 16:
1708 +#line 208 "dtc-parser.y" /* yacc.c:1646 */
1709 {
1710 (yyval.proplist) = chain_property((yyvsp[0].prop), (yyvsp[-1].proplist));
1711 }
1712 -#line 1590 "dtc-parser.tab.c" /* yacc.c:1646 */
1713 +#line 1610 "dtc-parser.tab.c" /* yacc.c:1646 */
1714 break;
1715
1716 - case 15:
1717 -#line 199 "dtc-parser.y" /* yacc.c:1646 */
1718 + case 17:
1719 +#line 215 "dtc-parser.y" /* yacc.c:1646 */
1720 {
1721 (yyval.prop) = build_property((yyvsp[-3].propnodename), (yyvsp[-1].data));
1722 }
1723 -#line 1598 "dtc-parser.tab.c" /* yacc.c:1646 */
1724 +#line 1618 "dtc-parser.tab.c" /* yacc.c:1646 */
1725 break;
1726
1727 - case 16:
1728 -#line 203 "dtc-parser.y" /* yacc.c:1646 */
1729 + case 18:
1730 +#line 219 "dtc-parser.y" /* yacc.c:1646 */
1731 {
1732 (yyval.prop) = build_property((yyvsp[-1].propnodename), empty_data);
1733 }
1734 -#line 1606 "dtc-parser.tab.c" /* yacc.c:1646 */
1735 +#line 1626 "dtc-parser.tab.c" /* yacc.c:1646 */
1736 break;
1737
1738 - case 17:
1739 -#line 207 "dtc-parser.y" /* yacc.c:1646 */
1740 + case 19:
1741 +#line 223 "dtc-parser.y" /* yacc.c:1646 */
1742 {
1743 (yyval.prop) = build_property_delete((yyvsp[-1].propnodename));
1744 }
1745 -#line 1614 "dtc-parser.tab.c" /* yacc.c:1646 */
1746 +#line 1634 "dtc-parser.tab.c" /* yacc.c:1646 */
1747 break;
1748
1749 - case 18:
1750 -#line 211 "dtc-parser.y" /* yacc.c:1646 */
1751 + case 20:
1752 +#line 227 "dtc-parser.y" /* yacc.c:1646 */
1753 {
1754 add_label(&(yyvsp[0].prop)->labels, (yyvsp[-1].labelref));
1755 (yyval.prop) = (yyvsp[0].prop);
1756 }
1757 -#line 1623 "dtc-parser.tab.c" /* yacc.c:1646 */
1758 +#line 1643 "dtc-parser.tab.c" /* yacc.c:1646 */
1759 break;
1760
1761 - case 19:
1762 -#line 219 "dtc-parser.y" /* yacc.c:1646 */
1763 + case 21:
1764 +#line 235 "dtc-parser.y" /* yacc.c:1646 */
1765 {
1766 (yyval.data) = data_merge((yyvsp[-1].data), (yyvsp[0].data));
1767 }
1768 -#line 1631 "dtc-parser.tab.c" /* yacc.c:1646 */
1769 +#line 1651 "dtc-parser.tab.c" /* yacc.c:1646 */
1770 break;
1771
1772 - case 20:
1773 -#line 223 "dtc-parser.y" /* yacc.c:1646 */
1774 + case 22:
1775 +#line 239 "dtc-parser.y" /* yacc.c:1646 */
1776 {
1777 (yyval.data) = data_merge((yyvsp[-2].data), (yyvsp[-1].array).data);
1778 }
1779 -#line 1639 "dtc-parser.tab.c" /* yacc.c:1646 */
1780 +#line 1659 "dtc-parser.tab.c" /* yacc.c:1646 */
1781 break;
1782
1783 - case 21:
1784 -#line 227 "dtc-parser.y" /* yacc.c:1646 */
1785 + case 23:
1786 +#line 243 "dtc-parser.y" /* yacc.c:1646 */
1787 {
1788 (yyval.data) = data_merge((yyvsp[-3].data), (yyvsp[-1].data));
1789 }
1790 -#line 1647 "dtc-parser.tab.c" /* yacc.c:1646 */
1791 +#line 1667 "dtc-parser.tab.c" /* yacc.c:1646 */
1792 break;
1793
1794 - case 22:
1795 -#line 231 "dtc-parser.y" /* yacc.c:1646 */
1796 + case 24:
1797 +#line 247 "dtc-parser.y" /* yacc.c:1646 */
1798 {
1799 (yyval.data) = data_add_marker((yyvsp[-1].data), REF_PATH, (yyvsp[0].labelref));
1800 }
1801 -#line 1655 "dtc-parser.tab.c" /* yacc.c:1646 */
1802 +#line 1675 "dtc-parser.tab.c" /* yacc.c:1646 */
1803 break;
1804
1805 - case 23:
1806 -#line 235 "dtc-parser.y" /* yacc.c:1646 */
1807 + case 25:
1808 +#line 251 "dtc-parser.y" /* yacc.c:1646 */
1809 {
1810 FILE *f = srcfile_relative_open((yyvsp[-5].data).val, NULL);
1811 struct data d;
1812 @@ -1671,11 +1691,11 @@ yyreduce:
1813 (yyval.data) = data_merge((yyvsp[-8].data), d);
1814 fclose(f);
1815 }
1816 -#line 1675 "dtc-parser.tab.c" /* yacc.c:1646 */
1817 +#line 1695 "dtc-parser.tab.c" /* yacc.c:1646 */
1818 break;
1819
1820 - case 24:
1821 -#line 251 "dtc-parser.y" /* yacc.c:1646 */
1822 + case 26:
1823 +#line 267 "dtc-parser.y" /* yacc.c:1646 */
1824 {
1825 FILE *f = srcfile_relative_open((yyvsp[-1].data).val, NULL);
1826 struct data d = empty_data;
1827 @@ -1685,43 +1705,43 @@ yyreduce:
1828 (yyval.data) = data_merge((yyvsp[-4].data), d);
1829 fclose(f);
1830 }
1831 -#line 1689 "dtc-parser.tab.c" /* yacc.c:1646 */
1832 +#line 1709 "dtc-parser.tab.c" /* yacc.c:1646 */
1833 break;
1834
1835 - case 25:
1836 -#line 261 "dtc-parser.y" /* yacc.c:1646 */
1837 + case 27:
1838 +#line 277 "dtc-parser.y" /* yacc.c:1646 */
1839 {
1840 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1841 }
1842 -#line 1697 "dtc-parser.tab.c" /* yacc.c:1646 */
1843 +#line 1717 "dtc-parser.tab.c" /* yacc.c:1646 */
1844 break;
1845
1846 - case 26:
1847 -#line 268 "dtc-parser.y" /* yacc.c:1646 */
1848 + case 28:
1849 +#line 284 "dtc-parser.y" /* yacc.c:1646 */
1850 {
1851 (yyval.data) = empty_data;
1852 }
1853 -#line 1705 "dtc-parser.tab.c" /* yacc.c:1646 */
1854 +#line 1725 "dtc-parser.tab.c" /* yacc.c:1646 */
1855 break;
1856
1857 - case 27:
1858 -#line 272 "dtc-parser.y" /* yacc.c:1646 */
1859 + case 29:
1860 +#line 288 "dtc-parser.y" /* yacc.c:1646 */
1861 {
1862 (yyval.data) = (yyvsp[-1].data);
1863 }
1864 -#line 1713 "dtc-parser.tab.c" /* yacc.c:1646 */
1865 +#line 1733 "dtc-parser.tab.c" /* yacc.c:1646 */
1866 break;
1867
1868 - case 28:
1869 -#line 276 "dtc-parser.y" /* yacc.c:1646 */
1870 + case 30:
1871 +#line 292 "dtc-parser.y" /* yacc.c:1646 */
1872 {
1873 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1874 }
1875 -#line 1721 "dtc-parser.tab.c" /* yacc.c:1646 */
1876 +#line 1741 "dtc-parser.tab.c" /* yacc.c:1646 */
1877 break;
1878
1879 - case 29:
1880 -#line 283 "dtc-parser.y" /* yacc.c:1646 */
1881 + case 31:
1882 +#line 299 "dtc-parser.y" /* yacc.c:1646 */
1883 {
1884 unsigned long long bits;
1885
1886 @@ -1737,20 +1757,20 @@ yyreduce:
1887 (yyval.array).data = empty_data;
1888 (yyval.array).bits = bits;
1889 }
1890 -#line 1741 "dtc-parser.tab.c" /* yacc.c:1646 */
1891 +#line 1761 "dtc-parser.tab.c" /* yacc.c:1646 */
1892 break;
1893
1894 - case 30:
1895 -#line 299 "dtc-parser.y" /* yacc.c:1646 */
1896 + case 32:
1897 +#line 315 "dtc-parser.y" /* yacc.c:1646 */
1898 {
1899 (yyval.array).data = empty_data;
1900 (yyval.array).bits = 32;
1901 }
1902 -#line 1750 "dtc-parser.tab.c" /* yacc.c:1646 */
1903 +#line 1770 "dtc-parser.tab.c" /* yacc.c:1646 */
1904 break;
1905
1906 - case 31:
1907 -#line 304 "dtc-parser.y" /* yacc.c:1646 */
1908 + case 33:
1909 +#line 320 "dtc-parser.y" /* yacc.c:1646 */
1910 {
1911 if ((yyvsp[-1].array).bits < 64) {
1912 uint64_t mask = (1ULL << (yyvsp[-1].array).bits) - 1;
1913 @@ -1769,11 +1789,11 @@ yyreduce:
1914
1915 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, (yyvsp[0].integer), (yyvsp[-1].array).bits);
1916 }
1917 -#line 1773 "dtc-parser.tab.c" /* yacc.c:1646 */
1918 +#line 1793 "dtc-parser.tab.c" /* yacc.c:1646 */
1919 break;
1920
1921 - case 32:
1922 -#line 323 "dtc-parser.y" /* yacc.c:1646 */
1923 + case 34:
1924 +#line 339 "dtc-parser.y" /* yacc.c:1646 */
1925 {
1926 uint64_t val = ~0ULL >> (64 - (yyvsp[-1].array).bits);
1927
1928 @@ -1787,233 +1807,233 @@ yyreduce:
1929
1930 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, val, (yyvsp[-1].array).bits);
1931 }
1932 -#line 1791 "dtc-parser.tab.c" /* yacc.c:1646 */
1933 +#line 1811 "dtc-parser.tab.c" /* yacc.c:1646 */
1934 break;
1935
1936 - case 33:
1937 -#line 337 "dtc-parser.y" /* yacc.c:1646 */
1938 + case 35:
1939 +#line 353 "dtc-parser.y" /* yacc.c:1646 */
1940 {
1941 (yyval.array).data = data_add_marker((yyvsp[-1].array).data, LABEL, (yyvsp[0].labelref));
1942 }
1943 -#line 1799 "dtc-parser.tab.c" /* yacc.c:1646 */
1944 +#line 1819 "dtc-parser.tab.c" /* yacc.c:1646 */
1945 break;
1946
1947 - case 36:
1948 -#line 346 "dtc-parser.y" /* yacc.c:1646 */
1949 + case 38:
1950 +#line 362 "dtc-parser.y" /* yacc.c:1646 */
1951 {
1952 (yyval.integer) = (yyvsp[-1].integer);
1953 }
1954 -#line 1807 "dtc-parser.tab.c" /* yacc.c:1646 */
1955 +#line 1827 "dtc-parser.tab.c" /* yacc.c:1646 */
1956 break;
1957
1958 - case 39:
1959 -#line 357 "dtc-parser.y" /* yacc.c:1646 */
1960 + case 41:
1961 +#line 373 "dtc-parser.y" /* yacc.c:1646 */
1962 { (yyval.integer) = (yyvsp[-4].integer) ? (yyvsp[-2].integer) : (yyvsp[0].integer); }
1963 -#line 1813 "dtc-parser.tab.c" /* yacc.c:1646 */
1964 +#line 1833 "dtc-parser.tab.c" /* yacc.c:1646 */
1965 break;
1966
1967 - case 41:
1968 -#line 362 "dtc-parser.y" /* yacc.c:1646 */
1969 + case 43:
1970 +#line 378 "dtc-parser.y" /* yacc.c:1646 */
1971 { (yyval.integer) = (yyvsp[-2].integer) || (yyvsp[0].integer); }
1972 -#line 1819 "dtc-parser.tab.c" /* yacc.c:1646 */
1973 +#line 1839 "dtc-parser.tab.c" /* yacc.c:1646 */
1974 break;
1975
1976 - case 43:
1977 -#line 367 "dtc-parser.y" /* yacc.c:1646 */
1978 + case 45:
1979 +#line 383 "dtc-parser.y" /* yacc.c:1646 */
1980 { (yyval.integer) = (yyvsp[-2].integer) && (yyvsp[0].integer); }
1981 -#line 1825 "dtc-parser.tab.c" /* yacc.c:1646 */
1982 +#line 1845 "dtc-parser.tab.c" /* yacc.c:1646 */
1983 break;
1984
1985 - case 45:
1986 -#line 372 "dtc-parser.y" /* yacc.c:1646 */
1987 + case 47:
1988 +#line 388 "dtc-parser.y" /* yacc.c:1646 */
1989 { (yyval.integer) = (yyvsp[-2].integer) | (yyvsp[0].integer); }
1990 -#line 1831 "dtc-parser.tab.c" /* yacc.c:1646 */
1991 +#line 1851 "dtc-parser.tab.c" /* yacc.c:1646 */
1992 break;
1993
1994 - case 47:
1995 -#line 377 "dtc-parser.y" /* yacc.c:1646 */
1996 + case 49:
1997 +#line 393 "dtc-parser.y" /* yacc.c:1646 */
1998 { (yyval.integer) = (yyvsp[-2].integer) ^ (yyvsp[0].integer); }
1999 -#line 1837 "dtc-parser.tab.c" /* yacc.c:1646 */
2000 +#line 1857 "dtc-parser.tab.c" /* yacc.c:1646 */
2001 break;
2002
2003 - case 49:
2004 -#line 382 "dtc-parser.y" /* yacc.c:1646 */
2005 + case 51:
2006 +#line 398 "dtc-parser.y" /* yacc.c:1646 */
2007 { (yyval.integer) = (yyvsp[-2].integer) & (yyvsp[0].integer); }
2008 -#line 1843 "dtc-parser.tab.c" /* yacc.c:1646 */
2009 +#line 1863 "dtc-parser.tab.c" /* yacc.c:1646 */
2010 break;
2011
2012 - case 51:
2013 -#line 387 "dtc-parser.y" /* yacc.c:1646 */
2014 + case 53:
2015 +#line 403 "dtc-parser.y" /* yacc.c:1646 */
2016 { (yyval.integer) = (yyvsp[-2].integer) == (yyvsp[0].integer); }
2017 -#line 1849 "dtc-parser.tab.c" /* yacc.c:1646 */
2018 +#line 1869 "dtc-parser.tab.c" /* yacc.c:1646 */
2019 break;
2020
2021 - case 52:
2022 -#line 388 "dtc-parser.y" /* yacc.c:1646 */
2023 + case 54:
2024 +#line 404 "dtc-parser.y" /* yacc.c:1646 */
2025 { (yyval.integer) = (yyvsp[-2].integer) != (yyvsp[0].integer); }
2026 -#line 1855 "dtc-parser.tab.c" /* yacc.c:1646 */
2027 +#line 1875 "dtc-parser.tab.c" /* yacc.c:1646 */
2028 break;
2029
2030 - case 54:
2031 -#line 393 "dtc-parser.y" /* yacc.c:1646 */
2032 + case 56:
2033 +#line 409 "dtc-parser.y" /* yacc.c:1646 */
2034 { (yyval.integer) = (yyvsp[-2].integer) < (yyvsp[0].integer); }
2035 -#line 1861 "dtc-parser.tab.c" /* yacc.c:1646 */
2036 +#line 1881 "dtc-parser.tab.c" /* yacc.c:1646 */
2037 break;
2038
2039 - case 55:
2040 -#line 394 "dtc-parser.y" /* yacc.c:1646 */
2041 + case 57:
2042 +#line 410 "dtc-parser.y" /* yacc.c:1646 */
2043 { (yyval.integer) = (yyvsp[-2].integer) > (yyvsp[0].integer); }
2044 -#line 1867 "dtc-parser.tab.c" /* yacc.c:1646 */
2045 +#line 1887 "dtc-parser.tab.c" /* yacc.c:1646 */
2046 break;
2047
2048 - case 56:
2049 -#line 395 "dtc-parser.y" /* yacc.c:1646 */
2050 + case 58:
2051 +#line 411 "dtc-parser.y" /* yacc.c:1646 */
2052 { (yyval.integer) = (yyvsp[-2].integer) <= (yyvsp[0].integer); }
2053 -#line 1873 "dtc-parser.tab.c" /* yacc.c:1646 */
2054 +#line 1893 "dtc-parser.tab.c" /* yacc.c:1646 */
2055 break;
2056
2057 - case 57:
2058 -#line 396 "dtc-parser.y" /* yacc.c:1646 */
2059 + case 59:
2060 +#line 412 "dtc-parser.y" /* yacc.c:1646 */
2061 { (yyval.integer) = (yyvsp[-2].integer) >= (yyvsp[0].integer); }
2062 -#line 1879 "dtc-parser.tab.c" /* yacc.c:1646 */
2063 +#line 1899 "dtc-parser.tab.c" /* yacc.c:1646 */
2064 break;
2065
2066 - case 58:
2067 -#line 400 "dtc-parser.y" /* yacc.c:1646 */
2068 + case 60:
2069 +#line 416 "dtc-parser.y" /* yacc.c:1646 */
2070 { (yyval.integer) = (yyvsp[-2].integer) << (yyvsp[0].integer); }
2071 -#line 1885 "dtc-parser.tab.c" /* yacc.c:1646 */
2072 +#line 1905 "dtc-parser.tab.c" /* yacc.c:1646 */
2073 break;
2074
2075 - case 59:
2076 -#line 401 "dtc-parser.y" /* yacc.c:1646 */
2077 + case 61:
2078 +#line 417 "dtc-parser.y" /* yacc.c:1646 */
2079 { (yyval.integer) = (yyvsp[-2].integer) >> (yyvsp[0].integer); }
2080 -#line 1891 "dtc-parser.tab.c" /* yacc.c:1646 */
2081 +#line 1911 "dtc-parser.tab.c" /* yacc.c:1646 */
2082 break;
2083
2084 - case 61:
2085 -#line 406 "dtc-parser.y" /* yacc.c:1646 */
2086 + case 63:
2087 +#line 422 "dtc-parser.y" /* yacc.c:1646 */
2088 { (yyval.integer) = (yyvsp[-2].integer) + (yyvsp[0].integer); }
2089 -#line 1897 "dtc-parser.tab.c" /* yacc.c:1646 */
2090 +#line 1917 "dtc-parser.tab.c" /* yacc.c:1646 */
2091 break;
2092
2093 - case 62:
2094 -#line 407 "dtc-parser.y" /* yacc.c:1646 */
2095 + case 64:
2096 +#line 423 "dtc-parser.y" /* yacc.c:1646 */
2097 { (yyval.integer) = (yyvsp[-2].integer) - (yyvsp[0].integer); }
2098 -#line 1903 "dtc-parser.tab.c" /* yacc.c:1646 */
2099 +#line 1923 "dtc-parser.tab.c" /* yacc.c:1646 */
2100 break;
2101
2102 - case 64:
2103 -#line 412 "dtc-parser.y" /* yacc.c:1646 */
2104 + case 66:
2105 +#line 428 "dtc-parser.y" /* yacc.c:1646 */
2106 { (yyval.integer) = (yyvsp[-2].integer) * (yyvsp[0].integer); }
2107 -#line 1909 "dtc-parser.tab.c" /* yacc.c:1646 */
2108 +#line 1929 "dtc-parser.tab.c" /* yacc.c:1646 */
2109 break;
2110
2111 - case 65:
2112 -#line 413 "dtc-parser.y" /* yacc.c:1646 */
2113 + case 67:
2114 +#line 429 "dtc-parser.y" /* yacc.c:1646 */
2115 { (yyval.integer) = (yyvsp[-2].integer) / (yyvsp[0].integer); }
2116 -#line 1915 "dtc-parser.tab.c" /* yacc.c:1646 */
2117 +#line 1935 "dtc-parser.tab.c" /* yacc.c:1646 */
2118 break;
2119
2120 - case 66:
2121 -#line 414 "dtc-parser.y" /* yacc.c:1646 */
2122 + case 68:
2123 +#line 430 "dtc-parser.y" /* yacc.c:1646 */
2124 { (yyval.integer) = (yyvsp[-2].integer) % (yyvsp[0].integer); }
2125 -#line 1921 "dtc-parser.tab.c" /* yacc.c:1646 */
2126 +#line 1941 "dtc-parser.tab.c" /* yacc.c:1646 */
2127 break;
2128
2129 - case 69:
2130 -#line 420 "dtc-parser.y" /* yacc.c:1646 */
2131 + case 71:
2132 +#line 436 "dtc-parser.y" /* yacc.c:1646 */
2133 { (yyval.integer) = -(yyvsp[0].integer); }
2134 -#line 1927 "dtc-parser.tab.c" /* yacc.c:1646 */
2135 +#line 1947 "dtc-parser.tab.c" /* yacc.c:1646 */
2136 break;
2137
2138 - case 70:
2139 -#line 421 "dtc-parser.y" /* yacc.c:1646 */
2140 + case 72:
2141 +#line 437 "dtc-parser.y" /* yacc.c:1646 */
2142 { (yyval.integer) = ~(yyvsp[0].integer); }
2143 -#line 1933 "dtc-parser.tab.c" /* yacc.c:1646 */
2144 +#line 1953 "dtc-parser.tab.c" /* yacc.c:1646 */
2145 break;
2146
2147 - case 71:
2148 -#line 422 "dtc-parser.y" /* yacc.c:1646 */
2149 + case 73:
2150 +#line 438 "dtc-parser.y" /* yacc.c:1646 */
2151 { (yyval.integer) = !(yyvsp[0].integer); }
2152 -#line 1939 "dtc-parser.tab.c" /* yacc.c:1646 */
2153 +#line 1959 "dtc-parser.tab.c" /* yacc.c:1646 */
2154 break;
2155
2156 - case 72:
2157 -#line 427 "dtc-parser.y" /* yacc.c:1646 */
2158 + case 74:
2159 +#line 443 "dtc-parser.y" /* yacc.c:1646 */
2160 {
2161 (yyval.data) = empty_data;
2162 }
2163 -#line 1947 "dtc-parser.tab.c" /* yacc.c:1646 */
2164 +#line 1967 "dtc-parser.tab.c" /* yacc.c:1646 */
2165 break;
2166
2167 - case 73:
2168 -#line 431 "dtc-parser.y" /* yacc.c:1646 */
2169 + case 75:
2170 +#line 447 "dtc-parser.y" /* yacc.c:1646 */
2171 {
2172 (yyval.data) = data_append_byte((yyvsp[-1].data), (yyvsp[0].byte));
2173 }
2174 -#line 1955 "dtc-parser.tab.c" /* yacc.c:1646 */
2175 +#line 1975 "dtc-parser.tab.c" /* yacc.c:1646 */
2176 break;
2177
2178 - case 74:
2179 -#line 435 "dtc-parser.y" /* yacc.c:1646 */
2180 + case 76:
2181 +#line 451 "dtc-parser.y" /* yacc.c:1646 */
2182 {
2183 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
2184 }
2185 -#line 1963 "dtc-parser.tab.c" /* yacc.c:1646 */
2186 +#line 1983 "dtc-parser.tab.c" /* yacc.c:1646 */
2187 break;
2188
2189 - case 75:
2190 -#line 442 "dtc-parser.y" /* yacc.c:1646 */
2191 + case 77:
2192 +#line 458 "dtc-parser.y" /* yacc.c:1646 */
2193 {
2194 (yyval.nodelist) = NULL;
2195 }
2196 -#line 1971 "dtc-parser.tab.c" /* yacc.c:1646 */
2197 +#line 1991 "dtc-parser.tab.c" /* yacc.c:1646 */
2198 break;
2199
2200 - case 76:
2201 -#line 446 "dtc-parser.y" /* yacc.c:1646 */
2202 + case 78:
2203 +#line 462 "dtc-parser.y" /* yacc.c:1646 */
2204 {
2205 (yyval.nodelist) = chain_node((yyvsp[-1].node), (yyvsp[0].nodelist));
2206 }
2207 -#line 1979 "dtc-parser.tab.c" /* yacc.c:1646 */
2208 +#line 1999 "dtc-parser.tab.c" /* yacc.c:1646 */
2209 break;
2210
2211 - case 77:
2212 -#line 450 "dtc-parser.y" /* yacc.c:1646 */
2213 + case 79:
2214 +#line 466 "dtc-parser.y" /* yacc.c:1646 */
2215 {
2216 ERROR(&(yylsp[0]), "Properties must precede subnodes");
2217 YYERROR;
2218 }
2219 -#line 1988 "dtc-parser.tab.c" /* yacc.c:1646 */
2220 +#line 2008 "dtc-parser.tab.c" /* yacc.c:1646 */
2221 break;
2222
2223 - case 78:
2224 -#line 458 "dtc-parser.y" /* yacc.c:1646 */
2225 + case 80:
2226 +#line 474 "dtc-parser.y" /* yacc.c:1646 */
2227 {
2228 (yyval.node) = name_node((yyvsp[0].node), (yyvsp[-1].propnodename));
2229 }
2230 -#line 1996 "dtc-parser.tab.c" /* yacc.c:1646 */
2231 +#line 2016 "dtc-parser.tab.c" /* yacc.c:1646 */
2232 break;
2233
2234 - case 79:
2235 -#line 462 "dtc-parser.y" /* yacc.c:1646 */
2236 + case 81:
2237 +#line 478 "dtc-parser.y" /* yacc.c:1646 */
2238 {
2239 (yyval.node) = name_node(build_node_delete(), (yyvsp[-1].propnodename));
2240 }
2241 -#line 2004 "dtc-parser.tab.c" /* yacc.c:1646 */
2242 +#line 2024 "dtc-parser.tab.c" /* yacc.c:1646 */
2243 break;
2244
2245 - case 80:
2246 -#line 466 "dtc-parser.y" /* yacc.c:1646 */
2247 + case 82:
2248 +#line 482 "dtc-parser.y" /* yacc.c:1646 */
2249 {
2250 add_label(&(yyvsp[0].node)->labels, (yyvsp[-1].labelref));
2251 (yyval.node) = (yyvsp[0].node);
2252 }
2253 -#line 2013 "dtc-parser.tab.c" /* yacc.c:1646 */
2254 +#line 2033 "dtc-parser.tab.c" /* yacc.c:1646 */
2255 break;
2256
2257
2258 -#line 2017 "dtc-parser.tab.c" /* yacc.c:1646 */
2259 +#line 2037 "dtc-parser.tab.c" /* yacc.c:1646 */
2260 default: break;
2261 }
2262 /* User semantic actions sometimes alter yychar, and that requires
2263 @@ -2248,7 +2268,7 @@ yyreturn:
2264 #endif
2265 return yyresult;
2266 }
2267 -#line 472 "dtc-parser.y" /* yacc.c:1906 */
2268 +#line 488 "dtc-parser.y" /* yacc.c:1906 */
2269
2270
2271 void yyerror(char const *s)
2272 --- a/scripts/dtc/dtc-parser.tab.h_shipped
2273 +++ b/scripts/dtc/dtc-parser.tab.h_shipped
2274 @@ -46,26 +46,27 @@ extern int yydebug;
2275 enum yytokentype
2276 {
2277 DT_V1 = 258,
2278 - DT_MEMRESERVE = 259,
2279 - DT_LSHIFT = 260,
2280 - DT_RSHIFT = 261,
2281 - DT_LE = 262,
2282 - DT_GE = 263,
2283 - DT_EQ = 264,
2284 - DT_NE = 265,
2285 - DT_AND = 266,
2286 - DT_OR = 267,
2287 - DT_BITS = 268,
2288 - DT_DEL_PROP = 269,
2289 - DT_DEL_NODE = 270,
2290 - DT_PROPNODENAME = 271,
2291 - DT_LITERAL = 272,
2292 - DT_CHAR_LITERAL = 273,
2293 - DT_BYTE = 274,
2294 - DT_STRING = 275,
2295 - DT_LABEL = 276,
2296 - DT_REF = 277,
2297 - DT_INCBIN = 278
2298 + DT_PLUGIN = 259,
2299 + DT_MEMRESERVE = 260,
2300 + DT_LSHIFT = 261,
2301 + DT_RSHIFT = 262,
2302 + DT_LE = 263,
2303 + DT_GE = 264,
2304 + DT_EQ = 265,
2305 + DT_NE = 266,
2306 + DT_AND = 267,
2307 + DT_OR = 268,
2308 + DT_BITS = 269,
2309 + DT_DEL_PROP = 270,
2310 + DT_DEL_NODE = 271,
2311 + DT_PROPNODENAME = 272,
2312 + DT_LITERAL = 273,
2313 + DT_CHAR_LITERAL = 274,
2314 + DT_BYTE = 275,
2315 + DT_STRING = 276,
2316 + DT_LABEL = 277,
2317 + DT_REF = 278,
2318 + DT_INCBIN = 279
2319 };
2320 #endif
2321
2322 @@ -74,7 +75,7 @@ extern int yydebug;
2323 typedef union YYSTYPE YYSTYPE;
2324 union YYSTYPE
2325 {
2326 -#line 38 "dtc-parser.y" /* yacc.c:1909 */
2327 +#line 39 "dtc-parser.y" /* yacc.c:1909 */
2328
2329 char *propnodename;
2330 char *labelref;
2331 @@ -92,8 +93,9 @@ union YYSTYPE
2332 struct node *nodelist;
2333 struct reserve_info *re;
2334 uint64_t integer;
2335 + bool is_plugin;
2336
2337 -#line 97 "dtc-parser.tab.h" /* yacc.c:1909 */
2338 +#line 99 "dtc-parser.tab.h" /* yacc.c:1909 */
2339 };
2340 # define YYSTYPE_IS_TRIVIAL 1
2341 # define YYSTYPE_IS_DECLARED 1
2342 --- a/scripts/dtc/dtc-parser.y
2343 +++ b/scripts/dtc/dtc-parser.y
2344 @@ -19,6 +19,7 @@
2345 */
2346 %{
2347 #include <stdio.h>
2348 +#include <inttypes.h>
2349
2350 #include "dtc.h"
2351 #include "srcpos.h"
2352 @@ -52,9 +53,11 @@ extern bool treesource_error;
2353 struct node *nodelist;
2354 struct reserve_info *re;
2355 uint64_t integer;
2356 + bool is_plugin;
2357 }
2358
2359 %token DT_V1
2360 +%token DT_PLUGIN
2361 %token DT_MEMRESERVE
2362 %token DT_LSHIFT DT_RSHIFT DT_LE DT_GE DT_EQ DT_NE DT_AND DT_OR
2363 %token DT_BITS
2364 @@ -71,6 +74,7 @@ extern bool treesource_error;
2365
2366 %type <data> propdata
2367 %type <data> propdataprefix
2368 +%type <is_plugin> plugindecl
2369 %type <re> memreserve
2370 %type <re> memreserves
2371 %type <array> arrayprefix
2372 @@ -101,10 +105,22 @@ extern bool treesource_error;
2373 %%
2374
2375 sourcefile:
2376 - DT_V1 ';' memreserves devicetree
2377 + DT_V1 ';' plugindecl memreserves devicetree
2378 {
2379 - the_boot_info = build_boot_info($3, $4,
2380 - guess_boot_cpuid($4));
2381 + $5->is_plugin = $3;
2382 + the_boot_info = build_boot_info($4, $5,
2383 + guess_boot_cpuid($5));
2384 + }
2385 + ;
2386 +
2387 +plugindecl:
2388 + /* empty */
2389 + {
2390 + $$ = false;
2391 + }
2392 + | DT_PLUGIN ';'
2393 + {
2394 + $$ = true;
2395 }
2396 ;
2397
2398 --- a/scripts/dtc/dtc.c
2399 +++ b/scripts/dtc/dtc.c
2400 @@ -29,6 +29,7 @@ int reservenum; /* Number of memory res
2401 int minsize; /* Minimum blob size */
2402 int padsize; /* Additional padding to blob */
2403 int phandle_format = PHANDLE_BOTH; /* Use linux,phandle or phandle properties */
2404 +int symbol_fixup_support = 0;
2405
2406 static void fill_fullpaths(struct node *tree, const char *prefix)
2407 {
2408 @@ -51,7 +52,7 @@ static void fill_fullpaths(struct node *
2409 #define FDT_VERSION(version) _FDT_VERSION(version)
2410 #define _FDT_VERSION(version) #version
2411 static const char usage_synopsis[] = "dtc [options] <input file>";
2412 -static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv";
2413 +static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:@hv";
2414 static struct option const usage_long_opts[] = {
2415 {"quiet", no_argument, NULL, 'q'},
2416 {"in-format", a_argument, NULL, 'I'},
2417 @@ -69,6 +70,7 @@ static struct option const usage_long_op
2418 {"phandle", a_argument, NULL, 'H'},
2419 {"warning", a_argument, NULL, 'W'},
2420 {"error", a_argument, NULL, 'E'},
2421 + {"symbols", no_argument, NULL, '@'},
2422 {"help", no_argument, NULL, 'h'},
2423 {"version", no_argument, NULL, 'v'},
2424 {NULL, no_argument, NULL, 0x0},
2425 @@ -99,6 +101,7 @@ static const char * const usage_opts_hel
2426 "\t\tboth - Both \"linux,phandle\" and \"phandle\" properties",
2427 "\n\tEnable/disable warnings (prefix with \"no-\")",
2428 "\n\tEnable/disable errors (prefix with \"no-\")",
2429 + "\n\tEnable symbols/fixup support",
2430 "\n\tPrint this help and exit",
2431 "\n\tPrint version and exit",
2432 NULL,
2433 @@ -186,7 +189,9 @@ int main(int argc, char *argv[])
2434 case 'E':
2435 parse_checks_option(false, true, optarg);
2436 break;
2437 -
2438 + case '@':
2439 + symbol_fixup_support = 1;
2440 + break;
2441 case 'h':
2442 usage(NULL);
2443 default:
2444 --- a/scripts/dtc/dtc.h
2445 +++ b/scripts/dtc/dtc.h
2446 @@ -54,6 +54,7 @@ extern int reservenum; /* Number of mem
2447 extern int minsize; /* Minimum blob size */
2448 extern int padsize; /* Additional padding to blob */
2449 extern int phandle_format; /* Use linux,phandle or phandle properties */
2450 +extern int symbol_fixup_support;/* enable symbols & fixup support */
2451
2452 #define PHANDLE_LEGACY 0x1
2453 #define PHANDLE_EPAPR 0x2
2454 @@ -132,6 +133,26 @@ struct label {
2455 struct label *next;
2456 };
2457
2458 +struct fixup_entry {
2459 + int offset;
2460 + struct node *node;
2461 + struct property *prop;
2462 + struct fixup_entry *next;
2463 + bool local_fixup_generated;
2464 +};
2465 +
2466 +struct fixup {
2467 + char *ref;
2468 + struct fixup_entry *entries;
2469 + struct fixup *next;
2470 +};
2471 +
2472 +struct symbol {
2473 + struct label *label;
2474 + struct node *node;
2475 + struct symbol *next;
2476 +};
2477 +
2478 struct property {
2479 bool deleted;
2480 char *name;
2481 @@ -158,6 +179,13 @@ struct node {
2482 int addr_cells, size_cells;
2483
2484 struct label *labels;
2485 +
2486 + struct symbol *symbols;
2487 + struct fixup_entry *local_fixups;
2488 + bool emit_local_fixup_node;
2489 +
2490 + bool is_plugin;
2491 + struct fixup *fixups;
2492 };
2493
2494 #define for_each_label_withdel(l0, l) \
2495 @@ -181,6 +209,18 @@ struct node {
2496 for_each_child_withdel(n, c) \
2497 if (!(c)->deleted)
2498
2499 +#define for_each_fixup(n, f) \
2500 + for ((f) = (n)->fixups; (f); (f) = (f)->next)
2501 +
2502 +#define for_each_fixup_entry(f, fe) \
2503 + for ((fe) = (f)->entries; (fe); (fe) = (fe)->next)
2504 +
2505 +#define for_each_symbol(n, s) \
2506 + for ((s) = (n)->symbols; (s); (s) = (s)->next)
2507 +
2508 +#define for_each_local_fixup_entry(n, fe) \
2509 + for ((fe) = (n)->local_fixups; (fe); (fe) = (fe)->next)
2510 +
2511 void add_label(struct label **labels, char *label);
2512 void delete_labels(struct label **labels);
2513
2514 --- a/scripts/dtc/flattree.c
2515 +++ b/scripts/dtc/flattree.c
2516 @@ -255,6 +255,204 @@ static int stringtable_insert(struct dat
2517 return i;
2518 }
2519
2520 +static void emit_local_fixups(struct node *tree, struct emitter *emit,
2521 + void *etarget, struct data *strbuf, struct version_info *vi,
2522 + struct node *node)
2523 +{
2524 + struct fixup_entry *fe, *fen;
2525 + struct node *child;
2526 + int nameoff, count;
2527 + cell_t *buf;
2528 + struct data d;
2529 +
2530 + if (node->emit_local_fixup_node) {
2531 +
2532 + /* emit the external fixups (do not emit /) */
2533 + if (node != tree) {
2534 + emit->beginnode(etarget, NULL);
2535 + emit->string(etarget, node->name, 0);
2536 + emit->align(etarget, sizeof(cell_t));
2537 + }
2538 +
2539 + for_each_local_fixup_entry(tree, fe) {
2540 + if (fe->node != node || fe->local_fixup_generated)
2541 + continue;
2542 +
2543 + /* count the number of fixup entries */
2544 + count = 0;
2545 + for_each_local_fixup_entry(tree, fen) {
2546 + if (fen->prop != fe->prop)
2547 + continue;
2548 + fen->local_fixup_generated = true;
2549 + count++;
2550 + }
2551 +
2552 + /* allocate buffer */
2553 + buf = xmalloc(count * sizeof(cell_t));
2554 +
2555 + /* collect all the offsets in buffer */
2556 + count = 0;
2557 + for_each_local_fixup_entry(tree, fen) {
2558 + if (fen->prop != fe->prop)
2559 + continue;
2560 + fen->local_fixup_generated = true;
2561 + buf[count++] = cpu_to_fdt32(fen->offset);
2562 + }
2563 + d = empty_data;
2564 + d.len = count * sizeof(cell_t);
2565 + d.val = (char *)buf;
2566 +
2567 + nameoff = stringtable_insert(strbuf, fe->prop->name);
2568 + emit->property(etarget, fe->prop->labels);
2569 + emit->cell(etarget, count * sizeof(cell_t));
2570 + emit->cell(etarget, nameoff);
2571 +
2572 + if ((vi->flags & FTF_VARALIGN) &&
2573 + (count * sizeof(cell_t)) >= 8)
2574 + emit->align(etarget, 8);
2575 +
2576 + emit->data(etarget, d);
2577 + emit->align(etarget, sizeof(cell_t));
2578 +
2579 + free(buf);
2580 + }
2581 + }
2582 +
2583 + for_each_child(node, child)
2584 + emit_local_fixups(tree, emit, etarget, strbuf, vi, child);
2585 +
2586 + if (node->emit_local_fixup_node && node != tree)
2587 + emit->endnode(etarget, tree->labels);
2588 +}
2589 +
2590 +static void emit_symbols_node(struct node *tree, struct emitter *emit,
2591 + void *etarget, struct data *strbuf,
2592 + struct version_info *vi)
2593 +{
2594 + struct symbol *sym;
2595 + int nameoff, vallen;
2596 +
2597 + /* do nothing if no symbols */
2598 + if (!tree->symbols)
2599 + return;
2600 +
2601 + emit->beginnode(etarget, NULL);
2602 + emit->string(etarget, "__symbols__", 0);
2603 + emit->align(etarget, sizeof(cell_t));
2604 +
2605 + for_each_symbol(tree, sym) {
2606 +
2607 + vallen = strlen(sym->node->fullpath);
2608 +
2609 + nameoff = stringtable_insert(strbuf, sym->label->label);
2610 +
2611 + emit->property(etarget, NULL);
2612 + emit->cell(etarget, vallen + 1);
2613 + emit->cell(etarget, nameoff);
2614 +
2615 + if ((vi->flags & FTF_VARALIGN) && vallen >= 8)
2616 + emit->align(etarget, 8);
2617 +
2618 + emit->string(etarget, sym->node->fullpath,
2619 + strlen(sym->node->fullpath));
2620 + emit->align(etarget, sizeof(cell_t));
2621 + }
2622 +
2623 + emit->endnode(etarget, NULL);
2624 +}
2625 +
2626 +static void emit_local_fixups_node(struct node *tree, struct emitter *emit,
2627 + void *etarget, struct data *strbuf,
2628 + struct version_info *vi)
2629 +{
2630 + struct fixup_entry *fe;
2631 + struct node *node;
2632 +
2633 + /* do nothing if no local fixups */
2634 + if (!tree->local_fixups)
2635 + return;
2636 +
2637 + /* mark all nodes that need a local fixup generated (and parents) */
2638 + for_each_local_fixup_entry(tree, fe) {
2639 + node = fe->node;
2640 + while (node != NULL && !node->emit_local_fixup_node) {
2641 + node->emit_local_fixup_node = true;
2642 + node = node->parent;
2643 + }
2644 + }
2645 +
2646 + /* emit the local fixups node now */
2647 + emit->beginnode(etarget, NULL);
2648 + emit->string(etarget, "__local_fixups__", 0);
2649 + emit->align(etarget, sizeof(cell_t));
2650 +
2651 + emit_local_fixups(tree, emit, etarget, strbuf, vi, tree);
2652 +
2653 + emit->endnode(etarget, tree->labels);
2654 +}
2655 +
2656 +static void emit_fixups_node(struct node *tree, struct emitter *emit,
2657 + void *etarget, struct data *strbuf,
2658 + struct version_info *vi)
2659 +{
2660 + struct fixup *f;
2661 + struct fixup_entry *fe;
2662 + char *name, *s;
2663 + const char *fullpath;
2664 + int namesz, nameoff, vallen;
2665 +
2666 + /* do nothing if no fixups */
2667 + if (!tree->fixups)
2668 + return;
2669 +
2670 + /* emit the external fixups */
2671 + emit->beginnode(etarget, NULL);
2672 + emit->string(etarget, "__fixups__", 0);
2673 + emit->align(etarget, sizeof(cell_t));
2674 +
2675 + for_each_fixup(tree, f) {
2676 +
2677 + namesz = 0;
2678 + for_each_fixup_entry(f, fe) {
2679 + fullpath = fe->node->fullpath;
2680 + if (fullpath[0] == '\0')
2681 + fullpath = "/";
2682 + namesz += strlen(fullpath) + 1;
2683 + namesz += strlen(fe->prop->name) + 1;
2684 + namesz += 32; /* space for :<number> + '\0' */
2685 + }
2686 +
2687 + name = xmalloc(namesz);
2688 +
2689 + s = name;
2690 + for_each_fixup_entry(f, fe) {
2691 + fullpath = fe->node->fullpath;
2692 + if (fullpath[0] == '\0')
2693 + fullpath = "/";
2694 + snprintf(s, name + namesz - s, "%s:%s:%d", fullpath,
2695 + fe->prop->name, fe->offset);
2696 + s += strlen(s) + 1;
2697 + }
2698 +
2699 + nameoff = stringtable_insert(strbuf, f->ref);
2700 + vallen = s - name - 1;
2701 +
2702 + emit->property(etarget, NULL);
2703 + emit->cell(etarget, vallen + 1);
2704 + emit->cell(etarget, nameoff);
2705 +
2706 + if ((vi->flags & FTF_VARALIGN) && vallen >= 8)
2707 + emit->align(etarget, 8);
2708 +
2709 + emit->string(etarget, name, vallen);
2710 + emit->align(etarget, sizeof(cell_t));
2711 +
2712 + free(name);
2713 + }
2714 +
2715 + emit->endnode(etarget, tree->labels);
2716 +}
2717 +
2718 static void flatten_tree(struct node *tree, struct emitter *emit,
2719 void *etarget, struct data *strbuf,
2720 struct version_info *vi)
2721 @@ -310,6 +508,10 @@ static void flatten_tree(struct node *tr
2722 flatten_tree(child, emit, etarget, strbuf, vi);
2723 }
2724
2725 + emit_symbols_node(tree, emit, etarget, strbuf, vi);
2726 + emit_local_fixups_node(tree, emit, etarget, strbuf, vi);
2727 + emit_fixups_node(tree, emit, etarget, strbuf, vi);
2728 +
2729 emit->endnode(etarget, tree->labels);
2730 }
2731
2732 --- a/scripts/dtc/version_gen.h
2733 +++ b/scripts/dtc/version_gen.h
2734 @@ -1 +1 @@
2735 -#define DTC_VERSION "DTC 1.4.1-g9d3649bd"
2736 +#define DTC_VERSION "DTC 1.4.1-g25efc119"