DIP: add Bit Fields
Daniel N
no at public.email
Sat Mar 9 13:02:20 UTC 2024
On Saturday, 9 March 2024 at 10:56:33 UTC, Dennis wrote:
> On Saturday, 9 March 2024 at 10:46:10 UTC, Daniel N wrote:
>> Not on dub, but my closed source makes use of it. Vendor
>> supplied register definitions uses bitfields with C semantics.
>> Also IPC where client/server is written in different languages.
>
> That would be great material for the DIP. Can you give a link
> to such a register definition, and show what your current
> approach is to create C compatible bit fields for it in D?
The sdk license doesn't allow me to share the files.
But you can find similar code here...
https://www.renesas.com/us/en/document/apn/sh7450-groupsh7451-group-register-definition-header-file
Typically an union with a word sized member is combined with the
bitfields to provide either atomic access or convenient access to
the fields.
Without native D support, I just use C for the lowest layer
instead.
More information about the dip.development
mailing list