PERFORCE change 135013 for review
John Birrell
jb at FreeBSD.org
Thu Feb 7 21:26:10 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=135013
Change 135013 by jb at jb_freebsd1 on 2008/02/08 05:25:18
Add a DTrace-specific lock function copied from atomic.h but
named so that an fbt probe enabled function isn't called from
the DTrace probe context (which would cause a double fault).
Affected files ...
.. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_debug.c#3 edit
Differences ...
==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_debug.c#3 (text+ko) ====
@@ -52,6 +52,27 @@
return (res);
}
+#elif defined(__i386__)
+static __inline int
+dtrace_cmpset_long(volatile u_long *dst, u_long exp, u_long src)
+{
+ u_char res;
+
+ __asm __volatile(
+ " " lock " "
+ " cmpxchgl %2,%1 ; "
+ " sete %0 ; "
+ "1: "
+ "# dtrace_cmpset_long"
+ : "=a" (res), /* 0 */
+ "=m" (*dst) /* 1 */
+ : "r" (src), /* 2 */
+ "a" (exp), /* 3 */
+ "m" (*dst) /* 4 */
+ : "memory");
+
+ return (res);
+}
#endif
#define DTRACE_DEBUG_BUFR_SIZE (32 * 1024)
More information about the p4-projects
mailing list