From owner-svn-src-projects@FreeBSD.ORG Wed Sep 19 07:37:08 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67359106564A; Wed, 19 Sep 2012 07:37:08 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id D30C88FC12; Wed, 19 Sep 2012 07:37:06 +0000 (UTC) Received: by lahe6 with SMTP id e6so414972lah.13 for ; Wed, 19 Sep 2012 00:37:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=rCVENcCI+062W3jBeHKRWjQrPE1++z1EIETCB/WnfGc=; b=pV8YcBm/gPynHCwSpPAjJMhTdEDTbHi5ibLZlyYQ5j40ybqGk24xkLsyfwo0BO/RoO kr9yEHhmZHciPinNHxWgBPWIjVMaYqwXxzlcX/U8/kLIodkm4o4danyFeEE0Jx/37A6G zwSQ4ZCHNCGfWe7fcIx2/RHqXAZU3qgfd1TUgmf1yU0XjBOoH4+OKbBF6NsBzlA8f4mz Vh8Xox8H94N9EPXii7Vw+Cvk9LY7ZLIJFBSM92GRXEhEAkIe5Mh2VeTFr0m9oTuvoL5M uHCWU1Et9yD5jlyu3awI5AuZqEwKlsqOef3NY3Kh/OgnAkGvnJhyVPGcDijoN3ISuUOW bOag== MIME-Version: 1.0 Received: by 10.152.112.233 with SMTP id it9mr1884479lab.40.1348040225765; Wed, 19 Sep 2012 00:37:05 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.102.39 with HTTP; Wed, 19 Sep 2012 00:37:05 -0700 (PDT) In-Reply-To: <20120919041811.GM37286@deviant.kiev.zoral.com.ua> References: <201207301350.q6UDobCI099069@svn.freebsd.org> <201207301732.33474.jhb@freebsd.org> <20120918083324.GX37286@deviant.kiev.zoral.com.ua> <20120919041811.GM37286@deviant.kiev.zoral.com.ua> Date: Wed, 19 Sep 2012 08:37:05 +0100 X-Google-Sender-Auth: ON5BQb_mdKuQnROSAcojsZqbYp0 Message-ID: From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: Davide Italiano , src-committers@freebsd.org, John Baldwin , Jeff Roberson , Dimitry Andric , svn-src-projects@freebsd.org Subject: Re: svn commit: r238907 - projects/calloutng/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 07:37:08 -0000 On Wed, Sep 19, 2012 at 5:18 AM, Konstantin Belousov wrote: > On Tue, Sep 18, 2012 at 08:00:48PM +0100, Attilio Rao wrote: >> On Tue, Sep 18, 2012 at 4:30 PM, Attilio Rao wrote: >> > On 9/18/12, Konstantin Belousov 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. So the main reason for this is to keep compliancy with c'89? Are you sure it is so important nowadays? I'm always under the impression that we are already using c'99 specific features, like structs initializers, etc. Attilio -- Peace can only be achieved by understanding - A. Einstein