From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 21:49:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B7AA1065670; Thu, 26 Jul 2012 21:49:28 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (vlakno.cz [46.28.110.116]) by mx1.freebsd.org (Postfix) with ESMTP id ECF0F8FC12; Thu, 26 Jul 2012 21:49:27 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id 5FBE07F3D67; Thu, 26 Jul 2012 23:39:59 +0200 (CEST) Date: Thu, 26 Jul 2012 23:39:59 +0200 From: Roman Divacky To: Luigi Rizzo Message-ID: <20120726213959.GA12908@freebsd.org> References: <201207262137.q6QLbwGi028133@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201207262137.q6QLbwGi028133@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238818 - head/sys/dev/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 21:49:28 -0000 Why dont you use __builtin_prefetch() ? On Thu, Jul 26, 2012 at 09:37:58PM +0000, Luigi Rizzo wrote: > Author: luigi > Date: Thu Jul 26 21:37:58 2012 > New Revision: 238818 > URL: http://svn.freebsd.org/changeset/base/238818 > > Log: > define prefetch as a noop on !x86 > > Modified: > head/sys/dev/netmap/netmap.c > > Modified: head/sys/dev/netmap/netmap.c > ============================================================================== > --- head/sys/dev/netmap/netmap.c Thu Jul 26 20:41:36 2012 (r238817) > +++ head/sys/dev/netmap/netmap.c Thu Jul 26 21:37:58 2012 (r238818) > @@ -220,7 +220,11 @@ struct nm_bridge nm_bridges[NM_BRIDGES]; > #ifndef linux > static inline void prefetch (const void *x) > { > +#if defined(__i386__) || defined(__amd64__) > __asm volatile("prefetcht0 %0" :: "m" (*(const unsigned long *)x)); > +#else > + (void)x; > +#endif > } > #endif /* !linux */ >