On 11/10/2014 04:35 PM, Taras Kondratiuk wrote:
On 11/10/2014 02:26 PM, Bill Fischofer wrote:
The main use case for anonymous bit fields is when mapping HW registers
that have HW-reserved bits that should not be touched by SW. Another is
for architected packet formats with explicitly reserved fields that
again SW should not try to repurpose.  Being anonymous reduces the
chance of stray references to them and also makes it clear to all that
they are not to be used.

So just name this as __padding or __hwonly. And in software you will know what is it ;)

Maxim.


Just a side note.
Using C bit fields for HW registers or packet parsing is not a portable
solution. As far as I remember C standard does not specify how bit
fields are places inside a word. Most compilers do produce expected
results, but if portable code is needed, then better to use bit fields
for 'software-accessed' data only.




_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to