PERFORCE change 104859 for review
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Wed Aug 23 21:32:07 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=104859
Change 104859 by gonzo at gonzo_hideout on 2006/08/23 21:31:24
o Introduce barrier functions to userland.
Affected files ...
.. //depot/projects/mips2/src/sys/mips/include/cpufunc.h#15 edit
Differences ...
==== //depot/projects/mips2/src/sys/mips/include/cpufunc.h#15 (text+ko) ====
@@ -33,21 +33,6 @@
#include <sys/types.h>
#include <machine/cpuregs.h>
-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_tlbp(void)
@@ -93,16 +78,6 @@
mips_barrier();
}
-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
-}
#if 0 /* XXX mips64 */
@@ -217,7 +192,40 @@
__asm __volatile ("break");
}
+#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 */
@@ -229,6 +237,4 @@
mips_wbflush();
}
-#endif /* _KERNEL */
-
#endif /* !_MACHINE_CPUFUNC_H_ */
More information about the p4-projects
mailing list