Date: Wed, 19 Sep 2012 07:18:11 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Attilio Rao <attilio@FreeBSD.org> Cc: Davide Italiano <davide@FreeBSD.org>, src-committers@FreeBSD.org, John Baldwin <jhb@FreeBSD.org>, Jeff Roberson <jeff@FreeBSD.org>, Dimitry Andric <dim@FreeBSD.org>, svn-src-projects@FreeBSD.org Subject: Re: svn commit: r238907 - projects/calloutng/sys/kern Message-ID: <20120919041811.GM37286@deviant.kiev.zoral.com.ua> In-Reply-To: <CAJ-FndCmg-GdTf9FWQGZPYB-iGuEt-JH8HrCL%2BwaOqJ%2B8ZUbHQ@mail.gmail.com> References: <201207301350.q6UDobCI099069@svn.freebsd.org> <CAJ-FndBj8tpC_BJXs_RH8sG2TBG8yA=Lxu3-GTVT9Ap_zOCuVQ@mail.gmail.com> <CAJ-FndDnO7wjnWPV0tTu%2BUGHjsxa3YDarMxmyei3ZmjLAFvRkQ@mail.gmail.com> <201207301732.33474.jhb@freebsd.org> <CAJ-FndD5EO12xsWOAe6u0EvX00q33wxO4OivnGjzj0=T2Oe8uA@mail.gmail.com> <CAJ-FndCRg0UCThFkatp=tw7rUWWCvhsApLE=iztLpxpGBC1F9w@mail.gmail.com> <20120918083324.GX37286@deviant.kiev.zoral.com.ua> <CAJ-FndAXw6zjXr=zB3gAVQDKUV_K4=SF39iYQQOV23NkfJ=MPw@mail.gmail.com> <CAJ-FndCmg-GdTf9FWQGZPYB-iGuEt-JH8HrCL%2BwaOqJ%2B8ZUbHQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--nw7Js0ltx4YC415X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 18, 2012 at 08:00:48PM +0100, Attilio Rao wrote: > On Tue, Sep 18, 2012 at 4:30 PM, Attilio Rao <attilio@freebsd.org> wrote: > > On 9/18/12, Konstantin Belousov <kostikbel@gmail.com> wrote: > >> Traditionally, we do provide the fallback for non-GNUC compilers, by > >> defining extern function with the compatible signature. In this case, > >> the empty function just works for the purpose, although with higher > >> overhead than the GNUC case. > > > > I agree, we need a fallback here. Unfortunately I'm buried with job > > stuff but I will provide an errata patch ASAP. >=20 > Here is the patch. I didn't use a real extern function body for it, > but just went with an empty macro. >=20 > Attilio > +/* > + * Compiler memory barriers, specific to gcc and clang. > + */ > +#if defined(__GNUC__) > +#define __compiler_membar() __asm __volatile(" " : : : "memor= y") > +#else > +#define __compiler_membar() struct __hack > +#endif I would not call this an empty macro. If this works at all, it requires c99 compiler. Why not just do extern void __compiler_membar(void); for !GNUC. Note that we never supplied actual implementation for the placeholders, as evidenced e.g. by cpufunc.h or fpu.c. --nw7Js0ltx4YC415X Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlBZR4MACgkQC3+MBN1Mb4hxdwCg4wHPl+zVhvePEf2jQEmTETjD 72MAoN7T5BjU8vrkX2AdVvMsFz0MVeZq =znf+ -----END PGP SIGNATURE----- --nw7Js0ltx4YC415X--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120919041811.GM37286>