[PATCH 2/5] [POWERPC] 8xx: generic 8xx code arch/powerpc port

Benjamin Herrenschmidt benh at kernel.crashing.org
Fri Nov 17 09:48:43 EST 2006


> But wha do you need this for anyway?  It's not used anywhere currently,
> and it's not 8xx-specific at all?
> 
> > +unsigned long va_to_phys(unsigned long address)
> > +{
> > +	pte_t *pte;
> > +
> > +	pte = va_to_pte(address);
> > +	if (pte)
> > +		return(((unsigned long)(pte_val(*pte)) & PAGE_MASK) | (address & ~(PAGE_MASK)));
> > +	return (0);
> > +}
> 
> Shouldn't you use virt_to_phys instead?
> 
> Also for the last two I'd prefer if you'd find a way to avoid adding
> them.

I think those 2 are used for cases where they either have a non-linear
mapping a-la Amiga/APUS or in cases where they try to get addresses of
things in the vmalloc area no ?.

Ben.





More information about the Linuxppc-dev mailing list