[U-Boot] Bitfield macros (was: Re: [PATCH v3 02/10] armv7: add miscellaneous utility macros)

Wolfgang Denk wd at denx.de
Wed May 18 06:45:39 CEST 2011


Dear Simon Glass,

In message <BANLkTim_uco8YXdPLmtg2uaJ9odU+ZXwwg at mail.gmail.com> you wrote:
>
> > Maybe we can agree to use these existing macros then instead of
> > inventing new ones with the same functionality.
> 
> The existing macros do not have enough functionality in my view. If we
> seriously want people to use these then I believe they need to be
> enhanced to be easier to use and more powerful.

Please read what I wrote. Pay special attention to the "the same
functionality" part.

> > Do you know of examples of such more complex definitions in the Linux
> > kernel code?
> 
> Which complex definitions? I was suggesting adding a more powerful
> group of bitfield macros to U-Boot. It would be better if they were
> easier to use rather than more complex.

And I asked if any such "more powerful group of bitfield macros" i
used in Linux?

> I think clrbits and setbits are a start but they are primitive and we
> can do better. If we do better, people will use the better options. If
> lots of people use them then we can start requiring that people do. In
> the end we get a consistent way of accessing SOC registers at the bit
> level, as we now do at the word level.

I understand and accept your opinion, but I do not share it.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Program maintenance is an entropy-increasing process,  and  even  its
most skilfull execution only delays the subsidence of the system into
unfixable obsolescence.       - Fred Brooks, "The Mythical Man Month"


More information about the U-Boot mailing list