1

Final pre-release

This commit is contained in:
2023-03-02 17:29:30 +01:00
parent 01b1be0629
commit 3f02dfd309
47 changed files with 4803 additions and 1836 deletions

View File

@ -1,4 +1,4 @@
// Excerpt from the APIC timer interrupt handler
// Excerpt from the ApicTimer interrupt handler
void ApicTimer::trigger(const InterruptFrame &frame) {
if (cpuId != LocalApic::getId()) {
// Abort if the handler doesn't belong to the current CPU
@ -7,4 +7,14 @@ void ApicTimer::trigger(const InterruptFrame &frame) {
// Increase the "core-local" time
time.addNanoseconds(timerInterval * 1'000'000); // Interval is in milliseconds
// Only the BSP may continue
if (cpuId != 0) {
return;
}
// Trigger preemption
if (time.toMilliseconds() % yieldInterval == 0) {
System::getService<SchedulerService>().yield();
}
}