[OpenBIOS] [PATCH] ppc: SDR1 fixes for ppc64
Andreas Färber
andreas.faerber at web.de
Sat Nov 20 22:55:18 CET 2010
Am 15.11.2010 um 23:32 schrieb Segher Boessenkool:
>> @@ -71,7 +71,7 @@ get_hash_size( void )
>>
>> asm volatile("mfsdr1 %0" : "=r" (sdr1) );
>>
>> - return ((sdr1 << 16) | 0x0000ffff) + 1;
>> + return (((sdr1 & 0x1f) << 16) | 0x0000ffff) + 1;
>> }
>
> Shouldn't this actually be something like
> 0x10000UL << (sdr1 & 0x1f)
> ?
No, I don't think so. HTABSIZE (formerly HTABMASK) is a bit mask, not
a number. Thus the +1.
You did spot an error though, thanks. The 16 should probably be 11 and
therefore the 0xffff 0x7ff.
Andreas
More information about the OpenBIOS
mailing list