
Dear Simon Glass,
In message BANLkTine7BFSYOusgxwg0rg3owNbPN_dOQ@mail.gmail.com you wrote:
There are a few very primitive macros in setbits and clrbits. I would very much like to see at least:
Maybe we can agree to use these existing macros then instead of inventing new ones with the same functionality.
- define a field once in a header in an easy format along with any
enums which define allowable values if applicable
- pack and unpack a value into a field: so set a bitfield to 13, for exampl=
e
- obtain a mask for a field (i.e. with all bits set)
- equivalent of writel and readl for a bitfield (writel in fact being
read/modify/write so perhaps a different name)
Some of these exist, some don't.
Do you know of examples of such more complex definitions in the Linux kernel code?
Any thoughts? I we get something in there I suspect ARM people will use it at least, and that will reduce the number of ways this gets
I doubt that. You can see that even the existing macros are unknown to many, and they also do not bother to check around or asdk. It's always so much easier to invent your own new shiny macro that fits your current purpose perfectly.
done. At present the local bitfield macros are not accessible to even other SOCs, let along other architectures. As this thread shows (and some of the code I have been reviewing recently) there is a demand for something more functional.
How is this problem being addressed in Linux? At the very minimum we should chose a compatible implementation.
Best regards,
Wolfgang Denk