1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-29 06:55:07 +00:00

Kernel: Only use the TSC when it is invariant

This commit is contained in:
Markus Pfeifenberger 2022-10-06 16:35:13 +02:00 committed by Andrew Kaster
parent cf48200e7b
commit 0cfcac7900

View file

@ -381,8 +381,7 @@ UNMAP_AFTER_INIT void Scheduler::initialize()
VERIFY(Processor::is_initialized()); // sanity check
// Figure out a good scheduling time source
if (Processor::current().has_feature(CPUFeature::TSC)) {
// TODO: only use if TSC is running at a constant frequency?
if (Processor::current().has_feature(CPUFeature::TSC) && Processor::current().has_feature(CPUFeature::CONSTANT_TSC)) {
current_time = current_time_tsc;
} else {
// TODO: Using HPET is rather slow, can we use any other time source that may be faster?