[PATCH v2] powerpc: add setmaskedbits macros

Benjamin Herrenschmidt benh at kernel.crashing.org
Fri Aug 17 02:40:18 EST 2007


On Thu, 2007-08-16 at 10:26 -0500, Timur Tabi wrote:
> Kumar Gala wrote:
> 
> >>     setmaskedbits_be32(&uccp->gumr_l,
> >>         UCC_SLOW_GUMR_L_MODE_QMC | UCC_SLOW_GUMR_L_TDCR_1 |
> >>         UCC_SLOW_GUMR_L_RDCR_16,
> >>                 UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK |
> >>         UCC_SLOW_GUMR_L_RDCR_MASK);
> >>
> >>     setmaskedbits_be32(&uccp->gumr_h,
> >>         UCC_SLOW_GUMR_H_SUART | UCC_SLOW_GUMR_H_TRX |
> >>         UCC_SLOW_GUMR_H_TTX, UCC_SLOW_GUMR_H_RFW);
> > 
> > Can you also show what the UCC_SLOW* values look like.
> 
> The second example is actually a trick that lets me set some bits and clear 
> others in one shot, so for the gumr_h register, all of the above values are 
> single bits.  I guess that's not a good example.

Such tricks deserve at least a comment.

Ben.





More information about the Linuxppc-dev mailing list