started moving tags to a private internal header
[reactos.git] / reactos / ntoskrnl / io / irq.c
index 66dee26..d80f7c0 100644 (file)
@@ -1,9 +1,11 @@
-/*
+/* $Id$
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/io/irq.c
  * PURPOSE:         IRQ handling
- * PROGRAMMER:      David Welch (welch@mcmail.com)
+ *
+ * PROGRAMMERS:     David Welch (welch@mcmail.com)
  */
 
 /* INCLUDES *****************************************************************/
 #define NDEBUG
 #include <internal/debug.h>
 
-/* GLOBALS *****************************************************************/
-
-#define TAG_KINTERRUPT   TAG('K', 'I', 'S', 'R')
-
 /* FUNCTIONS *****************************************************************/
 
 /*
@@ -36,7 +34,7 @@ IoConnectInterrupt(PKINTERRUPT* InterruptObject,
 /*
  * FUNCTION: Registers a driver's isr to be called when its device interrupts
  * ARGUMENTS:
- *        InterruptObject (OUT) = Points to the interrupt object created on 
+ *        InterruptObject (OUT) = Points to the interrupt object created on
  *                                return
  *        ServiceRoutine = Routine to be called when the device interrupts
  *        ServiceContext = Parameter to be passed to ServiceRoutine
@@ -44,7 +42,7 @@ IoConnectInterrupt(PKINTERRUPT* InterruptObject,
  *                   access between the isr and other driver routines. This is
  *                   required if the isr handles more than one vector or the
  *                   driver has more than one isr
- *        Vector = Interrupt vector to allocate 
+ *        Vector = Interrupt vector to allocate
  *                 (returned from HalGetInterruptVector)
  *        Irql = DIRQL returned from HalGetInterruptVector
  *        SynchronizeIrql = DIRQL at which the isr will execute. This must
@@ -63,18 +61,18 @@ IoConnectInterrupt(PKINTERRUPT* InterruptObject,
 {
    PKINTERRUPT Interrupt;
    ULONG i, count;
-   
+
    ASSERT_IRQL(PASSIVE_LEVEL);
-   
+
    DPRINT("IoConnectInterrupt(Vector %x)\n",Vector);
-   
+
    ProcessorEnableMask &= ((1 << KeNumberProcessors) - 1);
 
    if (ProcessorEnableMask == 0)
      {
        return STATUS_INVALID_PARAMETER;
      }
-  
+
    for (i = 0, count = 0; i < KeNumberProcessors; i++)
      {
        if (ProcessorEnableMask & (1 << i))
@@ -119,7 +117,10 @@ IoConnectInterrupt(PKINTERRUPT* InterruptObject,
              {
               for (i = 0; i < count; i++)
                 {
-                  KeDisconnectInterrupt(&Interrupt[i]);
+                  if (ProcessorEnableMask & (1 << i))
+                    {
+                      KeDisconnectInterrupt(&Interrupt[i]);
+                    }
                 }
               ExFreePool(Interrupt);
               return STATUS_INVALID_PARAMETER;