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
@@ -17,16 +17,14 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* 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"
-
/
/ In-line functions for amd64 kernels.
/
/
@@ -76,10 +74,20 @@
/
/ Networking byte order functions (too bad, Intel has the wrong byte order)
/
+ .inline htonll,4
+ movq %rdi, %rax
+ bswapq %rax
+ .end
+
+ .inline ntohll,4
+ movq %rdi, %rax
+ bswapq %rax
+ .end
+
.inline htonl,4
movl %edi, %eax
bswap %eax
.end