Print this page
5007142 Add ntohll and htonll to sys/byteorder.h
6717509 Need to use bswap/bswapq for byte swap of 64-bit integer on x32/x64
PSARC 2008/474
@@ -18,16 +18,14 @@
*
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/
/ Inline functions for i386 kernels.
/ Shared between all x86 platform variants.
/
@@ -86,10 +84,24 @@
.end
/
/ Networking byte order functions (too bad, Intel has the wrong byte order)
/
+ .inline htonll,4
+ movl (%esp), %edx
+ movl 4(%esp), %eax
+ bswap %edx
+ bswap %eax
+ .end
+
+ .inline ntohll,4
+ movl (%esp), %edx
+ movl 4(%esp), %eax
+ bswap %edx
+ bswap %eax
+ .end
+
.inline htonl,4
movl (%esp), %eax
bswap %eax
.end