diff options
author | Tom <tomut@yahoo.com> | 2021-05-11 21:20:06 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-12 21:44:16 +0200 |
commit | 3f9927b0c36d31270781ded6fccf97a7f1beb82e (patch) | |
tree | dc7a00c70e8a2f2805030daa3619ebb09d6b492d /Kernel/Time/HPET.h | |
parent | a6a57830d0efa8c4b4007c4975335366ecc10683 (diff) | |
download | serenity-3f9927b0c36d31270781ded6fccf97a7f1beb82e.zip |
Kernel: Fix issues supporting HPETs with 32-bit-only main counter
If the HPET main counter does not support full 64 bits, we should
not expect the upper 32 bit to work. This is a problem when writing
to the upper 32 bit of the comparator value, which requires the
TimerConfiguration::ValueSet bit to be set, but if it's not 64 bit
capable then the bit will not be cleared and leave it in a bad state.
Fixes #6990
Diffstat (limited to 'Kernel/Time/HPET.h')
-rw-r--r-- | Kernel/Time/HPET.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Kernel/Time/HPET.h b/Kernel/Time/HPET.h index 83b899b585..04e21714ce 100644 --- a/Kernel/Time/HPET.h +++ b/Kernel/Time/HPET.h @@ -56,6 +56,7 @@ private: void global_enable(); bool is_periodic_capable(u8 comparator_number) const; + bool is_64bit_capable(u8 comparator_number) const; void set_comparators_to_optimal_interrupt_state(size_t timers_count); u64 nanoseconds_to_raw_ticks() const; @@ -68,12 +69,13 @@ private: u64 m_main_counter_last_read { 0 }; u64 m_main_counter_drift { 0 }; + u32 m_32bit_main_counter_wraps { 0 }; u16 m_vendor_id; u16 m_minimum_tick; u64 m_frequency; u8 m_revision_id; - bool counter_is_64_bit_capable : 1; + bool m_main_counter_64bits : 1; bool legacy_replacement_route_capable : 1; NonnullRefPtrVector<HPETComparator> m_comparators; |