Loading...
iokit/Kernel/IOInterruptEventSource.cpp xnu-3248.50.21 xnu-4903.221.2
--- xnu/xnu-3248.50.21/iokit/Kernel/IOInterruptEventSource.cpp
+++ xnu/xnu-4903.221.2/iokit/Kernel/IOInterruptEventSource.cpp
@@ -220,6 +220,19 @@
     return me;
 }
 
+IOInterruptEventSource *
+IOInterruptEventSource::interruptEventSource(OSObject *inOwner,
+					     IOService *inProvider,
+					     int inIntIndex,
+					     ActionBlock inAction)
+{
+    IOInterruptEventSource * ies;
+    ies = IOInterruptEventSource::interruptEventSource(inOwner, (Action) NULL, inProvider, inIntIndex);
+    if (ies) ies->setActionBlock((IOEventSource::ActionBlock) inAction);
+
+    return ies;
+}
+
 void IOInterruptEventSource::free()
 {
     if (provider && intIndex >= 0)
@@ -300,6 +313,7 @@
     unsigned int cacheProdCount = producerCount;
     int numInts = cacheProdCount - consumerCount;
     IOInterruptEventAction intAction = (IOInterruptEventAction) action;
+    ActionBlock intActionBlock = (ActionBlock) actionBlock;
 	bool trace = (gIOKitTrace & kIOTraceIntEventSource) ? true : false;
 	
     IOStatisticsCheckForWork();
@@ -308,7 +322,8 @@
 	{
 		if (trace)
 			IOTimeStampStartConstant(IODBG_INTES(IOINTES_ACTION),
-						 VM_KERNEL_UNSLIDE(intAction), (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop);
+						 VM_KERNEL_ADDRHIDE(intAction), VM_KERNEL_ADDRHIDE(owner),
+						 VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(workLoop));
 
 		if (reserved->statistics) {
 			if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingSecondLevelSystemTimeIndex)) {
@@ -321,7 +336,8 @@
 		}
 
 		// Call the handler
-		(*intAction)(owner, this, numInts);
+		if (kActionBlock & flags) (intActionBlock)(this, numInts);
+		else                      (*intAction)(owner, this, numInts);
 
 		if (reserved->statistics) {
 			if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingSecondLevelCountIndex)) {
@@ -341,7 +357,8 @@
 		
 		if (trace)
 			IOTimeStampEndConstant(IODBG_INTES(IOINTES_ACTION),
-					       VM_KERNEL_UNSLIDE(intAction), (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop);
+						VM_KERNEL_ADDRHIDE(intAction), VM_KERNEL_ADDRHIDE(owner),
+						VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(workLoop));
 		
 		consumerCount = cacheProdCount;
 		if (autoDisable && !explicitDisable)
@@ -352,7 +369,8 @@
 	{
 		if (trace)
 			IOTimeStampStartConstant(IODBG_INTES(IOINTES_ACTION),
-						 VM_KERNEL_UNSLIDE(intAction), (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop);
+						VM_KERNEL_ADDRHIDE(intAction), VM_KERNEL_ADDRHIDE(owner),
+						VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(workLoop));
 
 		if (reserved->statistics) {
 			if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingSecondLevelSystemTimeIndex)) {
@@ -365,7 +383,8 @@
 		}
 		
 		// Call the handler
-		(*intAction)(owner, this, -numInts);
+		if (kActionBlock & flags) (intActionBlock)(this, numInts);
+		else                      (*intAction)(owner, this, numInts);
 
 		if (reserved->statistics) {
 			if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingSecondLevelCountIndex)) {
@@ -385,7 +404,8 @@
 		
 		if (trace)
 			IOTimeStampEndConstant(IODBG_INTES(IOINTES_ACTION),
-					       VM_KERNEL_UNSLIDE(intAction), (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop);
+							VM_KERNEL_ADDRHIDE(intAction), VM_KERNEL_ADDRHIDE(owner),
+							VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(workLoop));
 		
 		consumerCount = cacheProdCount;
 		if (autoDisable && !explicitDisable)
@@ -404,7 +424,7 @@
     producerCount++;
 	
 	if (trace)
-	    IOTimeStampStartConstant(IODBG_INTES(IOINTES_SEMA), (uintptr_t) this, (uintptr_t) owner);
+	    IOTimeStampStartConstant(IODBG_INTES(IOINTES_SEMA), VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(owner));
 
     if (reserved->statistics) {
         if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingFirstLevelCountIndex)) {
@@ -415,7 +435,7 @@
     signalWorkAvailable();
 	
 	if (trace)
-	    IOTimeStampEndConstant(IODBG_INTES(IOINTES_SEMA), (uintptr_t) this, (uintptr_t) owner);
+	    IOTimeStampEndConstant(IODBG_INTES(IOINTES_SEMA), VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(owner));
 }
 
 void IOInterruptEventSource::disableInterruptOccurred
@@ -429,7 +449,7 @@
     producerCount++;
 	
 	if (trace)
-	    IOTimeStampStartConstant(IODBG_INTES(IOINTES_SEMA), (uintptr_t) this, (uintptr_t) owner);
+	    IOTimeStampStartConstant(IODBG_INTES(IOINTES_SEMA), VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(owner));
 
     if (reserved->statistics) {
         if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingFirstLevelCountIndex)) {
@@ -440,7 +460,7 @@
     signalWorkAvailable();
 	
 	if (trace)
-	    IOTimeStampEndConstant(IODBG_INTES(IOINTES_SEMA), (uintptr_t) this, (uintptr_t) owner);
+	    IOTimeStampEndConstant(IODBG_INTES(IOINTES_SEMA), VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(owner));
 }
 
 void IOInterruptEventSource::interruptOccurred