svn commit: r238907 - projects/calloutng/sys/kern
Konstantin Belousov
kostikbel at gmail.com
Wed Sep 19 04:18:16 UTC 2012
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 at freebsd.org> wrote:
> > On 9/18/12, Konstantin Belousov <kostikbel at 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.
>
> Here is the patch. I didn't use a real extern function body for it,
> but just went with an empty macro.
>
> Attilio
> +/*
> + * Compiler memory barriers, specific to gcc and clang.
> + */
> +#if defined(__GNUC__)
> +#define __compiler_membar() __asm __volatile(" " : : : "memory")
> +#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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-projects/attachments/20120919/0eccf9a6/attachment.pgp
More information about the svn-src-projects
mailing list