[SLOF] [PATCH slof] pci-properties: Enforce all MMIO BARs to be 64K page aligned

Michael Roth mdroth at linux.vnet.ibm.com
Thu Mar 2 15:56:09 AEDT 2017


Quoting Segher Boessenkool (2017-02-28 19:36:41)
> On Tue, Feb 28, 2017 at 07:02:59PM -0600, Michael Roth wrote:
> > > (Why have var in the middle of the params btw?  It is more natural to
> > > have it at the end).
> > 
> > It was mostly because it was an "extended" version of assign-var,
> > so in my head it made sense to add the parameter to the end of the
> > list. Not sure if that reasoning applies well to Forth.
> 
> In good Forth code, any word does just one simple thing, so you do not
> have many arguments at all normally.  It is usual to put a memory
> address last, because 1) it is usual, which helps reading; and 2) it
> simplifies the callers most of the time.

Ok, makes sense. Thank you for the explanation.

> 
> Maybe it would help here to factor a bit more:
> 
> : assign-var-with-align ( size align var -- al-mem )
>   dup >r @ swap #aligned tuck + r> ! ;
> 
> : assign-var-min-align ( size min-align var -- al-mem )
>   >r over umax r> assign-var-with-align ;
> 
> or maybe you don't even need the latter.

I think we'd need both, but this does seem more readable.

> 
> 
> Segher
> 



More information about the SLOF mailing list