[Crosstoolchain-logs] [device-tree-compiler] 113/357: dtc: implement labels on memory reserve slots

Hector Oron zumbi at moszumanska.debian.org
Thu Dec 8 17:05:56 UTC 2016


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

zumbi pushed a commit to branch upstream/1.3.x
in repository device-tree-compiler.

commit d4290338514abdfac372aa9a7af180543c0622ad
Author: Milton Miller <miltonm at bga.com>
Date:   Sat Jul 7 01:18:49 2007 -0500

    dtc: implement labels on memory reserve slots
    
    Allow a label to be placed on a memory reserve entry.
    Change the parser to recognize and store them.  Emit
    them when writing assembly output.
    
    Signed-off-by: Milton Miller <miltonm at bga.com>
---
 dtc-parser.y | 8 ++++----
 flattree.c   | 4 ++++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dtc-parser.y b/dtc-parser.y
index 9e7fbcc..d88cbf1 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -92,11 +92,11 @@ memreserves:	memreserve memreserves {
 		}
 	;
 
-memreserve:	DT_MEMRESERVE DT_ADDR DT_ADDR ';' {
-			$$ = build_reserve_entry($2, $3, NULL);
+memreserve:	label DT_MEMRESERVE DT_ADDR DT_ADDR ';' {
+			$$ = build_reserve_entry($3, $4, $1);
 		}
-	|	DT_MEMRESERVE DT_ADDR '-' DT_ADDR ';' {
-			$$ = build_reserve_entry($2, $4 - $2 + 1, NULL);
+	|	label DT_MEMRESERVE DT_ADDR '-' DT_ADDR ';' {
+			$$ = build_reserve_entry($3, $5 - $3 + 1, $1);
 		}
 	;
 
diff --git a/flattree.c b/flattree.c
index a6b66e7..31609d6 100644
--- a/flattree.c
+++ b/flattree.c
@@ -497,6 +497,10 @@ void dt_to_asm(FILE *f, struct boot_info *bi, int version, int boot_cpuid_phys)
 	 * as it appears .quad isn't available in some assemblers.
 	 */
 	for (re = bi->reservelist; re; re = re->next) {
+		if (re->label) {
+			fprintf(f, "\t.globl\t%s\n", re->label);
+			fprintf(f, "%s:\n", re->label);
+		}
 		fprintf(f, "\t.long\t0x%08x\n\t.long\t0x%08x\n",
 			(unsigned int)(re->re.address >> 32),
 			(unsigned int)(re->re.address & 0xffffffff));

-- 
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