Loading...
--- xnu/xnu-2050.22.13/iokit/Kernel/IOInterruptController.cpp
+++ xnu/xnu-3789.31.2/iokit/Kernel/IOInterruptController.cpp
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 1998-2010 Apple Inc. All rights reserved.
+ * Copyright (c) 2007-2012 Apple Inc. All rights reserved.
+ * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
@@ -290,7 +291,10 @@
if (vector->interruptDisabledSoft) {
vector->interruptDisabledSoft = 0;
-
+#if !defined(__i386__) && !defined(__x86_64__)
+ OSMemoryBarrier();
+#endif
+
if (!getPlatform()->atInterruptLevel()) {
while (vector->interruptActive)
{}
@@ -318,6 +322,9 @@
vector = &vectors[vectorNumber];
vector->interruptDisabledSoft = 1;
+#if !defined(__i386__) && !defined(__x86_64__)
+ OSMemoryBarrier();
+#endif
if (!getPlatform()->atInterruptLevel()) {
while (vector->interruptActive)
@@ -411,6 +418,8 @@
{
int cnt, interruptType;
IOReturn error;
+
+ reserved = NULL;
if (!super::init())
return kIOReturnNoResources;
@@ -510,6 +519,7 @@
// Create the vectorData for the IOInterruptSource.
vectorData = OSData::withBytes(&vectorNumber, sizeof(vectorNumber));
if (vectorData == 0) {
+ IOLockUnlock(vector->interruptLock);
return kIOReturnNoMemory;
}
@@ -644,6 +654,10 @@
interruptState = IOSimpleLockLockDisableInterrupt(controllerLock);
if (!vector->interruptDisabledSoft) {
vector->interruptDisabledSoft = 1;
+#if !defined(__i386__) && !defined(__x86_64__)
+ OSMemoryBarrier();
+#endif
+
vectorsEnabled--;
}
IOSimpleLockUnlockEnableInterrupt(controllerLock, interruptState);
@@ -673,6 +687,10 @@
vector = &vectors[vectorNumber];
vector->interruptActive = 1;
+#if !defined(__i386__) && !defined(__x86_64__)
+ OSMemoryBarrier();
+#endif
+
if (!vector->interruptDisabledSoft) {
// Call the handler if it exists.