svn commit: r238818 - head/sys/dev/netmap
Roman Divacky
rdivacky at freebsd.org
Thu Jul 26 21:49:28 UTC 2012
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 */
>
More information about the svn-src-head
mailing list