[Crosstoolchain-logs] [device-tree-compiler] 15/58: dtc: Clean up /dts-v1/ and /plugin/ handling in grammar

Vagrant Cascadian vagrant at moszumanska.debian.org
Mon Sep 25 16:23:45 UTC 2017


This is an automated email from the git hooks/post-receive script.

vagrant pushed a commit to branch debian/master
in repository device-tree-compiler.

commit 1ef86ad2c24f67567b1021ca5cb84bea82749f88
Author: David Gibson <david at gibson.dropbear.id.au>
Date:   Fri Dec 9 16:23:23 2016 +1100

    dtc: Clean up /dts-v1/ and /plugin/ handling in grammar
    
    First remove the non-terminal name 'versioninfo' - /plugin/ doesn't really
    indicate a "version" per se, and version could be confused with the dtb
    output version.
    
    Second allow the /dts-v1/; /plugin/; sequence to be repeated, for easier
    use of include files - but ensure that all copies match, so you can't
    include a file declaring /plugin/ in one that doesn't, or vice versa.
    
    Signed-off-by: David Gibson <david at gibson.dropbear.id.au>
---
 dtc-parser.y | 35 +++++++++++++++++------------------
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/dtc-parser.y b/dtc-parser.y
index 27d358f..761ce8a 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -74,8 +74,8 @@ extern bool treesource_error;
 
 %type <data> propdata
 %type <data> propdataprefix
-%type <flags> versioninfo
-%type <flags> plugindecl
+%type <flags> header
+%type <flags> headers
 %type <re> memreserve
 %type <re> memreserves
 %type <array> arrayprefix
@@ -106,32 +106,31 @@ extern bool treesource_error;
 %%
 
 sourcefile:
-	  versioninfo plugindecl memreserves devicetree
+	  headers memreserves devicetree
 		{
-			the_boot_info = build_boot_info($1 | $2, $3, $4,
-							guess_boot_cpuid($4));
+			the_boot_info = build_boot_info($1, $2, $3,
+			                                guess_boot_cpuid($3));
 		}
 	;
 
-versioninfo:
-	v1tag
+header:
+	  DT_V1 ';'
 		{
 			$$ = DTSF_V1;
 		}
-	;
-
-v1tag:
-	  DT_V1 ';'
-	| DT_V1 ';' v1tag
-
-plugindecl:
-	DT_PLUGIN ';'
+	| DT_V1 ';' DT_PLUGIN ';'
 		{
-			$$ = DTSF_PLUGIN;
+			$$ = DTSF_V1 | DTSF_PLUGIN;
 		}
-	| /* empty */
+	;
+
+headers:
+	  header
+	| header headers
 		{
-			$$ = 0;
+			if ($2 != $1)
+				ERROR(&@2, "Header flags don't match earlier ones");
+			$$ = $1;
 		}
 	;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/device-tree-compiler.git



More information about the Crosstoolchain-logs mailing list