tech-misc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Endian-specific types

On Mon, Apr 11, 2016 at 10:04:27PM +0000, coypu%SDF.ORG@localhost wrote:
> (As Paul said) this is for setting registers and such for the hardware.

For registers we normally don't see this at all (so just use uint16_t),
as we access registers via bus_space_read/bus_space_write and the bus
handling defines all needed endianess conversions.

However, we do see this in data that is DMA'd from or to the device,
and proper use of le16toh and friends is important there.

So for DMA'd structs it may make sense to typedef it to uint16_t
and use it in the struct definition - but on the other hand we don't
do that anywhere else.


Home | Main Index | Thread Index | Old Index