[HALX86] Implement the clock IPI handler

This commit is contained in:
Timo Kreuzer 2024-02-24 12:05:12 +02:00
parent d1c118b371
commit 79aaee6aac
8 changed files with 65 additions and 0 deletions

View file

@ -13,6 +13,7 @@
#include <hal.h>
#include "apicp.h"
#include <smp.h>
#define NDEBUG
#include <debug.h>
@ -182,10 +183,40 @@ HalpClockInterruptHandler(IN PKTRAP_FRAME TrapFrame)
HalpSetClockRate = FALSE;
}
/* Send the clock IPI to all other CPUs */
HalpBroadcastClockIpi(CLOCK_IPI_VECTOR);
/* Update the system time -- on x86 the kernel will exit this trap */
KeUpdateSystemTime(TrapFrame, LastIncrement, Irql);
}
VOID
FASTCALL
HalpClockIpiHandler(IN PKTRAP_FRAME TrapFrame)
{
KIRQL Irql;
/* Enter trap */
KiEnterInterruptTrap(TrapFrame);
#ifdef _M_AMD64
/* This is for debugging */
TrapFrame->ErrorCode = 0xc10c4;
#endif
/* Start the interrupt */
if (!HalBeginSystemInterrupt(CLOCK_LEVEL, CLOCK_IPI_VECTOR, &Irql))
{
/* Spurious, just end the interrupt */
KiEoiHelper(TrapFrame);
}
/* Call the kernel to update runtimes */
KeUpdateRunTime(TrapFrame, Irql);
/* End the interrupt */
KiEndInterrupt(Irql, TrapFrame);
}
ULONG
NTAPI
HalSetTimeIncrement(IN ULONG Increment)