Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Feb 2003 20:45:44 -0800 (PST)
From:      Nate Lawson <njl@FreeBSD.org>
To:        marcel@xcllnt.net, mike@FreeBSD.ORG
Cc:        current@FreeBSD.ORG, hackers@FreeBSD.ORG, njl@FreeBSD.ORG
Subject:   Re: 64 bit endian routines
Message-ID:  <200302280445.h1S4jifs099792@freefall.freebsd.org>
In-Reply-To: <20030228041849.GB813@athlon.pn.xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help
	Date: Thu, 27 Feb 2003 20:18:49 -0800
	From: Marcel Moolenaar <marcel@xcllnt.net>
	To: Mike Barcroft <mike@FreeBSD.ORG>
	Cc: Nate Lawson <njl@FreeBSD.ORG>, current@FreeBSD.ORG,
		hackers@FreeBSD.ORG
	Subject: Re: 64 bit endian routines
	References: <200302280324.h1S3OndV078007@freefall.freebsd.org> <20030227223058.G93968@espresso.bsdmike.org>

	On Thu, Feb 27, 2003 at 10:30:58PM -0500, Mike Barcroft wrote:
	> 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).

	The geom functions serve a primary purpose of dealing with random
	alignment of fields. The endianness has been added later, so they
	now serve a dual function. Do not unify them with byte-order only
	functions.

	-- 
	 Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net

Both scsi and geom implement unaligned access functions that perform byte
ordering.  I never intended to supplant them with __bswap*().  What I want
is for machine/endian.h to have functions that provide 16-64 bit endian
conversions in both aligned and unaligned access forms.  After these functions
are there, I'd like us to unify use of them and remove driver-private
versions.

Is this more clear now?

-Nate

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200302280445.h1S4jifs099792>