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

From: Olof Johansson
Date: Thu Apr 28 2005 - 09:32:03 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/