[PATCH] dtc: fix endian issue when reading blobs

STALE7333d

2 messages, 1 author, 2006-07-07 · open the first message on its own page

[PATCH] dtc: fix endian issue when reading blobs

From: Michael Neuling <hidden>
Date: 2006-07-07 05:53:10

The reserve mem regions are screwy if you read a blob on x86.  I'm
guessing there may be a few more of these lurking in the code. 

Signed-off-by: Michael Neuling <redacted>

---
This now gives clean diffs between running on big and little endian machines.

 flattree.c |    2 ++
 1 file changed, 2 insertions(+)

Index: dtc/flattree.c
===================================================================
--- dtc.orig/flattree.c
+++ dtc/flattree.c
@@ -619,6 +619,8 @@ static struct reserve_info *flat_read_me
 	p = inb->ptr;
 	while (1) {
 		flat_read_chunk(inb, &re, sizeof(re));
+		re.address  = cpu_to_be64(re.address);
+		re.size = cpu_to_be64(re.size);
 		if (re.size == 0)
 			break;
 

Re: [PATCH] dtc: fix endian issue when reading blobs

From: Michael Neuling <hidden>
Date: 2006-07-07 13:28:10

The reserve mem regions are screwy if you read a blob on x86.  I'm
guessing there may be a few more of these lurking in the code. 

Signed-off-by: Michael Neuling <redacted>

---
Oops.. wrong way around.. thanks Milton.

 flattree.c |    2 ++
 1 file changed, 2 insertions(+)

Index: dtc/flattree.c
===================================================================
--- dtc.orig/flattree.c
+++ dtc/flattree.c
@@ -619,6 +619,8 @@ static struct reserve_info *flat_read_me
 	p = inb->ptr;
 	while (1) {
 		flat_read_chunk(inb, &re, sizeof(re));
+		re.address  = be64_to_cpu(re.address);
+		re.size = be64_to_cpu(re.size);
 		if (re.size == 0)
 			break;
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help