PERFORCE change 104951 for review
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Thu Aug 24 16:26:13 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=104951
Change 104951 by gonzo at gonzo_hq on 2006/08/24 16:26:09
o Unbreak kernel build: move helper routines to the top of the
file so they'll be defined before used.
Affected files ...
.. //depot/projects/mips2/src/sys/mips/include/cpufunc.h#16 edit
Differences ...
==== //depot/projects/mips2/src/sys/mips/include/cpufunc.h#16 (text+ko) ====
@@ -28,13 +28,55 @@
#ifndef _MACHINE_CPUFUNC_H_
#define _MACHINE_CPUFUNC_H_
-#ifdef _KERNEL
-
#include <sys/types.h>
#include <machine/cpuregs.h>
+/*
+ * These functions are required by user-land atomi ops
+ */
static __inline void
+mips_barrier(void)
+{
+ __asm __volatile (".set noreorder\n\t"
+ "nop\n\t"
+ "nop\n\t"
+ "nop\n\t"
+ "nop\n\t"
+ "nop\n\t"
+ "nop\n\t"
+ "nop\n\t"
+ "nop\n\t"
+ ".set reorder\n\t"
+ : : : "memory");
+}
+
+static __inline void
+mips_wbflush(void)
+{
+ __asm __volatile ("sync" : : : "memory");
+ mips_barrier();
+#if 0
+ __asm __volatile("mtc0 %0, $12\n" /* MIPS_COP_0_STATUS */
+ : : "r" (flag));
+#endif
+}
+
+static __inline void
+mips_read_membar(void)
+{
+ /* Nil */
+}
+
+static __inline void
+mips_write_membar(void)
+{
+ mips_wbflush();
+}
+
+#ifdef _KERNEL
+
+static __inline void
mips_tlbp(void)
{
__asm __volatile ("tlbp");
@@ -194,47 +236,4 @@
#endif /* _KERNEL */
-/*
- * These functions are required by user-land atomi ops
- */
-
-static __inline void
-mips_barrier(void)
-{
- __asm __volatile (".set noreorder\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n\t"
- ".set reorder\n\t"
- : : : "memory");
-}
-
-static __inline void
-mips_wbflush(void)
-{
- __asm __volatile ("sync" : : : "memory");
- mips_barrier();
-#if 0
- __asm __volatile("mtc0 %0, $12\n" /* MIPS_COP_0_STATUS */
- : : "r" (flag));
-#endif
-}
-
-static __inline void
-mips_read_membar(void)
-{
- /* Nil */
-}
-
-static __inline void
-mips_write_membar(void)
-{
- mips_wbflush();
-}
-
#endif /* !_MACHINE_CPUFUNC_H_ */
More information about the p4-projects
mailing list