浏览代码

Kernel: Only use the TSC when it is invariant

Markus Pfeifenberger 2 年之前
父节点
当前提交
0cfcac7900
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      Kernel/Scheduler.cpp

+ 1 - 2
Kernel/Scheduler.cpp

@@ -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?