1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 17:47:43 +00:00

Kernel: Rename HardwareTimer::m_function_to_call => m_callback

This commit is contained in:
Andreas Kling 2020-04-16 18:18:43 +02:00
parent 1e89f7d64e
commit 4b1f056e3a
2 changed files with 10 additions and 5 deletions

View file

@ -31,23 +31,26 @@ namespace Kernel {
HardwareTimer::HardwareTimer(u8 irq_number, Function<void(const RegisterState&)> callback)
: IRQHandler(irq_number)
, m_function_to_call(move(callback))
, m_callback(move(callback))
{
}
void HardwareTimer::handle_irq(const RegisterState& regs)
{
m_function_to_call(regs);
m_callback(regs);
}
const char* HardwareTimer::purpose() const
{
if (TimeManagement::the().is_system_timer(*this))
return "System Timer";
return model();
}
void HardwareTimer::change_function(Function<void(const RegisterState&)> callback)
{
disable_irq();
m_function_to_call = move(callback);
m_callback = move(callback);
enable_irq();
}

View file

@ -40,7 +40,8 @@ enum class HardwareTimerType {
HighPrecisionEventTimer = 0x3 /* also known as IA-PC HPET */
};
class HardwareTimer : public RefCounted<HardwareTimer>
class HardwareTimer
: public RefCounted<HardwareTimer>
, public IRQHandler {
public:
virtual HardwareTimerType timer_type() const = 0;
@ -67,6 +68,7 @@ protected:
u64 m_frequency { OPTIMAL_TICKS_PER_SECOND_RATE };
private:
Function<void(const RegisterState&)> m_function_to_call;
Function<void(const RegisterState&)> m_callback;
};
}