From 8c764319adf36df22a5b39de1d271d6de81e6b8f Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 25 Oct 2020 20:10:02 -0600 Subject: [PATCH] Kernel: Various APIC timer fixes --- Kernel/Interrupts/APIC.cpp | 1 - Kernel/Time/APICTimer.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Kernel/Interrupts/APIC.cpp b/Kernel/Interrupts/APIC.cpp index 7cd96d14ad1..22709f29563 100644 --- a/Kernel/Interrupts/APIC.cpp +++ b/Kernel/Interrupts/APIC.cpp @@ -588,7 +588,6 @@ void APIC::setup_local_timer(u32 ticks, TimerMode timer_mode, bool enable) default: ASSERT_NOT_REACHED(); } - config |= 3; // divide by 16 write_register(APIC_REG_TIMER_CONFIGURATION, config); if (timer_mode == TimerMode::Periodic) diff --git a/Kernel/Time/APICTimer.cpp b/Kernel/Time/APICTimer.cpp index 2175f89a31d..84889497943 100644 --- a/Kernel/Time/APICTimer.cpp +++ b/Kernel/Time/APICTimer.cpp @@ -115,7 +115,7 @@ bool APICTimer::calibrate(HardwareTimerBase& calibration_source) auto delta_apic_count = end_apic_count - start_apic_count; m_timer_period = (delta_apic_count * apic.get_timer_divisor()) / ticks_in_100ms; - auto apic_freq = (delta_apic_count * 16) / apic.get_timer_divisor(); + auto apic_freq = (delta_apic_count * apic.get_timer_divisor()) / apic.get_timer_divisor(); if (apic_freq < 1000000) { klog() << "APICTimer: Frequency too slow!"; return false;