[PATCH 3/4] ppc64: Add driver for BPA iommu

Olof Johansson olof at austin.ibm.com
Fri Apr 29 00:30:30 EST 2005


On Thu, Apr 28, 2005 at 09:05:58AM -0500, Olof Johansson wrote:

> > +/* compute the hashed 6 bit index for the 4-way associative pte cache */
> > +static inline unsigned long
> > +get_ioc_hash(ioste iost_entry, unsigned long io_address)
> > +{
> > +	unsigned long iopte = get_ioptep(iost_entry, io_address);
> > +
> > +	return ((iopte & 0x000000000000001f8ul) >> 3)
> > +	     ^ ((iopte & 0x00000000000020000ul) >> 17)
> > +	     ^ ((iopte & 0x00000000000010000ul) >> 15)
> > +	     ^ ((iopte & 0x00000000000008000ul) >> 13)
> > +	     ^ ((iopte & 0x00000000000004000ul) >> 11)
> > +	     ^ ((iopte & 0x00000000000002000ul) >> 9)
> > +	     ^ ((iopte & 0x00000000000001000ul) >> 7);
> 
> Can't you reverse the subword by just doing one XOR instead of 6?

Ugh, I wrote that before I had coffee. No you can't, you can just negate
the value by doing the XOR. Nevermind.


-Olof



More information about the Linuxppc64-dev mailing list