mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 17:17:42 +00:00
Kernel: Rename HardwareTimer::m_function_to_call => m_callback
This commit is contained in:
parent
1e89f7d64e
commit
4b1f056e3a
2 changed files with 10 additions and 5 deletions
|
@ -31,23 +31,26 @@ namespace Kernel {
|
||||||
|
|
||||||
HardwareTimer::HardwareTimer(u8 irq_number, Function<void(const RegisterState&)> callback)
|
HardwareTimer::HardwareTimer(u8 irq_number, Function<void(const RegisterState&)> callback)
|
||||||
: IRQHandler(irq_number)
|
: IRQHandler(irq_number)
|
||||||
, m_function_to_call(move(callback))
|
, m_callback(move(callback))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void HardwareTimer::handle_irq(const RegisterState& regs)
|
void HardwareTimer::handle_irq(const RegisterState& regs)
|
||||||
{
|
{
|
||||||
m_function_to_call(regs);
|
m_callback(regs);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* HardwareTimer::purpose() const
|
const char* HardwareTimer::purpose() const
|
||||||
{
|
{
|
||||||
if (TimeManagement::the().is_system_timer(*this))
|
if (TimeManagement::the().is_system_timer(*this))
|
||||||
return "System Timer";
|
return "System Timer";
|
||||||
return model();
|
return model();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HardwareTimer::change_function(Function<void(const RegisterState&)> callback)
|
void HardwareTimer::change_function(Function<void(const RegisterState&)> callback)
|
||||||
{
|
{
|
||||||
disable_irq();
|
disable_irq();
|
||||||
m_function_to_call = move(callback);
|
m_callback = move(callback);
|
||||||
enable_irq();
|
enable_irq();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,8 @@ enum class HardwareTimerType {
|
||||||
HighPrecisionEventTimer = 0x3 /* also known as IA-PC HPET */
|
HighPrecisionEventTimer = 0x3 /* also known as IA-PC HPET */
|
||||||
};
|
};
|
||||||
|
|
||||||
class HardwareTimer : public RefCounted<HardwareTimer>
|
class HardwareTimer
|
||||||
|
: public RefCounted<HardwareTimer>
|
||||||
, public IRQHandler {
|
, public IRQHandler {
|
||||||
public:
|
public:
|
||||||
virtual HardwareTimerType timer_type() const = 0;
|
virtual HardwareTimerType timer_type() const = 0;
|
||||||
|
@ -67,6 +68,7 @@ protected:
|
||||||
u64 m_frequency { OPTIMAL_TICKS_PER_SECOND_RATE };
|
u64 m_frequency { OPTIMAL_TICKS_PER_SECOND_RATE };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Function<void(const RegisterState&)> m_function_to_call;
|
Function<void(const RegisterState&)> m_callback;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue