diff options
Diffstat (limited to 'sys/i386/include/endian.h')
| -rw-r--r-- | sys/i386/include/endian.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sys/i386/include/endian.h b/sys/i386/include/endian.h index 41ceda4cb6d3..f929b64609ea 100644 --- a/sys/i386/include/endian.h +++ b/sys/i386/include/endian.h @@ -58,26 +58,27 @@ #ifndef _KERNEL #include <sys/cdefs.h> #endif +#include <machine/ansi.h> __BEGIN_DECLS -unsigned long htonl(unsigned long); -unsigned short htons(unsigned short); -unsigned long ntohl(unsigned long); -unsigned short ntohs(unsigned short); +__uint32_t htonl(__uint32_t); +__uint16_t htons(__uint16_t); +__uint32_t ntohl(__uint32_t); +__uint16_t ntohs(__uint16_t); __END_DECLS #ifdef __GNUC__ -static __inline unsigned long -__uint16_swap_uint32(unsigned long __x) +static __inline __uint32_t +__uint16_swap_uint32(__uint32_t __x) { __asm ("rorl $16, %1" : "=r" (__x) : "0" (__x)); return __x; } -static __inline unsigned long -__uint8_swap_uint32(unsigned long __x) +static __inline __uint32_t +__uint8_swap_uint32(__uint32_t __x) { #if defined(_KERNEL) && (defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)) && !defined(I386_CPU) __asm ("bswap %0" : "=r" (__x) : "0" (__x)); @@ -88,8 +89,8 @@ __uint8_swap_uint32(unsigned long __x) return __x; } -static __inline unsigned short -__uint8_swap_uint16(unsigned short __x) +static __inline __uint16_t +__uint8_swap_uint16(__uint16_t __x) { __asm ("xchgb %h1, %b1" : "=q" (__x) : "0" (__x)); |
