Nate Lawson <[EMAIL PROTECTED]> writes: > First, the simple question: what's the simplest cross-platform way of > implementing scsi_ulto4b and scsi_4btoul (/sys/cam/scsi/scsi_all.h) for > 64 bit values. GEOM (/sys/geom/geom_enc.c) implements it via a 64 bit > cast in g_enc_le8. Is this the best current way?
Maybe the byteorder(9) macrofunctions with a union? > Second, anyone done work on unifying our various byte ordering macros? > Besides htonl and ntohl, there are scsi_*ul*, g_enc_*, openssl/aes_locl.h, > machine/endian.h, arpa/nameser.h, and I'm sure there are others. Perhaps > the best thing is to add macros similar to geom_enc_* to machine/endian.h. > Any ideas? Most of these could probably be implemented in terms of the __bswap*() functions in <machine/endian.h>, except for vendor sources like openssl, and htonl and ntohl which already are. I'm not sure if there would be an advantage to moving the geom byte ordering functions to <sys/endian.h> (I guess phk didn't either). Best regards, Mike Barcroft To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message