Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Aug 2006 21:32:05 GMT
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 104859 for review
Message-ID:  <200608232132.k7NLW5cH019744@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=104859

Change 104859 by gonzo@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_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608232132.k7NLW5cH019744>