Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Dec 2011 10:41:33 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= <des@des.no>
Cc:        threads@freebsd.org, Poul-Henning Kamp <phk@phk.freebsd.dk>, "O. Hartmann" <ohartman@zedat.fu-berlin.de>, freebsd-arch@freebsd.org
Subject:   Re: [Patch] C1X threading support
Message-ID:  <3ECEEFA0-6542-46CE-86D5-8A4D8226C81D@bsdimp.com>
In-Reply-To: <868vm6t0np.fsf@ds4.des.no>
References:  <58923.1324292241@critter.freebsd.dk> <AC4BCD04-6555-4AD1-BBCD-3C706852ECCF@bsdimp.com> <4EEF765D.4090300@zedat.fu-berlin.de> <868vm6t0np.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help


On Dec 21, 2011, at 8:16 AM, Dag-Erling Smørgrav wrote:

> "O. Hartmann" <ohartman@zedat.fu-berlin.de> writes:
>> How is the other BSD sibbling, NetBSD, dealing with such things? NetBSD
>> is supposed to run on a trmendous variety of hardware, even a mixture of
>> bigendian and littleenddian and I'm quite sure they must have overcome
>> this probleme anyway.
> 
> The same way FreeBSD does: where ordering matters, use explicit
> conversions when reading and writing.  The conversion functions / macros
> are defined in such a manner that unnecessary conversions (e.g. host to
> little-endian on a little-endian system) do not generate any code at
> all.  The only downside is that you can't directly compare variables
> unless you're certain that they're both in host order.

And it is difficult for automated tools to help you know if you are "sure" or not.

Warner




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3ECEEFA0-6542-46CE-86D5-8A4D8226C81D>