[SLOF] [PATCH 2/2] board-qemu: add private hcall to inform host on "phandle" update
Segher Boessenkool
segher at kernel.crashing.org
Tue Jul 11 01:13:31 AEST 2017
On Mon, Jul 10, 2017 at 04:57:57PM +0200, Thomas Huth wrote:
> On 10.07.2017 14:17, Greg Kurz wrote:
> > --- a/board-qemu/slof/fdt.fs
> > +++ b/board-qemu/slof/fdt.fs
> > @@ -316,14 +316,22 @@ fdt-claim-reserve
> > s" phandle" r@ get-property 0= IF
> > decode-int ( p-addr2 p-len2 val )
> > \ ." found phandle: " dup . cr
> > - r@ s" /" find-node ( p-addr2 p-len2 val node root )
> > - fdt-replace-all-phandles ( p-addr2 p-len2 )
> > - 2drop
> > + dup ( p-addr2 p-len2 val val )
> > + r@ s" /" find-node ( p-addr2 p-len2 val val node root )
> > + fdt-replace-all-phandles ( p-addr2 p-len2 val )
> > + -rot 2drop ( val )
> > (fdt-phandle-replaced) IF
> > r@ set-node
> > s" phandle" delete-property
> > s" linux,phandle" delete-property
> > + r@ swap hv-update-phandle dup 0 <> IF
>
> Instead of "dup 0 <> IF" you can use "?dup IF" here and remove the
> corresponding "ELSE drop" below.
>
> > + \ Ignore hcall not implemented error, print error otherwise
> > + dup -2 <> IF ." HV-UPDATE-PHANDLE error: " . cr ELSE drop THEN
>
> Dito - use ?dup and remove the "ELSE drop" part.
In general, this needs to be much better factored if it wants to be
readable at all. As soon as you need indentation to make any sense
of your structure, you need to factor more.
Segher
More information about the SLOF
mailing list