[SLOF] [PATCH v3] boot: do not use catpad to concatenate strings

Alexey Kardashevskiy aik at ozlabs.ru
Wed Dec 13 12:51:24 AEDT 2017


On 13/12/17 04:29, Segher Boessenkool wrote:
> On Tue, Dec 12, 2017 at 05:44:04PM +1100, Alexey Kardashevskiy wrote:
>>> We were concatenating the word " parse-load" and our bootdevice list
>>> that was input to evaluate. In the discussion with Segher, he suggested
>>> to open code evaluate, that eliminates the requirement for
>>> concatenation. Newer "load" does not use $cat anymore.
>>>
>>>    set-boot-args
>>>    save-source  -1 to source-id
>>>    $bootdev dup #ib ! span ! to ib
>>>    0 >in !
>>>    ['] parse-load catch restore-source throw
>>
>>
>> Ah, I see... Hm. But why do not we just call parse-load directly, without
>> evaluate or this really not obvious open coded version of evaluate? :)
>>
>> It all looks unnecessary complicated :(
> 
> Since parse-load reads from the input device, via the parse area, you
> need to set up your own, and save / restore it around it.
> 
> The CATCH is to ensure the restore happens even if something down in
> parse-load calls THROW (or ABORT etc.).
> 
> I did suggest to have this factored out so you could do something like
> 
>   $bootdev ['] parse-load execute-with-input


Factor out "de-alias do-load" bits from parse-load and call it directly,
may be?


-- 
Alexey


More information about the SLOF mailing list