[SLOF] [PATCH slof] fdt: Pass the resulting device tree to QEMU

David Gibson david at gibson.dropbear.id.au
Thu Oct 5 10:23:12 AEDT 2017


On Wed, Oct 04, 2017 at 08:39:59AM -0500, Segher Boessenkool wrote:
> On Tue, Oct 03, 2017 at 03:33:16PM +1100, Alexey Kardashevskiy wrote:
> > On 03/10/17 02:12, Segher Boessenkool wrote:
> > > On Mon, Oct 02, 2017 at 10:09:52PM +1100, Alexey Kardashevskiy wrote:
> > >>> : fdt-c,  fdt-here  1 fdt-allot  c! ;
> > >>> : fdt-align  fdt-here 4 #aligned fdt-here - ; \ or fill with zeroes?
> > >>> : fdt-str, ( str len -- )  fdt-here over fdt-allot  swap move ;
> > >>> : fdt-ztr, ( str len -- )  fdt-str,  0 fdt-c, ;
> > >>> \ and now use   fdt-str, fdt-align   instead of   false fdt-struct-add
> > >>> \ and just  fdt-ztr, fdt-align   for   true fdt-struct-add
> > > 
> > > I don't see it, but I haven't tested it either, just typed it :-)
> > > 
> > > : fdt-str, ( str len -- )
> > >   fdt-here over ( str len fhere len )
> > >   fdt-allot ( str len fhere )
> > >   swap ( str fhere len )
> > >   move ( -- )
> > > ;
> > > 
> > > Looks fine to me?
> 
> Well,
> 
> : fdt-str, ( str len -- )  dup fdt-allot  fdt-here swap move ;
> 
> is probably clearer :-)
> 
> > >>> The properties are not a linked list, but a Forth wordlist.  This is a)
> > >>> faster, because wordlists are optimised a bit, say ten times faster; and
> > >>> b) this allows use to run any code we want to get a property, not just
> > >>> lookups of static data.  From property.fs:
> > >>>
> > >>> \ Words on the property list for a node are actually executable words,
> > >>> \ that return the address and length of the property's data.  Special
> > >>> \ nodes like /options can have their properties use specialized code to
> > >>> \ dynamically generate their data; most nodes just use a 2CONSTANT.
> > >>
> > >> Hm. I wonder if it makes sense to rewrite fdt-properties using this.
> > > 
> > > You might need to make a case-sensitive wordlist search then?
> > 
> > I have no idea, any example? I'll probably skip this bit this time though.
> 
> Currently deep down all wordlists use string=ci (that is, case-insensitive
> string compare).  I think for the FDT string table you will want case-
> sensitive instead.

Yes, absolutely.

> (When searching the Forth dictionaries Open Firmware requires case-
> insensitive; and upper case is not allowed in property names, so doing
> a case-insensitive search works there, too (at least in practice, even
> though people *do* use upper case in property names).

Right.  There are, alas, a number of things that aren't allowed which
are nonetheless found in the wild.

Plus, a case insensitve comparison should be faster.

> One option is to set some global flag before finding a word; another is
> to have a separate word for case-sentive finding; yet another is to set
> a flag in the wordlist itself saying if it should be case-sensitive.
> That last one is probably the most useful for other purposes, too.
> 
> 
> Segher
> _______________________________________________
> SLOF mailing list
> SLOF at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/slof

-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/slof/attachments/20171005/8a483230/attachment.sig>


More information about the SLOF mailing list