[HAL] Eliminate tail calls from HalEndSystemInterrupt. CORE-14076
authorThomas Faber <thomas.faber@reactos.org>
Sun, 18 Feb 2018 11:49:24 +0000 (12:49 +0100)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 18 Feb 2018 12:06:41 +0000 (13:06 +0100)
hal/halx86/up/pic.S
hal/halx86/up/pic.c

index 1703047..8211718 100644 (file)
@@ -50,5 +50,6 @@ ENDM
 
 
 DEFINE_END_INTERRUPT_WRAPPER HalpEndSoftwareInterrupt, HalpEndSoftwareInterrupt2
+DEFINE_END_INTERRUPT_WRAPPER HalEndSystemInterrupt, HalEndSystemInterrupt2
 
 END
index f61bf73..2d1d6d1 100644 (file)
@@ -1139,10 +1139,10 @@ HalBeginSystemInterrupt(IN KIRQL Irql,
 /*
  * @implemented
  */
-VOID
-NTAPI
-HalEndSystemInterrupt(IN KIRQL OldIrql,
-                      IN PKTRAP_FRAME TrapFrame)
+PHAL_SW_INTERRUPT_HANDLER_2ND_ENTRY
+FASTCALL
+HalEndSystemInterrupt2(IN KIRQL OldIrql,
+                       IN PKTRAP_FRAME TrapFrame)
 {
     ULONG PendingIrql, PendingIrqlMask, PendingIrqMask;
     PKPCR Pcr = KeGetPcr();
@@ -1156,7 +1156,7 @@ HalEndSystemInterrupt(IN KIRQL OldIrql,
     if (PendingIrqlMask)
     {
         /* Check for in-service delayed interrupt */
-        if (Pcr->IrrActive & 0xFFFFFFF0) return;
+        if (Pcr->IrrActive & 0xFFFFFFF0) return NULL;
 
         /* Loop checking for pending interrupts */
         while (TRUE)
@@ -1172,7 +1172,7 @@ HalEndSystemInterrupt(IN KIRQL OldIrql,
 
                 /* Now check if this specific interrupt is already in-service */
                 PendingIrqMask = (1 << PendingIrql);
-                if (Pcr->IrrActive & PendingIrqMask) return;
+                if (Pcr->IrrActive & PendingIrqMask) return NULL;
 
                 /* Set active bit otherwise, and clear it from IRR */
                 Pcr->IrrActive |= PendingIrqMask;
@@ -1191,11 +1191,12 @@ HalEndSystemInterrupt(IN KIRQL OldIrql,
             else
             {
                 /* Now handle pending software interrupt */
-                SWInterruptHandlerTable2[PendingIrql](TrapFrame);
-                UNREACHABLE;
+                return SWInterruptHandlerTable2[PendingIrql];
             }
         }
     }
+
+    return NULL;
 }
 
 /* SOFTWARE INTERRUPT TRAPS ***************************************************/