1998-01-05 10:02:46 +03:00
|
|
|
/* $NetBSD: byteswap.h,v 1.2 1998/01/05 07:03:16 perry Exp $ */
|
|
|
|
|
1995-10-26 04:31:09 +03:00
|
|
|
/*
|
|
|
|
* inline macros for doing byteswapping on a little-endian machine.
|
|
|
|
* for boot.
|
|
|
|
*/
|
|
|
|
#define ntohs(x) \
|
|
|
|
( ( ((u_short)(x)&0xff) << 8) | ( ((u_short) (x)&0xff00) >> 8) )
|
|
|
|
#define ntohl(x) \
|
|
|
|
( ((ntohs((u_short)(x))) << 16) | (ntohs( (u_short) ((x)>>16) )) )
|