linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH dtc take 2] Fix reserve map output for asm format.
@ 2007-04-15  2:29 Jerry Van Baren
  2007-04-15 19:59 ` Milton Miller
  0 siblings, 1 reply; 9+ messages in thread
From: Jerry Van Baren @ 2007-04-15  2:29 UTC (permalink / raw)
  To: linuxppc-dev, jdl

Add extra reserve map slots output for asm format (previously done for dtb
  output).

Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
---

Hi Jon, David,

Here is a patch that fixes the asm output without the (unnecessary)
calloc change.

Best regards,
gvb

 flattree.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/flattree.c b/flattree.c
index 151d16e..6f0c9b7 100644
--- a/flattree.c
+++ b/flattree.c
@@ -21,6 +21,9 @@
 #include "dtc.h"
 #include "flat_dt.h"
 
+#define WARNMSG(...) if (quiet < 1) fprintf(stderr, "Warning: " __VA_ARGS__)
+
+
 #define FTF_FULLPATH	0x1
 #define FTF_VARALIGN	0x2
 #define FTF_NAMEPROPS	0x4
@@ -490,6 +493,9 @@ void dt_to_asm(FILE *f, struct boot_info *bi, int version, int boot_cpuid_phys)
 			(unsigned int)(re->re.size >> 32),
 			(unsigned int)(re->re.size & 0xffffffff));
 	}
+	for (i = 0; i < reservenum; i++) {
+		fprintf(f, "\t.long\t0, 0\n\t.long\t0, 0\n");
+	}
 
 	fprintf(f, "\t.long\t0, 0\n\t.long\t0, 0\n");
 
@@ -818,9 +824,11 @@ struct boot_info *dt_from_blob(FILE *f)
 	p = blob + sizeof(magic)  + sizeof(totalsize);
 
 	while (sizeleft) {
-		if (feof(f))
-			die("EOF before reading %d bytes of DT blob\n",
-			    totalsize);
+		if (feof(f)) {
+			WARNMSG("EOF after reading %d of %d bytes of DT blob, assuming there is extra space in the blob.\n",
+			    totalsize - sizeleft, totalsize);
+			break;
+		}
 
 		rc = fread(p, 1, sizeleft, f);
 		if (ferror(f))
-- 
1.4.4.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-04-16  6:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-15  2:29 [PATCH dtc take 2] Fix reserve map output for asm format Jerry Van Baren
2007-04-15 19:59 ` Milton Miller
2007-04-16  0:24   ` Jerry Van Baren
2007-04-16  0:51     ` David Gibson
2007-04-16  1:20       ` Jerry Van Baren
2007-04-16  3:49       ` Milton Miller
2007-04-16  4:16         ` David Gibson
2007-04-16  5:08           ` Milton Miller
2007-04-16  6:30             ` David Gibson

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