svn commit: r227641 - head/sys/dev/sfxge/common
Marius Strobl
marius at FreeBSD.org
Thu Nov 17 22:59:16 UTC 2011
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__)
More information about the svn-src-all
mailing list