summaryrefslogtreecommitdiff
path: root/sys/arch/pmax/stand/byteswap.h
blob: c553c2775de632a4dc365767206d6b5f111d4b0f (plain)
1
2
3
4
5
6
7
8
/*
 * 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) )) )