[SLOF] [PATCH slof] pci-properties: Enforce all MMIO BARs to be 64K page aligned
Nikunj A Dadhania
nikunj at linux.vnet.ibm.com
Mon Feb 27 21:18:39 AEDT 2017
Segher Boessenkool <segher at kernel.crashing.org> writes:
> On Mon, Feb 27, 2017 at 12:21:45PM +0530, Nikunj A Dadhania wrote:
>> Seems fine, assign-var-min-align can be optimized (untested)
>>
>> : assign-var-min-align ( size var min-align -- al-mem )
>> dup 3 pick < IF \ ( size var min-align min-align size)
>> drop 1 pick \ ( size var sz-al)
>> THEN
>> swap \ ( size align var )
>> dup @ \ ( size align var cur-mem)
>> rot \ ( size var cur-mem align )
>> #aligned \ ( size var al-mem ) align the mem to the size
>> dup 2swap -rot + \ ( al-mem var new-mem ) add size to aligned mem
>> swap ! \ ( al-mem ) set variable to new mem
>> ;
>
> With less stack juggling, totally untested as well of course:
>
> : assign-var-min-align ( size var min-align -- al-mem )
> swap >r over umax r@ @ swap #aligned tuck + r> ! ;
Cool !!
Regards
Nikunj
More information about the SLOF
mailing list