Date: Thu, 17 Nov 2011 22:59:16 +0000 (UTC) From: Marius Strobl <marius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r227641 - head/sys/dev/sfxge/common Message-ID: <201111172259.pAHMxGk8034625@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marius Date: Thu Nov 17 22:59:16 2011 New Revision: 227641 URL: http://svn.freebsd.org/changeset/base/227641 Log: Implement prefetch_read_{many,once}() for sparc64 and fix compilation on other !x86 architectures. Modified: head/sys/dev/sfxge/common/efsys.h Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Thu Nov 17 22:56:40 2011 (r227640) +++ head/sys/dev/sfxge/common/efsys.h Thu Nov 17 22:59:16 2011 (r227641) @@ -97,10 +97,11 @@ extern "C" { MALLOC_DECLARE(M_SFXGE); /* Machine dependend prefetch wrappers */ -#if defined(__i386) || defined(__amd64) +#if defined(__i386__) || defined(__amd64__) static __inline void prefetch_read_many(void *addr) { + __asm__( "prefetcht0 (%0)" : @@ -110,11 +111,44 @@ prefetch_read_many(void *addr) static __inline void prefetch_read_once(void *addr) { + __asm__( "prefetchnta (%0)" : : "r" (addr)); } +#elif defined(__sparc64__) +static __inline void +prefetch_read_many(void *addr) +{ + + __asm__( + "prefetch [%0], 0" + : + : "r" (addr)); +} + +static __inline void +prefetch_read_once(void *addr) +{ + + __asm__( + "prefetch [%0], 1" + : + : "r" (addr)); +} +#else +static __inline void +prefetch_read_many(void *addr) +{ + +} + +static __inline void +prefetch_read_once(void *addr) +{ + +} #endif #if defined(__i386__) || defined(__amd64__)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111172259.pAHMxGk8034625>