Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Dec 2011 16:16:58 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        "O. Hartmann" <ohartman@zedat.fu-berlin.de>
Cc:        threads@freebsd.org, Poul-Henning Kamp <phk@phk.freebsd.dk>, freebsd-arch@freebsd.org
Subject:   Re: [Patch] C1X threading support
Message-ID:  <868vm6t0np.fsf@ds4.des.no>
In-Reply-To: <4EEF765D.4090300@zedat.fu-berlin.de> (O. Hartmann's message of "Mon, 19 Dec 2011 18:37:33 %2B0100")
References:  <58923.1324292241@critter.freebsd.dk> <AC4BCD04-6555-4AD1-BBCD-3C706852ECCF@bsdimp.com> <4EEF765D.4090300@zedat.fu-berlin.de>

next in thread | previous in thread | raw e-mail | index | archive | help
"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.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



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