https://git.reactos.org/?p=reactos.git;a=commitdiff;h=888ace4397f8c4e1c5336b...
commit 888ace4397f8c4e1c5336b862b857f41dc857798 Author: Thomas Faber thomas.faber@reactos.org AuthorDate: Sun Feb 18 12:51:16 2018 +0100 Commit: Thomas Faber thomas.faber@reactos.org CommitDate: Sun Feb 18 13:06:44 2018 +0100
[HAL] Eliminate tail calls from HalpHardwareInterruptLevel. CORE-14076 --- hal/halx86/up/pic.S | 1 + hal/halx86/up/pic.c | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/hal/halx86/up/pic.S b/hal/halx86/up/pic.S index 1076bc5711..a5addcdf8c 100644 --- a/hal/halx86/up/pic.S +++ b/hal/halx86/up/pic.S @@ -75,5 +75,6 @@ DEFINE_END_INTERRUPT_WRAPPER HalpEndSoftwareInterrupt, HalpEndSoftwareInterrupt2 DEFINE_END_INTERRUPT_WRAPPER HalEndSystemInterrupt, HalEndSystemInterrupt2
DEFINE_INTERRUPT_WRAPPER HalpDispatchInterrupt, HalpDispatchInterrupt2 +DEFINE_INTERRUPT_WRAPPER HalpHardwareInterruptLevel, HalpHardwareInterruptLevel2
END diff --git a/hal/halx86/up/pic.c b/hal/halx86/up/pic.c index 6f68f1c5d0..d3e5529d7e 100644 --- a/hal/halx86/up/pic.c +++ b/hal/halx86/up/pic.c @@ -1015,9 +1015,9 @@ HalpDismissIrq07Level(IN KIRQL Irql, return _HalpDismissIrqLevel(Irql, Irq, OldIrql); }
-VOID +PHAL_SW_INTERRUPT_HANDLER __cdecl -HalpHardwareInterruptLevel(VOID) +HalpHardwareInterruptLevel2(VOID) { PKPCR Pcr = KeGetPcr(); ULONG PendingIrqlMask, PendingIrql; @@ -1027,7 +1027,7 @@ HalpHardwareInterruptLevel(VOID) if (PendingIrqlMask) { /* Check for in-service delayed interrupt */ - if (Pcr->IrrActive & 0xFFFFFFF0) return; + if (Pcr->IrrActive & 0xFFFFFFF0) return NULL;
/* Check if pending IRQL affects hardware state */ BitScanReverse(&PendingIrql, PendingIrqlMask); @@ -1036,8 +1036,10 @@ HalpHardwareInterruptLevel(VOID) Pcr->IRR ^= (1 << PendingIrql);
/* Now handle pending interrupt */ - SWInterruptHandlerTable[PendingIrql](); + return SWInterruptHandlerTable[PendingIrql]; } + + return NULL; }
/* SYSTEM INTERRUPTS **********************************************************/