[Crosstoolchain-logs] [device-tree-compiler] 38/357: The problem is that asm_emit_cell() was swapping its asm output when it shouldn't be (because the assembler will do the necessary swapping). The cell values (asm_emit_cell()) are different from the data values (asm_emit_data()) because the cell values are generated within the program and don't get swapped like the data values read from the dts file. They should be left as they are so that the assembler will swap them, if necessary. For example, when the property length field was 4, the asm output contained ".long 0x4000000" and sent the kernel prom.c dt parsing code into the weeds.

Hector Oron zumbi at moszumanska.debian.org
Thu Dec 8 17:05:46 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 7a9f663ac7ef1218ffe3aaab66f1bf66d54eaf0a
Author: Mark A. Greer <mgreer at mvista.com>
Date:   Wed Mar 15 18:59:24 2006 -0700

    The problem is that asm_emit_cell() was swapping its asm output when
    it shouldn't be (because the assembler will do the necessary swapping).
    The cell values (asm_emit_cell()) are different from the data values
    (asm_emit_data()) because the cell values are generated within the
    program and don't get swapped like the data values read from the dts file.
    They should be left as they are so that the assembler will swap them,
    if necessary.  For example, when the property length field was 4,
    the asm output contained ".long 0x4000000" and sent the kernel prom.c
    dt parsing code into the weeds.
    
    Pointed out by Mark Greer.
---
 flattree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flattree.c b/flattree.c
index 474f1c1..73dd409 100644
--- a/flattree.c
+++ b/flattree.c
@@ -121,7 +121,7 @@ static void asm_emit_cell(void *e, cell_t val)
 {
 	FILE *f = e;
 
-	fprintf(f, "\t.long\t0x%x\n", be32_to_cpu(val));
+	fprintf(f, "\t.long\t0x%x\n", val);
 }
 
 static void asm_emit_string(void *e, char *str, int len)

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