[U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros

Mike Frysinger vapier at gentoo.org
Tue Jun 7 17:06:19 CEST 2011


On Tuesday, June 07, 2011 06:06:23 Wolfgang Denk wrote:
> 	#define FIELD_VAL(x)	(x << 16)
> 	#define FIELD_MASK	FIELD_VAL(0xF)

this is basically what we do in the blackfin port.  we keep most of the logic 
in the defines so that we can use the simpler i/o logic without too much 
hassle.

the only additional thing we do is add a define for the shift in case we need 
to do something the macros cant provide.
#define FIELD_SHIFT	16
#define FIELD_VAL(x)	((x) << FIELD_SHIFT)
#define FIELD_MASK	FIELD_FAL(0xF)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110607/464a9d1d/attachment.pgp 


More information about the U-Boot mailing list