OSDefineMetaClassAndAbstractStructors(IOInterruptController, IOService);
-OSMetaClassDefineReservedUnused(IOInterruptController, 0);
-OSMetaClassDefineReservedUnused(IOInterruptController, 1);
-OSMetaClassDefineReservedUnused(IOInterruptController, 2);
+OSMetaClassDefineReservedUsedX86(IOInterruptController, 0);
+OSMetaClassDefineReservedUsedX86(IOInterruptController, 1);
+OSMetaClassDefineReservedUsedX86(IOInterruptController, 2);
OSMetaClassDefineReservedUnused(IOInterruptController, 3);
OSMetaClassDefineReservedUnused(IOInterruptController, 4);
OSMetaClassDefineReservedUnused(IOInterruptController, 5);
// register as a shared interrupt.
if (wasAlreadyRegisterd || shouldBeShared) {
// If this vector is not already shared, break it out.
- if (vector->sharedController == 0) {
+ if (vector->sharedController == NULL) {
// Make the IOShareInterruptController instance
vector->sharedController = new IOSharedInterruptController;
- if (vector->sharedController == 0) {
+ if (vector->sharedController == NULL) {
IOLockUnlock(vector->interruptLock);
return kIOReturnNoMemory;
}
enableInterrupt(originalNub, originalSource);
}
vector->sharedController->release();
- vector->sharedController = 0;
+ vector->sharedController = NULL;
IOLockUnlock(vector->interruptLock);
return error;
}
enableInterrupt(originalNub, originalSource);
vector->sharedController->release();
- vector->sharedController = 0;
+ vector->sharedController = NULL;
IOLockUnlock(vector->interruptLock);
return error;
}
vector->nub = vector->sharedController;
vector->source = 0;
vector->target = vector->sharedController;
- vector->refCon = 0;
+ vector->refCon = NULL;
// If the interrupt was already registered,
// save the driver's interrupt enablement state.
vector->interruptDisabledSoft = 0;
vector->interruptDisabledHard = 0;
vector->interruptRegistered = 0;
- vector->nub = 0;
+ vector->nub = NULL;
vector->source = 0;
- vector->handler = 0;
- vector->target = 0;
- vector->refCon = 0;
+ vector->handler = NULL;
+ vector->target = NULL;
+ vector->refCon = NULL;
IOLockUnlock(vector->interruptLock);
return kIOReturnSuccess;
IOInterruptVector *vector;
OSData *vectorData;
- if (interruptType == 0) {
+ if (interruptType == NULL) {
return kIOReturnBadArgument;
}
if (vector->interruptDisabledHard) {
vector->interruptDisabledHard = 0;
+ // A DSB ISH on ARM is needed to make sure the vector data are
+ // properly initialized before the MMIO enabling the interrupts
+ // in hardware. OSMemoryBarrier(), which maps to DMB, is not
+ // sufficient here as the CPUs are not consumers of the device
+ // write. Hence, the DMB does not guarantee the CPUs won't see an
+ // interrupt before it initalizes the vector data properly.
+ OSSynchronizeIO();
+
enableVector(vectorNumber, vector);
}
}
IOInterruptAction
IOInterruptController::getInterruptHandlerAddress(void)
{
- return 0;
+ return NULL;
}
IOReturn
{
}
+void
+IOInterruptController::setCPUInterruptProperties(IOService */*service*/)
+{
+}
+
+void
+IOInterruptController::sendIPI(unsigned int /*cpu_id*/, bool /*deferred*/)
+{
+}
+
+void
+IOInterruptController::cancelDeferredIPI(unsigned int /*cpu_id*/)
+{
+}
+
void
IOInterruptController::timeStampSpuriousInterrupt(void)
{
if (isStart) {
+#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,
(uintptr_t)unslidTarget, (uintptr_t)providerID);
} else {
IOTimeStampEndConstant(IODBG_INTC(IOINTC_HANDLER), (uintptr_t)vectorNumber, (uintptr_t)unslidHandler,
(uintptr_t)unslidTarget, (uintptr_t)providerID);
+#if INTERRUPT_MASKED_DEBUG
+ ml_irq_debug_end();
+#endif
}
}
// Allocate the IOInterruptSource so this can act like a nub.
_interruptSources = (IOInterruptSource *)IOMalloc(sizeof(IOInterruptSource));
- if (_interruptSources == 0) {
+ if (_interruptSources == NULL) {
return kIOReturnNoMemory;
}
_numInterruptSources = 1;
// Allocate the lock for the controller.
controllerLock = IOSimpleLockAlloc();
- if (controllerLock == 0) {
+ if (controllerLock == NULL) {
return kIOReturnNoResources;
}
{
IOInterruptSource *interruptSources;
IOInterruptVectorNumber vectorNumber;
- IOInterruptVector *vector = 0;
+ IOInterruptVector *vector = NULL;
OSData *vectorData;
IOInterruptState interruptState;
// Create the vectorData for the IOInterruptSource.
vectorData = OSData::withBytes(&vectorNumber, sizeof(vectorNumber));
- if (vectorData == 0) {
+ if (vectorData == NULL) {
IOLockUnlock(vector->interruptLock);
return kIOReturnNoMemory;
}
vector->interruptDisabledSoft = 0;
vector->interruptDisabledHard = 0;
vector->interruptRegistered = 0;
- vector->nub = 0;
+ vector->nub = NULL;
vector->source = 0;
- vector->handler = 0;
- vector->target = 0;
- vector->refCon = 0;
+ vector->handler = NULL;
+ vector->target = NULL;
+ vector->refCon = NULL;
interruptState = IOSimpleLockLockDisableInterrupt(controllerLock);
vectorsRegistered--;