https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ade345427ff8d14549cf7…
commit ade345427ff8d14549cf74c94f60e675f93d209b
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sun Feb 18 12:49:24 2018 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sun Feb 18 13:06:41 2018 +0100
[HAL] Eliminate tail calls from HalEndSystemInterrupt. CORE-14076
---
hal/halx86/up/pic.S | 1 +
hal/halx86/up/pic.c | 17 +++++++++--------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/hal/halx86/up/pic.S b/hal/halx86/up/pic.S
index 170304788b..8211718585 100644
--- a/hal/halx86/up/pic.S
+++ b/hal/halx86/up/pic.S
@@ -50,5 +50,6 @@ ENDM
DEFINE_END_INTERRUPT_WRAPPER HalpEndSoftwareInterrupt, HalpEndSoftwareInterrupt2
+DEFINE_END_INTERRUPT_WRAPPER HalEndSystemInterrupt, HalEndSystemInterrupt2
END
diff --git a/hal/halx86/up/pic.c b/hal/halx86/up/pic.c
index f61bf738d0..2d1d6d10e3 100644
--- a/hal/halx86/up/pic.c
+++ b/hal/halx86/up/pic.c
@@ -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 ***************************************************/