* [PATCH] dtc: fix endian issue when reading blobs
@ 2006-07-07 5:53 Michael Neuling
2006-07-07 13:28 ` Michael Neuling
0 siblings, 1 reply; 3+ messages in thread
From: Michael Neuling @ 2006-07-07 5:53 UTC (permalink / raw)
To: linuxppc-dev, Jon Loeliger
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 <mikey@neuling.org>
---
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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dtc: fix endian issue when reading blobs
2006-07-07 5:53 [PATCH] dtc: fix endian issue when reading blobs Michael Neuling
@ 2006-07-07 13:28 ` Michael Neuling
2006-07-07 14:36 ` Jon Loeliger
0 siblings, 1 reply; 3+ messages in thread
From: Michael Neuling @ 2006-07-07 13:28 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Jon Loeliger, miltonm
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 <mikey@neuling.org>
---
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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dtc: fix endian issue when reading blobs
2006-07-07 13:28 ` Michael Neuling
@ 2006-07-07 14:36 ` Jon Loeliger
0 siblings, 0 replies; 3+ messages in thread
From: Jon Loeliger @ 2006-07-07 14:36 UTC (permalink / raw)
To: Michael Neuling; +Cc: linuxppc-dev, miltonm
So, like, the other day Michael Neuling mumbled:
> 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 <mikey@neuling.org>
>
> ---
> Oops.. wrong way around.. thanks Milton.
>
> flattree.c | 2 ++
> 1 file changed, 2 insertions(+)
Your wish has been granted.
Thanks!
jdl
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-07-07 14:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-07 5:53 [PATCH] dtc: fix endian issue when reading blobs Michael Neuling
2006-07-07 13:28 ` Michael Neuling
2006-07-07 14:36 ` Jon Loeliger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).