Initial commit
This commit is contained in:
12
code/pit_after.cpp
Normal file
12
code/pit_after.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
void Pit::trigger(const InterruptFrame &frame) {
|
||||
time.addNanoseconds(timerInterval); // Increase system time
|
||||
|
||||
// Don't use PIT for scheduling when the APIC timer is enabled
|
||||
if (Apic::isEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (time.toMilliseconds() % yieldInterval == 0) {
|
||||
System::getService<SchedulerService>().yield(); // Trigger preemption
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user