1 /* 2 * Copyright (c) 1994 William F. Jolitz. 3 * 386BSD Copyright Restrictions Apply. All Other Rights Reserved. 4 * 5 * $Id: ntohs.h,v 1.1 94/06/08 12:38:57 bill Exp Locker: bill $ 6 * Network to Host Short byte order conversion. 7 */ 8 9 __INLINE unsigned short ntohs(unsigned short wd)10ntohs(unsigned short wd) 11 { unsigned short rv; 12 13 asm ("xchgb %b1, %h0" : "=q" (rv) : "0" (wd)); 14 return (rv); 15 } 16