common flatdevtree code

Mark A. Greer mgreer at mvista.com
Thu Sep 7 10:36:25 EST 2006


On Wed, Sep 06, 2006 at 01:52:07PM +1000, Paul Mackerras wrote:
> Mark A. Greer writes:
> 
> > I'm doing some fairly massive rework to my patches so it'll take
> > another day or two (plus 4 day weekend for me).  In the meantime,
> > this is what I've done to your code.  :)
> 
> Any further progress on this?  I need an ft library for the prep
> bootwrapper changes I'm planning.
> 
> I don't like the approach of doing a malloc for the whole blob every
> time you make a property larger though.  I'm going to be adding quite
> a few nodes and properties, potentially, and with a simple-minded
> malloc (such as you get in a bootwrapper) it's likely to chew through
> a lot of memory unnecessarily.  I would rather be able to start with
> an existing blob and pull it apart once, add stuff to it, then put it
> back together, doing a small number of mallocs in the process.
> 
> > I still plan on changing it a bit to use ft_next in a few more routines
> > (e.g., ft_dump_blob).  ft_next has a clumsy interface but I like the fact
> 
> The interface might look nicer if we had a structure for the tag,
> name, value and length.  Then there would only be one parameter
> instead of the four you have at the moment.
> 
> Paul.

Paul,

Here's what I have at the moment...

- flatdevtree.[ch] are copies of what Hollis will be keeping (but I've
edited the ones attached to this email)

- flatdevtree_env.h is a bootwrapper hdr file that contains local
  defines that the generic flatdevtree.[ch] need

- flatdevtree_misc.c is other ft stuff that isn't in flatdevtree.c plus
  some bootwrapper->flatdevtree.c glue code

Mark
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flatdevtree.c
Type: text/x-csrc
Size: 15282 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20060906/ea5aac49/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flatdevtree_env.h
Type: text/x-chdr
Size: 1142 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20060906/ea5aac49/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flatdevtree.h
Type: text/x-chdr
Size: 3656 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20060906/ea5aac49/attachment-0001.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flatdevtree_misc.c
Type: text/x-csrc
Size: 6191 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20060906/ea5aac49/attachment-0001.c>


More information about the Linuxppc-dev mailing list