Subject: Re: hto{le,be}{16,32,64}() proposal
To: Simon Burge <simonb@netbsd.org>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-userlevel
Date: 06/25/1999 07:38:05
On Fri, 25 Jun 1999 21:54:09 +1000
Simon Burge <simonb@netbsd.org> wrote:
> I propose adding a set of macros to <machine/bswap.h> called
> htole{16,32,64} and htobe{16,32,64} implemented in terms of bswap* and
> no-ops. There would also be a matching group of {le,be}toh* which do
> exactly the same thing.
This is a wonderful idea :-) Many device drivers would like this :-)
Don't forget HTO{BE,LE}{16,32,64}() and {BE,LE}TOH{16,32,64}() too :-)
> I'm not 100% convinced that <machine/bswap.h> is the right place for
> these. I'd be happier putting these in <machine/endian.h>, but then
> that header file would have to include <machine/bswap.h> to get the
> bswap* prototypes. Would doing this break anything?
<machine/endian.h> is probably the right place, but we need to go on
a namespace protection sweep in there.
-- Jason R. Thorpe <thorpej@nas.nasa.gov>