Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jul 2012 23:39:59 +0200
From:      Roman Divacky <rdivacky@freebsd.org>
To:        Luigi Rizzo <luigi@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r238818 - head/sys/dev/netmap
Message-ID:  <20120726213959.GA12908@freebsd.org>
In-Reply-To: <201207262137.q6QLbwGi028133@svn.freebsd.org>
References:  <201207262137.q6QLbwGi028133@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 */
>  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120726213959.GA12908>