[PATCH 8/9 V3] Add documentation for the new DTS language.

David Gibson david at gibson.dropbear.id.au
Wed Oct 1 14:22:34 EST 2008


On Tue, Sep 30, 2008 at 10:01:51PM -0600, Warner Losh wrote:
> From: David Gibson <david at gibson.dropbear.id.au>
> Subject: Re: [PATCH 8/9 V3] Add documentation for the new DTS language.
> Date: Wed, 1 Oct 2008 13:46:56 +1000
> 
> > This could either be done by actually invoking cpp, using some
> > pre-and-post mangling to deal with the #-in-property-names problem.
> > Or we could build our own preprocessor that uses something other than
> > # as a magic character, but otherwise works like cpp.
> 
> There's always m4, but that has its own set of issues.

Yes.  I've thought about m4, but I'm pretty sure I don't want to go
there.

> Not sure if I should add a :-) or a :-(.
> 
> You could also s/#/$/g on the source and pass that through cpp and
> then undo it on the other side.  Assuming that cpp has been compiled
> with $ in symbol name support.

Something vaguely like that was what I had in mind - probably using
some magic based on '/' instead.  I planned to leave the processor
directives as #, but with the # only recognized in column 0.  Strictly
speaking that's a syntax change, but it won't bite any properly
indented existing source.

> The root of the problem here is that the original openfirmware spec
> wasn't 'C' and many of the new language features are aimed at a 'C'
> audience...

Well, the dtc source format has been aimed at C programmers from day
1, not just the new features.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson



More information about the devicetree-discuss mailing list