From: Mike Frysinger Date: Tue, 7 Jun 2011 11:06:19 -0400 Subject: [U-Boot] [PATCH 1/5] Tegra2: Add bitfield access macros In-Reply-To: <20110607100623.01E351EA347@gemini.denx.de> References: <1306973675-8411-1-git-send-email-sjg@chromium.org> <20110607100623.01E351EA347@gemini.denx.de> Message-ID: <201106071106.20421.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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