[Cbe-oss-dev] [PATCH 02/11]MARS: Workload queue block replace bit fields

Kazunori Asayama asayama at sm.sony.co.jp
Fri Sep 12 17:08:15 EST 2008


Yuji Mano wrote:
> This replaces the bit fields usage for the workload queue block bits with
> explicit bitwise shift/mask operations for better portability.
> 
> Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>

(snip)

> +#define MARS_BITS_CAST_TYPE			uint8_t
> +#define MARS_BITS_CAST_STATE			uint8_t
> +#define MARS_BITS_CAST_PRIORITY			uint8_t
> +#define MARS_BITS_CAST_SIGNAL			uint8_t
> +#define MARS_BITS_CAST_WAIT_ID			uint16_t
> +#define MARS_BITS_CAST_COUNTER			uint16_t
> +
> +#define MARS_BITS_GET(bits, name) (MARS_BITS_CAST_##name) \
> +	((*(bits) & MARS_BITS_MASK_##name) >> MARS_BITS_SHIFT_##name)

Why are these explicit casts needed?

-- 
(ASAYAMA Kazunori
  (asayama at sm.sony.co.jp))
t



More information about the cbe-oss-dev mailing list