// 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;
-
+#if !defined(__i386__) && !defined(__x86_64__)
+ OSMemoryBarrier();
+#endif
enableVector(vectorNumber, vector);
}
}
IOInterruptAction
IOInterruptController::getInterruptHandlerAddress(void)
{
- return 0;
+ return NULL;
}
IOReturn
// 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--;