[OpenBIOS] [PATCH] ppc: SDR1 fixes for ppc64

Andreas Färber andreas.faerber at web.de
Sat Nov 20 23:48:47 CET 2010


Am 20.11.2010 um 23:30 schrieb Segher Boessenkool:

>>>> -	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.
>
> PowerISA v2.05 says:
>
> "The HTABSIZE field in SDR1 contains an integer giving the number of  
> bits
> (in addition to the minimum of 11 bits) from the hash that are used  
> in the
> Page Table index."
>
> It is like this on even the oldest 64-bit implementations (a 5-bit
> integer, add 11; max is 28, so 11..39 bits used, 2**18..2**47 bytes  
> htab
> size).
>
> In the 32-bit "classic" PEM, it's a bitmask indeed (9 bits, all zeroes
> means 10 bits used, so 10..19 bits used, 2**16..2**25 bytes htab  
> size).

Yeah, spotted the difference in the meantime and working on the patch.  
I'm differentiating based on __powerpc64__ but that should probably be  
based on PVR instead? If so, then how?

Andreas



More information about the OpenBIOS mailing list