summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-16 18:18:43 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-16 18:49:20 +0200
commit4b1f056e3a7ca0d3d9b693b5be9ec9ce0ac7c60e (patch)
treef2e4450138f3e54920d0b309d3439b0e2ab906a1 /Kernel
parent1e89f7d64efda1740b16537ebdbcc0be0aaf2d7e (diff)
downloadserenity-4b1f056e3a7ca0d3d9b693b5be9ec9ce0ac7c60e.zip
Kernel: Rename HardwareTimer::m_function_to_call => m_callback
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Time/HardwareTimer.cpp9
-rw-r--r--Kernel/Time/HardwareTimer.h6
2 files changed, 10 insertions, 5 deletions
diff --git a/Kernel/Time/HardwareTimer.cpp b/Kernel/Time/HardwareTimer.cpp
index 654f4bcf06..382bed2cdb 100644
--- a/Kernel/Time/HardwareTimer.cpp
+++ b/Kernel/Time/HardwareTimer.cpp
@@ -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();
}
diff --git a/Kernel/Time/HardwareTimer.h b/Kernel/Time/HardwareTimer.h
index 3d8493afb6..a7cef603ee 100644
--- a/Kernel/Time/HardwareTimer.h
+++ b/Kernel/Time/HardwareTimer.h
@@ -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;
};
+
}