summaryrefslogtreecommitdiffstats
path: root/sys/dev/iir
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2002-02-27 17:16:18 +0000
committertmm <tmm@FreeBSD.org>2002-02-27 17:16:18 +0000
commit3ed05b7b8966710c5cffbf0ba479dd2e07c91c0a (patch)
tree46353f300fd15b6b132ccde617d8726a2e38d224 /sys/dev/iir
parente9d577adb2ffdd3b7300415775c1212a087ce0dc (diff)
downloadFreeBSD-src-3ed05b7b8966710c5cffbf0ba479dd2e07c91c0a.zip
FreeBSD-src-3ed05b7b8966710c5cffbf0ba479dd2e07c91c0a.tar.gz
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
Diffstat (limited to 'sys/dev/iir')
-rw-r--r--sys/dev/iir/iir.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/iir/iir.h b/sys/dev/iir/iir.h
index b165c84..3b325cb 100644
--- a/sys/dev/iir/iir.h
+++ b/sys/dev/iir/iir.h
@@ -372,10 +372,8 @@ extern int ser_printf(const char *fmt, ...);
#define GDT_SCRATCH_SZ 3072 /* 3KB scratch buffer */
/* macros */
-#define htole32(v) (v)
-#define htole16(v) (v)
-#define letoh32(v) (v)
-#define letoh16(v) (v)
+#define letoh32(v) le32toh(v)
+#define letoh16(v) le16toh(v)
/* Map minor numbers to device identity */
#define LUN_MASK 0x0007
OpenPOWER on IntegriCloud