linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* DTC: write_dt_blob() question
@ 2005-07-13 16:16 Jon Loeliger
  2005-07-14  1:28 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Loeliger @ 2005-07-13 16:16 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev@ozlabs.org

David,

Over in flattree.c's write_dt_blob() there is this code:

	make_bph(&bph, vi, reservenum, dtbuf.len, strbuf.len);

	/* Align the reserve map to an 8 byte boundary */
	for (i = vi->hdr_size; i < be32_to_cpu(bph.off_mem_rsvmap); i++)
		fputc(0, f);

	fwrite(&bph, vi->hdr_size, 1, f);
	for (i = 0; i < reservenum+1; i++)
		fwrite(&re, sizeof(re), 1, f);

However, I think the boot_param_header should be emitted
first, before the alignment:

	make_bph(&bph, vi, reservenum, dtbuf.len, strbuf.len);

	fwrite(&bph, vi->hdr_size, 1, f);

	/* Align the reserve map to an 8 byte boundary */
	for (i = vi->hdr_size; i < be32_to_cpu(bph.off_mem_rsvmap); i++)
		fputc(0, f);

	for (i = 0; i < reservenum+1; i++)
		fwrite(&re, sizeof(re), 1, f);

Thoughts?

Thanks,
jdl

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

end of thread, other threads:[~2005-07-14  1:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-13 16:16 DTC: write_dt_blob() question Jon Loeliger
2005-07-14  1:28 ` 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).