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

Segher Boessenkool segher at kernel.crashing.org
Wed Dec 13 04:29:35 AEDT 2017


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


Segher


More information about the SLOF mailing list