summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Plauger <Dave.Plauger@Sun.COM>2008-12-08 18:24:52 -0800
committerDavid Plauger <Dave.Plauger@Sun.COM>2008-12-08 18:24:52 -0800
commiteb4462ac197c9f36b7914ce628040433e1278f30 (patch)
treea128621d88d98965ac2485a3ae2ce14d4057352e
parent7d82f0f819f2fde1c321b8ac4ff15e494c5eb4b1 (diff)
downloadillumos-gate-eb4462ac197c9f36b7914ce628040433e1278f30.tar.gz
6555476 pcacheset_cmp is inefficient (fix gcc build)
-rw-r--r--usr/src/uts/common/syscall/poll.c1
-rw-r--r--usr/src/uts/intel/asm/cpu.h2
-rw-r--r--usr/src/uts/sparc/asm/flush.h17
-rw-r--r--usr/src/uts/sparc/sys/cpu.h20
4 files changed, 19 insertions, 21 deletions
diff --git a/usr/src/uts/common/syscall/poll.c b/usr/src/uts/common/syscall/poll.c
index 86a44d7c09..26dff3c39b 100644
--- a/usr/src/uts/common/syscall/poll.c
+++ b/usr/src/uts/common/syscall/poll.c
@@ -54,6 +54,7 @@
#include <sys/rctl.h>
#include <sys/port_impl.h>
#include <sys/schedctl.h>
+#include <sys/cpu.h>
#define NPHLOCKS 64 /* Number of locks; must be power of 2 */
#define PHLOCKADDR(php) &plocks[(((uintptr_t)(php)) >> 8) & (NPHLOCKS - 1)]
diff --git a/usr/src/uts/intel/asm/cpu.h b/usr/src/uts/intel/asm/cpu.h
index 0b2bb92ba1..4c63e4fa8b 100644
--- a/usr/src/uts/intel/asm/cpu.h
+++ b/usr/src/uts/intel/asm/cpu.h
@@ -123,7 +123,7 @@ extern __inline__ void __swapgs(void)
extern __inline__ void prefetch64(caddr_t addr)
{
__asm__ __volatile__(
- "prefetcht0 (%0)"
+ "prefetcht0 (%0);"
"prefetcht0 32(%0)"
: /* no output */
: "r" (addr));
diff --git a/usr/src/uts/sparc/asm/flush.h b/usr/src/uts/sparc/asm/flush.h
index 417b61b18a..5aa650be85 100644
--- a/usr/src/uts/sparc/asm/flush.h
+++ b/usr/src/uts/sparc/asm/flush.h
@@ -51,23 +51,6 @@ doflush(void *addr)
#endif /* !__lint && __GNUC__ */
-#if !defined(__lint) && defined(__GNUC__)
-
-extern __inline__ void
-prefetch64(caddr_t addr)
-{
-#if defined(__sparcv9)
- __asm__ __volatile__(
- "prefetch [%0], #n_writes\n\t"
- : /* no output */
- : "0" (addr));
-#else
-#error "port me"
-#endif
-}
-
-#endif /* !__lint && __GNUC__ */
-
#ifdef __cplusplus
}
#endif
diff --git a/usr/src/uts/sparc/sys/cpu.h b/usr/src/uts/sparc/sys/cpu.h
index 6f0fbc919d..adf3d98c42 100644
--- a/usr/src/uts/sparc/sys/cpu.h
+++ b/usr/src/uts/sparc/sys/cpu.h
@@ -19,15 +19,13 @@
* CDDL HEADER END
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_CPU_H
#define _SYS_CPU_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Include generic bustype cookies.
*/
@@ -72,6 +70,22 @@ extern int vac;
extern void cpu_smt_pause();
#define SMT_PAUSE() { if (&cpu_smt_pause) cpu_smt_pause(); }
+/*
+ * used to preload L2 cache
+ */
+#if !defined(__lint) && defined(__GNUC__)
+
+extern __inline__ void
+prefetch64(caddr_t addr)
+{
+ __asm__ __volatile__(
+ "prefetch [%0], #n_writes\n\t"
+ : "=r" (addr)
+ : "0" (addr));
+}
+
+#endif /* !__lint && __GNUC__ */
+
#endif /* defined(_KERNEL) && !defined(_ASM) */
#ifdef __cplusplus