PERFORCE change 96808 for review

John Birrell jb at FreeBSD.org
Sun May 7 23:16:36 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=96808

Change 96808 by jb at jb_freebsd2 on 2006/05/07 23:15:39

	Clean up include file paths.
	
	Use the new kmem/vmem compatibility implementation.
	
	Simplify the thread-specific key macro to suit FreeBSD.

Affected files ...

.. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace.c#20 edit

Differences ...

==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace.c#20 (text+ko) ====

@@ -53,6 +53,7 @@
 #include <sys/filio.h>
 #include <sys/kdb.h>
 #include <sys/kernel.h>
+#include <sys/kmem.h>
 #include <sys/kthread.h>
 #include <sys/limits.h>
 #include <sys/linker.h>
@@ -70,13 +71,14 @@
 #include <machine/stdarg.h>
 
 #include <cddl/dev/dtrace/dtrace_mutex.h>
-#include <contrib/opensolaris/uts/common/sys/dtrace_impl.h>
+#include <sys/dtrace_impl.h>
 #include <cddl/dev/dtrace/dtrace_hacks.h>
 
 #define DTRACE_MINOR	0
 
 MALLOC_DECLARE(M_DTRACE);
 MALLOC_DEFINE(M_DTRACE, "dtrace", "Dynamic Trace");
+#define M_KMEM		M_DTRACE
 
 static d_close_t	dtrace_close;
 static d_ioctl_t	dtrace_ioctl;
@@ -338,6 +340,7 @@
  * no way for a global variable key signature to match a thread-local key
  * signature.
  */
+#if defined(sun)
 #define	DTRACE_TLS_THRKEY(where) { \
 	uint_t intr = 0; \
 	uint_t actv = CPU->cpu_intr_actv >> (LOCK_LEVEL + 1); \
@@ -347,6 +350,13 @@
 	(where) = ((curthread->t_did + DIF_VARIABLE_MAX) & \
 	    (((uint64_t)1 << 61) - 1)) | ((uint64_t)intr << 61); \
 }
+#else
+#define	DTRACE_TLS_THRKEY(where) { \
+	uint_t intr = 0; \
+	(where) = ((curthread->td_tid + DIF_VARIABLE_MAX) & \
+	    (((uint64_t)1 << 61) - 1)) | ((uint64_t)intr << 61); \
+}
+#endif
 
 #define	DTRACE_STORE(type, tomax, offset, what) \
 	*((type *)((uintptr_t)(tomax) + (uintptr_t)offset)) = (type)(what);


More information about the p4-projects mailing list