Implement per-processor local clock initialization
All checks were successful
Builds / ExectOS (amd64, debug) (push) Successful in 37s
Builds / ExectOS (i686, debug) (push) Successful in 33s
Builds / ExectOS (i686, release) (push) Successful in 39s
Builds / ExectOS (amd64, release) (push) Successful in 43s

This commit is contained in:
2026-05-19 09:45:17 +02:00
parent 19092eda2e
commit 6e4f0ba6e4
2 changed files with 32 additions and 0 deletions

View File

@@ -447,6 +447,37 @@ HL::Timer::InitializeHpetTimer(VOID)
return STATUS_SUCCESS;
}
/**
* Initializes the local hardware clock for the executing processor and registers
* the necessary clock interrupt handlers.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTAPI
VOID
HL::Timer::InitializeLocalClock(VOID)
{
XTSTATUS Status;
/* Check if LAPIC timer was selected as the system clock */
if(ClockType == TimerLapic && TimerRoutines.InitializeClock != NULLPTR)
{
/* Proceed with system clock initialization */
Status = TimerRoutines.InitializeClock();
if(Status != STATUS_SUCCESS)
{
/* CPU cannot operate without a functional system clock interrupt */
KE::Crash::Panic(0);
}
}
/* Register the system clock interrupt handler */
HL::Irq::RegisterSystemInterruptHandler(APIC_VECTOR_CLOCK, HL::Timer::HandleClockInterrupt);
HL::Irq::RegisterSystemInterruptHandler(APIC_VECTOR_CLOCK_IPI, HL::Timer::HandleClockIpiInterrupt);
}
/**
* Initializes the legacy Programmable Interval Timer (PIT).
*

View File

@@ -38,6 +38,7 @@ namespace HL
STATIC TIMER_TYPE TimerType;
public:
STATIC XTAPI VOID InitializeLocalClock(VOID);
STATIC XTAPI VOID InitializeTimer(VOID);
STATIC XTAPI LARGE_INTEGER QueryPerformanceCounter(OUT PLARGE_INTEGER PerformanceFrequency);
STATIC XTAPI ULONG SetClockRate(IN ULONG Rate);