Re: Endian-specific types

[email protected] Mon, 11 Apr 2016 22:04:27 +0000
Newsgroups gmane.os.netbsd.devel.general
Message-ID <[email protected]>
On Mon, Apr 11, 2016 at 09:39:25PM +0200, Martin Husemann wrote:
> On Mon, Apr 11, 2016 at 06:38:57PM +0000, [email protected] wrote:
> > It uses __le16, what should I convert that to in NetBSD?
> 
> What does it do?
> 
> Martin

Sorry I didn't mention what it does - I was not sure.

(As Paul said) this is for setting registers and such for the hardware.

I have been told (elsewhere) that this helps confirm the use of le16toh
and such, when coupled with a static code analyzer or some compilers.

It may not be the prettiest code but it is exposing things normally done
by firmware, which I think is pretty cool.

On same elsewhere I have been told there is no such type, perhaps I will
define my own, so I will be able to check it with a static code analyzer
if the need arises.

This is the code for it in Linux:
http://lxr.free-electrons.com/source/tools/include/linux/types.h#L56

Thanks!