[SLOF] [PATCH 2/2] board-qemu: add private hcall to inform host on "phandle" update
Greg Kurz
groug at kaod.org
Tue Jul 11 01:40:14 AEST 2017
On Mon, 10 Jul 2017 10:13:31 -0500
Segher Boessenkool <segher at kernel.crashing.org> wrote:
> 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.
>
Not sure I have enough forth background to understand... are
you suggesting that each level of indentation calls for the
introduction of a new word ?
>
> Segher
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ozlabs.org/pipermail/slof/attachments/20170710/b5feda3e/attachment.sig>
More information about the SLOF
mailing list