+ return (thread_should_halt_fast(th));
+}
+
+#if CONFIG_DTRACE
+uint32_t dtrace_get_thread_predcache(thread_t thread)
+{
+ if (thread != THREAD_NULL)
+ return thread->t_dtrace_predcache;
+ else
+ return 0;
+}
+
+int64_t dtrace_get_thread_vtime(thread_t thread)
+{
+ if (thread != THREAD_NULL)
+ return thread->t_dtrace_vtime;
+ else
+ return 0;
+}
+
+int64_t dtrace_get_thread_tracing(thread_t thread)
+{
+ if (thread != THREAD_NULL)
+ return thread->t_dtrace_tracing;
+ else
+ return 0;
+}
+
+boolean_t dtrace_get_thread_reentering(thread_t thread)
+{
+ if (thread != THREAD_NULL)
+ return (thread->options & TH_OPT_DTRACE) ? TRUE : FALSE;
+ else
+ return 0;
+}
+
+vm_offset_t dtrace_get_kernel_stack(thread_t thread)
+{
+ if (thread != THREAD_NULL)
+ return thread->kernel_stack;
+ else
+ return 0;
+}
+
+int64_t dtrace_calc_thread_recent_vtime(thread_t thread)
+{
+#if STAT_TIME
+ if (thread != THREAD_NULL) {
+ return timer_grab(&(thread->system_timer)) + timer_grab(&(thread->user_timer));
+ } else
+ return 0;
+#else
+ if (thread != THREAD_NULL) {
+ processor_t processor = current_processor();
+ uint64_t abstime = mach_absolute_time();
+ timer_t timer;
+
+ timer = PROCESSOR_DATA(processor, thread_timer);
+
+ return timer_grab(&(thread->system_timer)) + timer_grab(&(thread->user_timer)) +
+ (abstime - timer->tstamp); /* XXX need interrupts off to prevent missed time? */
+ } else
+ return 0;
+#endif
+}
+
+void dtrace_set_thread_predcache(thread_t thread, uint32_t predcache)
+{
+ if (thread != THREAD_NULL)
+ thread->t_dtrace_predcache = predcache;
+}
+
+void dtrace_set_thread_vtime(thread_t thread, int64_t vtime)
+{
+ if (thread != THREAD_NULL)
+ thread->t_dtrace_vtime = vtime;
+}
+
+void dtrace_set_thread_tracing(thread_t thread, int64_t accum)
+{
+ if (thread != THREAD_NULL)
+ thread->t_dtrace_tracing = accum;