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

Alexey Kardashevskiy aik at ozlabs.ru
Sat Oct 14 11:24:05 AEDT 2017


On 13/10/17 23:45, Segher Boessenkool wrote:
> On Fri, Oct 13, 2017 at 07:26:02PM +1100, Alexey Kardashevskiy wrote:
>> diff --git a/slof/fs/client.fs b/slof/fs/client.fs
>> index 7d537a6..67976fb 100644
>> --- a/slof/fs/client.fs
>> +++ b/slof/fs/client.fs
>> @@ -308,4 +308,18 @@ ALSO client-voc DEFINITIONS
>>  : set-callback ( newfunc -- oldfunc )
>>    client-callback @ swap client-callback ! ;
>>
>> +\ Curtom method to get FDT blob
> 
> s/r/s/
> 
>> +: fdt-fetch ( buf len -- 0 )
>> +    " /" find-node fdt-flatten-tree ( buf len dtb )
> 
> " /" find-node   is   device-tree @

Hm. Lovely :)


>> +    dup >r
>> +    >fdth_tsize l@              ( buf len size r: dtb )
>> +    min                         ( buf minsize r: dtb )
>> +    r@ -rot
>> +    move
>> +
>> +    r> fdt-flatten-tree-free
>> +
>> +    0
>> +;
> 
> That "min" isn't correct I think -- if the DTB doesn't fit, you want to
> complain loudly and/or return an error to the caller.

Well, this is not a real patch, this is an RFC to hear about the idea in
general. I'll add a complain here if we decide it is worth doing.


-- 
Alexey


More information about the SLOF mailing list