Skip to content

Commit d076b00

Browse files
tomutaawesomekling
authored andcommitted
Kernel: Fix APIC timer frequency
The APIC current count register decrements on each clock tick. Fixes the APIC timer firing much less frequently than it should be.
1 parent 3fa0b88 commit d076b00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Kernel/Time/APICTimer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ bool APICTimer::calibrate(HardwareTimerBase& calibration_source)
112112

113113
disable_local_timer();
114114

115-
auto delta_apic_count = end_apic_count - start_apic_count;
115+
auto delta_apic_count = start_apic_count - end_apic_count; // The APIC current count register decrements!
116116
m_timer_period = (delta_apic_count * apic.get_timer_divisor()) / ticks_in_100ms;
117117

118118
auto apic_freq = (delta_apic_count * apic.get_timer_divisor()) / apic.get_timer_divisor();

0 commit comments

Comments
 (0)