Hi Maurizio,
On 02/27/2013 08:26 PM, Maurizio Lombardi wrote:
>
> I know I'm using constant values in some places instead of defines and
> that
> I should fix that.
> BTW, are we really sure that this line of code
>
> /* Get the sysboot1 field at control_status[22,23] */
> unsigned const sysboot1 = (control_status >> 22) & 0x03;
>
> is less readable than
>
> unsigned const sysboot1 = (control_status >>
> AM335x_CTRL_MODULE_REG_SYSBOOT1_SHIFT) &
> AM335x_CTRL_MODULE_REG_SYSBOOT1_MASK;
>
> ?
another option:
/* Get the sysboot1 field at control_status[22,23] */
#define AM335x_CTRL_MODULE_REG_SYSBOOT1(reg) \
((control_status >> 22) & 0x03)
unsigned const sysboot1 =
AM335x_CTRL_MODULE_REG_SYSBOOT1(control_status)
Regards,
Martin Sucha
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel