diff options
Diffstat (limited to 'Kernel/Time')
-rw-r--r-- | Kernel/Time/HPETComparator.cpp | 5 | ||||
-rw-r--r-- | Kernel/Time/HPETComparator.h | 2 | ||||
-rw-r--r-- | Kernel/Time/HardwareTimer.h | 16 | ||||
-rw-r--r-- | Kernel/Time/RTC.cpp | 5 | ||||
-rw-r--r-- | Kernel/Time/RTC.h | 2 |
5 files changed, 20 insertions, 10 deletions
diff --git a/Kernel/Time/HPETComparator.cpp b/Kernel/Time/HPETComparator.cpp index 8292719c31..6f2aab6c17 100644 --- a/Kernel/Time/HPETComparator.cpp +++ b/Kernel/Time/HPETComparator.cpp @@ -51,11 +51,12 @@ void HPETComparator::set_non_periodic() HPET::the().disable_periodic_interrupt(*this); } -void HPETComparator::handle_irq(const RegisterState& regs) +bool HPETComparator::handle_irq(const RegisterState& regs) { - HardwareTimer::handle_irq(regs); + auto result = HardwareTimer::handle_irq(regs); if (!is_periodic()) set_new_countdown(); + return result; } void HPETComparator::set_new_countdown() diff --git a/Kernel/Time/HPETComparator.h b/Kernel/Time/HPETComparator.h index 5fa0d0cdd1..9d2bd5e141 100644 --- a/Kernel/Time/HPETComparator.h +++ b/Kernel/Time/HPETComparator.h @@ -43,7 +43,7 @@ public: private: void set_new_countdown(); - virtual void handle_irq(const RegisterState&) override; + virtual bool handle_irq(const RegisterState&) override; HPETComparator(u8 number, u8 irq, bool periodic_capable, bool is_64bit_capable); bool m_periodic : 1; bool m_periodic_capable : 1; diff --git a/Kernel/Time/HardwareTimer.h b/Kernel/Time/HardwareTimer.h index b442d377f8..ce555075e3 100644 --- a/Kernel/Time/HardwareTimer.h +++ b/Kernel/Time/HardwareTimer.h @@ -92,10 +92,14 @@ protected: { } - virtual void handle_irq(const RegisterState& regs) override + virtual bool handle_irq(const RegisterState& regs) override { - if (m_callback) + // Note: if we have an IRQ on this line, it's going to be the timer always + if (m_callback) { m_callback(regs); + return true; + } + return false; } u64 m_frequency { OPTIMAL_TICKS_PER_SECOND_RATE }; @@ -142,10 +146,14 @@ protected: { } - virtual void handle_interrupt(const RegisterState& regs) override + virtual bool handle_interrupt(const RegisterState& regs) override { - if (m_callback) + // Note: if we have an IRQ on this line, it's going to be the timer always + if (m_callback) { m_callback(regs); + return true; + } + return false; } u64 m_frequency { OPTIMAL_TICKS_PER_SECOND_RATE }; diff --git a/Kernel/Time/RTC.cpp b/Kernel/Time/RTC.cpp index 31c1f09e02..d2052b501d 100644 --- a/Kernel/Time/RTC.cpp +++ b/Kernel/Time/RTC.cpp @@ -27,10 +27,11 @@ RealTimeClock::RealTimeClock(Function<void(const RegisterState&)> callback) CMOS::write(0x8B, CMOS::read(0xB) | 0x40); reset_to_default_ticks_per_second(); } -void RealTimeClock::handle_irq(const RegisterState& regs) +bool RealTimeClock::handle_irq(const RegisterState& regs) { - HardwareTimer::handle_irq(regs); + auto result = HardwareTimer::handle_irq(regs); CMOS::read(0x8C); + return result; } size_t RealTimeClock::ticks_per_second() const diff --git a/Kernel/Time/RTC.h b/Kernel/Time/RTC.h index 1005ae7109..748f8e28a1 100644 --- a/Kernel/Time/RTC.h +++ b/Kernel/Time/RTC.h @@ -31,6 +31,6 @@ public: private: explicit RealTimeClock(Function<void(const RegisterState&)> callback); - virtual void handle_irq(const RegisterState&) override; + virtual bool handle_irq(const RegisterState&) override; }; } |