[PATCH] pseries: phyp dump: Variable size reserve space.

Manish Ahuja ahuja at austin.ibm.com
Thu Apr 10 03:32:20 EST 2008


Olof Johansson wrote:
> These make for some really long variable names and lines. I know from
> experience, since I've picked unneccessary long driver names in the past
> myself. :)
> 
> How about just naming the new variables reserve_bootvar, etc? The name
> of the struct they're in makes it obvious what they're for.
> 

Yeah, I guess thats a good suggestion. Will truncate it.

> 
>> +static inline unsigned long phyp_dump_calculate_reserve_size(void)
>> +{
>> +	unsigned long tmp;
>> +
>> +	if (phyp_dump_info->phyp_dump_reserve_bootvar)
>> +		return phyp_dump_info->phyp_dump_reserve_bootvar;
>> +
>> +	/* divide by 20 to get 5% of value */
>> +	tmp = lmb_end_of_DRAM();
>> +	do_div(tmp, 20);
>> +
>> +	/* round it down in multiples of 256 */
>> +	tmp = tmp & ~0x000000001FFFFFFF;
> 
> That's 512MB, isn't it?
> 

No, its 5 % of memory and then rounded down to 256 MB multiples.
so if you 4GB its 256MB.
if you have 8 GB its 512 MB etc.

> 
> -Olof




More information about the Linuxppc-dev mailing list