PERFORCE change 97117 for review
John Birrell
jb at FreeBSD.org
Sun May 14 00:51:09 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=97117
Change 97117 by jb at jb_freebsd2 on 2006/05/14 00:50:01
Use the thread-local-key including the interrupt level from the
per-cpu structure.
Affected files ...
.. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace.c#22 edit
Differences ...
==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace.c#22 (text+ko) ====
@@ -327,8 +327,8 @@
/*
* The key for a thread-local variable consists of the lower 61 bits of the
- * t_did, plus the 3 bits of the highest active interrupt above LOCK_LEVEL.
- * We add DIF_VARIABLE_MAX to t_did to assure that the thread key is never
+ * td_tid, plus the 3 bits of the highest active interrupt.
+ * We add DIF_VARIABLE_MAX to td_tid to assure that the thread key is never
* equal to a variable identifier. This is necessary (but not sufficient) to
* assure that global associative arrays never collide with thread-local
* variables. To guarantee that they cannot collide, we must also define the
@@ -340,23 +340,15 @@
* 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); \
+ uint_t actv = pcpu_find(curcpu)->pc_intr_actv; \
for (; actv; actv >>= 1) \
intr++; \
ASSERT(intr < (1 << 3)); \
- (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