I'm working on RFE 5007142, which implements new 64-bit htonll() and ntohll() functions. I implemented these functions in inline assembly in the same manner as existing htonl() and ntohl().
Similar functions already exist in various parts of Solaris: dhcp_ntohll() inlibdhcputil, ike_ntohll() in ikeadm, and ntohll/htonll in iSCSI, all implemented with #define or a C function--I replaced all these with the above unified functions. I will use new htonll() and ntohll() functions to optimize existing crypto framework code in Solaris x86 and this is my main motivation for this work. The ntohll() and htonll() functions are already in Linux, NetBSD, and AIX OS, and they are used in various apps such as SSH and netfilter (with emulation for Solaris and other OSs that are missing these functions. The ntohll() and htonll() functions are NOT a part of the XPG standard, and I placed header guards in sys/byteorder.h to allow for this. Here's a preliminary webrev for those who may be interested (but I'm not looking for a review yet): http://sw.west/~da73024/reviews/onnv/5007142-bswap Any comments? Good idea? Bad idea? Suggestions? - Dan This message posted from opensolaris.org _______________________________________________ perf-discuss mailing list perf-discuss@opensolaris.org