diff options
author | imura <imura@FreeBSD.org> | 2005-09-19 08:07:18 +0000 |
---|---|---|
committer | imura <imura@FreeBSD.org> | 2005-09-19 08:07:18 +0000 |
commit | 198a5385718a1a4dee67d9ec60f8f83792aa060b (patch) | |
tree | a956082e32d893d00470c8359f1821ef4cb1c4cb /sys/sys/mchain.h | |
parent | 903949a3ce270584d3a34e4dd95b4624f47192eb (diff) | |
download | FreeBSD-src-198a5385718a1a4dee67d9ec60f8f83792aa060b.zip FreeBSD-src-198a5385718a1a4dee67d9ec60f8f83792aa060b.tar.gz |
Remove macros
htole{s,l,q}, letoh{s,l,q}, htobe{s,l,q}, betoh{s,l,q}
and replace it with more standard byteorder macros in our system.
Diffstat (limited to 'sys/sys/mchain.h')
-rw-r--r-- | sys/sys/mchain.h | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/sys/sys/mchain.h b/sys/sys/mchain.h index 23f454b..69775ff 100644 --- a/sys/sys/mchain.h +++ b/sys/sys/mchain.h @@ -34,54 +34,6 @@ #ifndef _SYS_MCHAIN_H_ #define _SYS_MCHAIN_H_ -#include <machine/endian.h> - -#ifndef _KERNEL -/* - * This macros probably belongs to the endian.h - */ -#if (BYTE_ORDER == LITTLE_ENDIAN) - -#define htoles(x) ((u_int16_t)(x)) -#define letohs(x) ((u_int16_t)(x)) -#define htolel(x) ((u_int32_t)(x)) -#define letohl(x) ((u_int32_t)(x)) -#define htoleq(x) ((int64_t)(x)) -#define letohq(x) ((int64_t)(x)) - -#define htobes(x) (__htons(x)) -#define betohs(x) (__ntohs(x)) -#define htobel(x) (__htonl(x)) -#define betohl(x) (__ntohl(x)) - -static __inline int64_t -htobeq(int64_t x) -{ - return (int64_t)__htonl((u_int32_t)(x >> 32)) | - (int64_t)__htonl((u_int32_t)(x & 0xffffffff)) << 32; -} - -static __inline int64_t -betohq(int64_t x) -{ - return (int64_t)__ntohl((u_int32_t)(x >> 32)) | - (int64_t)__ntohl((u_int32_t)(x & 0xffffffff)) << 32; -} - -#else /* (BYTE_ORDER == LITTLE_ENDIAN) */ - -#error "Macros for Big-Endians are incomplete" - -/* -#define htoles(x) ((u_int16_t)(x)) -#define letohs(x) ((u_int16_t)(x)) -#define htolel(x) ((u_int32_t)(x)) -#define letohl(x) ((u_int32_t)(x)) -*/ -#endif /* (BYTE_ORDER == LITTLE_ENDIAN) */ -#endif /* _KERNEL */ - - #ifdef _KERNEL /* |