Big merge: thanks alex and greatlord. Not a complete merge but most
[reactos.git] / reactos / ntoskrnl / ke / dpc.c
index 9500adb..57ccce4 100644 (file)
@@ -41,7 +41,7 @@ KiQuantumEnd(VOID)
     if (InterlockedExchange(&Prcb->DpcSetEventRequest, 0))
     {
         /* Signal it */
-        KeSetEvent(&Prcb->DpcEvent, 0, 0);
+        KeSetEvent((PVOID)&Prcb->DpcEvent, 0, 0);
     }
 
     /* Lock dispatcher */
@@ -161,7 +161,7 @@ KiRetireDpcList(IN PKPRCB Prcb)
                 KefReleaseSpinLockFromDpcLevel(&DpcData->DpcLock);
 
                 /* Re-enable interrupts */
-                Ke386EnableInterrupts();
+                KeEnableInterrupts();
 
                 /* Call the DPC */
                 DeferredRoutine(Dpc,
@@ -171,7 +171,7 @@ KiRetireDpcList(IN PKPRCB Prcb)
                 ASSERT_IRQL(DISPATCH_LEVEL);
 
                 /* Disable interrupts and keep looping */
-                Ke386DisableInterrupts();
+                KeDisableInterrupts();
             }
             else
             {
@@ -336,9 +336,13 @@ KeInsertQueueDpc(IN PKDPC Dpc,
                      */
                     if (((Dpc->Importance == HighImportance) ||
                         (DpcData->DpcQueueDepth >=
-                         Prcb->MaximumDpcQueueDepth)) &&
+                         Prcb->MaximumDpcQueueDepth))
+#ifndef _M_PPC
+                                   &&
                         (!(AFFINITY_MASK(Cpu) & IdleProcessorMask) ||
-                         (Prcb->Sleeping)))
+                         (Prcb->Sleeping))
+#endif
+                      )
                     {
                         /* Set interrupt requested */
                         Prcb->DpcInterruptRequested = TRUE;
@@ -402,7 +406,7 @@ KeRemoveQueueDpc(IN PKDPC Dpc)
     ASSERT_DPC(Dpc);
 
     /* Disable interrupts */
-    Ke386DisableInterrupts();
+    KeDisableInterrupts();
 
     /* Get DPC data and type */
     DpcType = Dpc->Type;
@@ -426,7 +430,7 @@ KeRemoveQueueDpc(IN PKDPC Dpc)
     }
 
     /* Re-enable interrupts */
-    Ke386EnableInterrupts();
+    KeEnableInterrupts();
 
     /* Return if the DPC was in the queue or not */
     return DpcData ? TRUE : FALSE;