]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/Kernel/IOTimerEventSource.cpp
xnu-2782.20.48.tar.gz
[apple/xnu.git] / iokit / Kernel / IOTimerEventSource.cpp
index c71feccf0ca8671127a9c85afa0505932709d023..df939da91c0fe02d1ef4eaf4804f99cd78c0d0ee 100644 (file)
@@ -41,6 +41,9 @@ __END_DECLS
 
 #include <IOKit/IOTimeStamp.h>
 #include <IOKit/IOKitDebug.h>
 
 #include <IOKit/IOTimeStamp.h>
 #include <IOKit/IOKitDebug.h>
+#if CONFIG_DTRACE
+#include <mach/sdt.h>
+#endif
 
 #define super IOEventSource
 OSDefineMetaClassAndStructors(IOTimerEventSource, IOEventSource)
 
 #define super IOEventSource
 OSDefineMetaClassAndStructors(IOTimerEventSource, IOEventSource)
@@ -114,13 +117,16 @@ void IOTimerEventSource::timeout(void *self)
                
                if (trace)
                        IOTimeStampStartConstant(IODBG_TIMES(IOTIMES_ACTION),
                
                if (trace)
                        IOTimeStampStartConstant(IODBG_TIMES(IOTIMES_ACTION),
-                                                                                        (uintptr_t) doit, (uintptr_t) me->owner);
+                                                                                        VM_KERNEL_UNSLIDE(doit), (uintptr_t) me->owner);
                                
                 (*doit)(me->owner, me);
                                
                 (*doit)(me->owner, me);
+#if CONFIG_DTRACE
+               DTRACE_TMR3(iotescallout__expire, Action, doit, OSObject, me->owner, void, me->workLoop);
+#endif
                 
                                if (trace)
                        IOTimeStampEndConstant(IODBG_TIMES(IOTIMES_ACTION),
                 
                                if (trace)
                        IOTimeStampEndConstant(IODBG_TIMES(IOTIMES_ACTION),
-                                                                                  (uintptr_t) doit, (uintptr_t) me->owner);
+                                                                                  VM_KERNEL_UNSLIDE(doit), (uintptr_t) me->owner);
             }
             IOStatisticsOpenGate();
             wl->openGate();
             }
             IOStatisticsOpenGate();
             wl->openGate();
@@ -153,13 +159,16 @@ void IOTimerEventSource::timeoutAndRelease(void * self, void * c)
                
                if (trace)
                        IOTimeStampStartConstant(IODBG_TIMES(IOTIMES_ACTION),
                
                if (trace)
                        IOTimeStampStartConstant(IODBG_TIMES(IOTIMES_ACTION),
-                                                                                        (uintptr_t) doit, (uintptr_t) me->owner);
+                                                                                        VM_KERNEL_UNSLIDE(doit), (uintptr_t) me->owner);
                                
                 (*doit)(me->owner, me);
                                
                 (*doit)(me->owner, me);
+#if CONFIG_DTRACE
+               DTRACE_TMR3(iotescallout__expire, Action, doit, OSObject, me->owner, void, me->workLoop);
+#endif
                 
                                if (trace)
                        IOTimeStampEndConstant(IODBG_TIMES(IOTIMES_ACTION),
                 
                                if (trace)
                        IOTimeStampEndConstant(IODBG_TIMES(IOTIMES_ACTION),
-                                                                                  (uintptr_t) doit, (uintptr_t) me->owner);
+                                                                                  VM_KERNEL_UNSLIDE(doit), (uintptr_t) me->owner);
             }
             IOStatisticsOpenGate();
             wl->openGate();
             }
             IOStatisticsOpenGate();
             wl->openGate();
@@ -360,7 +369,7 @@ IOReturn IOTimerEventSource::wakeAtTime(AbsoluteTime inAbstime)
             reserved->workLoop = workLoop;
             reserved->calloutGeneration++;
             if (thread_call_enter1_delayed((thread_call_t) calloutEntry, 
             reserved->workLoop = workLoop;
             reserved->calloutGeneration++;
             if (thread_call_enter1_delayed((thread_call_t) calloutEntry, 
-                    (void *) reserved->calloutGeneration, inAbstime))
+                    (void *)(uintptr_t) reserved->calloutGeneration, inAbstime))
             {
                 release();
                 workLoop->release();
             {
                 release();
                 workLoop->release();