From owner-svn-src-head@FreeBSD.ORG Sun Jun 30 18:42:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 903FF373; Sun, 30 Jun 2013 18:42:40 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay009.isp.belgacom.be (mailrelay009.isp.belgacom.be [195.238.6.176]) by mx1.freebsd.org (Postfix) with ESMTP id B01AD1861; Sun, 30 Jun 2013 18:42:39 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmUGALt60FFR8aFy/2dsb2JhbABagwkyg1C8Dn0XdIIjAQEFIzMiARALFAQJFgsCAgkDAgECASceBg0BBwEBiA8IqiWQR49NEQeCUYEWA5AIgS2HPJAcgxM6 Received: from 114.161-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.161.114]) by relay.skynet.be with ESMTP; 30 Jun 2013 20:42:30 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r5UIgTFk003087; Sun, 30 Jun 2013 20:42:29 +0200 (CEST) (envelope-from tijl@coosemans.org) Message-ID: <51D07C10.2000509@coosemans.org> Date: Sun, 30 Jun 2013 20:42:24 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130517 Thunderbird/17.0.6 MIME-Version: 1.0 To: Ed Schouten Subject: Re: svn commit: r252411 - head/sys/sys References: <201306300854.r5U8sfYS018720@svn.freebsd.org> In-Reply-To: <201306300854.r5U8sfYS018720@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2ILACXFUOGTUTVWQQNEPG" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2013 18:42:40 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2ILACXFUOGTUTVWQQNEPG Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2013-06-30 10:54, Ed Schouten wrote: > Author: ed > Date: Sun Jun 30 08:54:41 2013 > New Revision: 252411 > URL: http://svnweb.freebsd.org/changeset/base/252411 >=20 > Log: > Make various fixes to . > =20 > - According to the standard, memory_order is a type. Use a typedef. > =20 > - atomic_*_fence() and atomic_flag_*() are described by the standard = as > functions. Use inline functions to implement them. > =20 > - Only expose the atomic_*_explicit() functions in kernel space. We > should not use the short-hand functions, as they will always use > memory_order_seq_cst. >=20 > Modified: > head/sys/sys/stdatomic.h >=20 > Modified: head/sys/sys/stdatomic.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/stdatomic.h Sun Jun 30 08:36:19 2013 (r252410) > +++ head/sys/sys/stdatomic.h Sun Jun 30 08:54:41 2013 (r252411) > @@ -122,33 +122,44 @@ > * atomic operations. > */ > =20 > -enum memory_order { > +typedef enum { > memory_order_relaxed =3D __ATOMIC_RELAXED, > memory_order_consume =3D __ATOMIC_CONSUME, > memory_order_acquire =3D __ATOMIC_ACQUIRE, > memory_order_release =3D __ATOMIC_RELEASE, > memory_order_acq_rel =3D __ATOMIC_ACQ_REL, > memory_order_seq_cst =3D __ATOMIC_SEQ_CST > -}; > +} memory_order; > =20 > /* > * 7.17.4 Fences. > */ > =20 > +static __inline void > +atomic_thread_fence(memory_order __order __unused) I don't think you can use static inline. Standard library functions need to have external linkage, which means you have to implement them in libc.= What you can do is declare the function in the header and then define a macro implementation of it. > * 7.17.8 Atomic flag type and operations. > + * > + * XXX: Assume atomic_bool can be used as an atomic_flag. Is there som= e > + * kind of compiler built-in type we could use? I think you can just use unsigned char. Only the test-and-set and clear operations need to be atomic. Anything else (like copy-assignment) doesn't have to be atomic. Both clang and gcc have __atomic_test_and_set and __atomic_clear built-ins. ------enig2ILACXFUOGTUTVWQQNEPG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iF4EAREIAAYFAlHQfBQACgkQfoCS2CCgtiva1gD/e65/WqdD1WKrF0cKgoPZD8sx O7SuZ5m9QhfKSsGlvHYA/0RK+GIOHckP5uxeamAzkbQzBXDbxHTb8GpPgHS0kzOQ =LVim -----END PGP SIGNATURE----- ------enig2ILACXFUOGTUTVWQQNEPG--