[NTOS][HAL:APIC] Call HalBegin/EndSystemInterrupt from clock handler

This commit is contained in:
Timo Kreuzer
2024-12-05 16:53:26 +02:00
parent 272336a6e6
commit 54e8ec2ffd
5 changed files with 13 additions and 3 deletions

View File

@@ -743,7 +743,6 @@ HalDisableSystemInterrupt(
IOApicWrite(IOAPIC_REDTBL + 2 * Index, ReDirReg.Long0);
}
#ifndef _M_AMD64
BOOLEAN
NTAPI
HalBeginSystemInterrupt(
@@ -826,6 +825,7 @@ HalEndSystemInterrupt(
/* IRQL MANAGEMENT ************************************************************/
#ifndef _M_AMD64
KIRQL
NTAPI
KeGetCurrentIrql(VOID)

View File

@@ -191,6 +191,9 @@ HalpClockInterruptHandler(IN PKTRAP_FRAME TrapFrame)
/* Update the system time -- on x86 the kernel will exit this trap */
KeUpdateSystemTime(TrapFrame, LastIncrement, Irql);
/* End the interrupt */
KiEndInterrupt(Irql, TrapFrame);
}
VOID

View File

@@ -586,7 +586,6 @@ HalInitializeBios(
#ifdef _M_AMD64
#define KfLowerIrql KeLowerIrql
#define KiEnterInterruptTrap(TrapFrame) /* We do all neccessary in asm code */
#define HalBeginSystemInterrupt(Irql, Vector, OldIrql) ((*(OldIrql) = PASSIVE_LEVEL), TRUE)
#endif // _M_AMD64
extern BOOLEAN HalpNMIInProgress;

View File

@@ -356,7 +356,10 @@ KiEndInterrupt(IN KIRQL Irql,
{
/* Make sure this is from the clock handler */
ASSERT(TrapFrame->ErrorCode == 0xc10c4);
//KeLowerIrql(Irql);
/* Disable interrupts and end the interrupt */
_disable();
HalEndSystemInterrupt(Irql, TrapFrame);
}
FORCEINLINE

View File

@@ -77,7 +77,10 @@ KeUpdateSystemTime(IN PKTRAP_FRAME TrapFrame,
/* Increase interrupt count and end the interrupt */
Prcb->InterruptCount++;
#ifdef _M_IX86 // x86 optimization
KiEndInterrupt(Irql, TrapFrame);
#endif
/* Note: non-x86 return back to the caller! */
return;
@@ -131,8 +134,10 @@ KeUpdateSystemTime(IN PKTRAP_FRAME TrapFrame,
Prcb->InterruptCount++;
}
#ifdef _M_IX86 // x86 optimization
/* Disable interrupts and end the interrupt */
KiEndInterrupt(Irql, TrapFrame);
#endif
}
VOID