freebsd-dev/sys/libkern
Thomas Moestl 90ce56c287 Add the following functions/macros to support byte order conversions and
device drivers for bus system with other endinesses than the CPU (using
interfaces compatible to NetBSD):

- bwap16() and bswap32(). These have optimized implementations on some
  architectures; for those that don't, there exist generic implementations.
- macros to convert from a certain byte order to host byte order and vice
  versa, using a naming scheme like le16toh(), htole16().
  These are implemented using the bswap functions.
- stream bus space access functions, which do not perform a byte order
  conversion (while the normal access functions would if the bus endianess
  differs from the CPU endianess).

htons(), htonl(), ntohs() and ntohl() are implemented using the new
functions above for kernel usage. None of the above interfaces is currently
exported to user land.

Make use of the new functions in a few places where local implementations
of the same functionality existed.

Reviewed by:	mike, bde
Tested on alpha by:	mike
2002-02-27 17:16:18 +00:00
..
alpha Add the following functions/macros to support byte order conversions and 2002-02-27 17:16:18 +00:00
ia64 Add the following functions/macros to support byte order conversions and 2002-02-27 17:16:18 +00:00
arc4random.c
ashldi3.c
ashrdi3.c
bcd.c
bcmp.c
bsearch.c
divdi3.c
ffs.c
fnmatch.c
iconv_converter_if.m
iconv_xlat.c
iconv.c
index.c
inet_ntoa.c
lshrdi3.c
mcount.c
moddi3.c
qdivrem.c
qsort.c
quad.h
random.c
rindex.c
scanc.c
skpc.c
strcat.c
strcmp.c
strcpy.c
strlcat.c
strlcpy.c
strlen.c
strncmp.c
strncpy.c
strsep.c
strtol.c
strtoq.c
strtoul.c
strtouq.c
strvalid.c
ucmpdi2.c
udivdi3.c
umoddi3.c