[SLOF] [PATCH slof 1/2] fdt: Factor out code to replace a phandle in place

Alexey Kardashevskiy aik at ozlabs.ru
Tue May 29 17:59:14 AEST 2018


On 22/5/18 4:04 pm, Segher Boessenkool wrote:
> On Tue, May 22, 2018 at 07:23:55AM +0200, Thomas Huth wrote:
>> On 21.05.2018 09:17, Alexey Kardashevskiy wrote:
>>> On 19/5/18 2:10 am, Thomas Huth wrote:
>>>> On 14.05.2018 12:03, Alexey Kardashevskiy wrote:
>>>>> +: fdt-replace-l, 4 - swap 4 + swap ;
>>>>
>>>> Why "l," ? I thought the "comma" words would be used for compiling stuff
>>>> into the dictionary, but apparently you're not doing this here?
>>>
>>> Not just dictionary, fdt-fl.fs uses this naming approach when adding to
>>> flatten DT. Segher suggested, looks nicer.
>>
>> Ok, sure, but you don't *add* anything here, e.g. you also don't call
>> fdt-allot like in the other "fdt-something," function. IMHO the comma is
>> rather confusing here.
> 
> Agreed.

Ok, I got it wrong there.


>>>> Maybe you could simply use the "4 - swap 4 + swap" directly here? It's
>>>> only one line of code, so not sure whether it's worth to put this into a
>>>> separate Forth word.
>>>
>>> "l," kind of allocates some bytes in some heap.
>>
>> But your "fdt-replace-l," does not allocate anything, it just increases
>> an address on the stack and a size on the stack at the same time.
> 
> fdt-replace-l, is just
> 
>   /l /string
> 
> so it is much easier to understand if you just type that directly.

Is it? It is not a string I am advancing on and using something+string on
that is misleading imho. I'll do simple "4 - swap 4 + swap".



-- 
Alexey


More information about the SLOF mailing list