From owner-freebsd-threads@FreeBSD.ORG Wed Dec 21 17:47:18 2011 Return-Path: Delivered-To: threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0580106564A; Wed, 21 Dec 2011 17:47:18 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 7B6E58FC12; Wed, 21 Dec 2011 17:47:18 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id pBLHfcO9079629 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Wed, 21 Dec 2011 10:41:40 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=iso-8859-1 From: Warner Losh In-Reply-To: <868vm6t0np.fsf@ds4.des.no> Date: Wed, 21 Dec 2011 10:41:33 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <3ECEEFA0-6542-46CE-86D5-8A4D8226C81D@bsdimp.com> References: <58923.1324292241@critter.freebsd.dk> <4EEF765D.4090300@zedat.fu-berlin.de> <868vm6t0np.fsf@ds4.des.no> To: =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Wed, 21 Dec 2011 10:41:41 -0700 (MST) Cc: threads@freebsd.org, Poul-Henning Kamp , freebsd-arch@freebsd.org Subject: Re: [Patch] C1X threading support X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2011 17:47:18 -0000 On Dec 21, 2011, at 8:16 AM, Dag-Erling Sm=F8rgrav wrote: > "O. Hartmann" 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. >=20 > 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