Loading...
iokit/Kernel/IOInterruptController.cpp xnu-12377.101.15 xnu-7195.60.75
--- xnu/xnu-12377.101.15/iokit/Kernel/IOInterruptController.cpp
+++ xnu/xnu-7195.60.75/iokit/Kernel/IOInterruptController.cpp
@@ -479,7 +479,7 @@
 
 
 	if (isStart) {
-#if SCHED_HYGIENE_DEBUG
+#if INTERRUPT_MASKED_DEBUG
 		ml_irq_debug_start((uintptr_t)vector->handler, (uintptr_t)vector);
 #endif
 		IOTimeStampStartConstant(IODBG_INTC(IOINTC_HANDLER), (uintptr_t)vectorNumber, (uintptr_t)unslidHandler,
@@ -487,7 +487,7 @@
 	} else {
 		IOTimeStampEndConstant(IODBG_INTC(IOINTC_HANDLER), (uintptr_t)vectorNumber, (uintptr_t)unslidHandler,
 		    (uintptr_t)unslidTarget, (uintptr_t)providerID);
-#if SCHED_HYGIENE_DEBUG
+#if INTERRUPT_MASKED_DEBUG
 		ml_irq_debug_end();
 #endif
 	}
@@ -535,7 +535,7 @@
 	provider = this;
 
 	// Allocate the IOInterruptSource so this can act like a nub.
-	_interruptSources = IONew(IOInterruptSource, 1);
+	_interruptSources = (IOInterruptSource *)IOMalloc(sizeof(IOInterruptSource));
 	if (_interruptSources == NULL) {
 		return kIOReturnNoMemory;
 	}
@@ -557,11 +557,12 @@
 
 	// Allocate the memory for the vectors
 	numVectors = kIOSharedInterruptControllerDefaultVectors; // For now a constant number.
-	vectors = IONewZero(IOInterruptVector, numVectors);
+	vectors = (IOInterruptVector *)IOMalloc(numVectors * sizeof(IOInterruptVector));
 	if (vectors == NULL) {
-		IODelete(_interruptSources, IOInterruptSource, 1);
+		IOFree(_interruptSources, sizeof(IOInterruptSource));
 		return kIOReturnNoMemory;
 	}
+	bzero(vectors, numVectors * sizeof(IOInterruptVector));
 
 	// Allocate the lock for the controller.
 	controllerLock = IOSimpleLockAlloc();
@@ -634,7 +635,7 @@
 	}
 
 	// Create the vectorData for the IOInterruptSource.
-	vectorData = OSData::withValue(vectorNumber);
+	vectorData = OSData::withBytes(&vectorNumber, sizeof(vectorNumber));
 	if (vectorData == NULL) {
 		IOLockUnlock(vector->interruptLock);
 		return kIOReturnNoMemory;
@@ -689,10 +690,6 @@
 
 		// Soft disable the source and the controller too.
 		disableInterrupt(nub, source);
-
-		// Free vectorData
-		IOInterruptSource *interruptSources = nub->_interruptSources;
-		OSSafeReleaseNULL(interruptSources[source].vectorData);
 
 		// Clear all the storage for the vector except for interruptLock.
 		vector->interruptActive = 0;