diff --git a/Kernel/Arch/aarch64/RPi/Timer.cpp b/Kernel/Arch/aarch64/RPi/Timer.cpp index 02b20b2b516..1b7ae0e5f01 100644 --- a/Kernel/Arch/aarch64/RPi/Timer.cpp +++ b/Kernel/Arch/aarch64/RPi/Timer.cpp @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -35,8 +36,8 @@ Timer::Timer() Timer& Timer::the() { - static Timer instance; - return instance; + static AK::NeverDestroyed instance; + return *instance; } u64 Timer::microseconds_since_boot() diff --git a/Kernel/Arch/aarch64/RPi/Timer.h b/Kernel/Arch/aarch64/RPi/Timer.h index 7bbaca322af..59216760cff 100644 --- a/Kernel/Arch/aarch64/RPi/Timer.h +++ b/Kernel/Arch/aarch64/RPi/Timer.h @@ -14,6 +14,7 @@ struct TimerRegisters; class Timer { public: + Timer(); static Timer& the(); u64 microseconds_since_boot(); @@ -38,8 +39,6 @@ public: static u32 set_clock_rate(ClockID, u32 rate_hz, bool skip_setting_turbo = true); private: - Timer(); - TimerRegisters volatile* m_registers; };