1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00:00

Kernel: Use AK::NeverDestroyed<Timer> to store the timer class

For an upcoming change to support interrupts in this driver, this class
has to inherit from IRQHandler. That in turn will make this class
virtual, which will then actually call the destructor of the class. We
don't want this to happen, thus we have to wrap the class in a
AK::NeverDestroyed.
This commit is contained in:
Timon Kruiper 2022-05-17 10:19:16 +02:00 committed by Linus Groh
parent a0b0c4e723
commit 8b77c61e7d
2 changed files with 4 additions and 4 deletions

View file

@ -5,6 +5,7 @@
*/
#include <AK/Format.h>
#include <AK/NeverDestroyed.h>
#include <Kernel/Arch/aarch64/RPi/MMIO.h>
#include <Kernel/Arch/aarch64/RPi/Mailbox.h>
#include <Kernel/Arch/aarch64/RPi/Timer.h>
@ -35,8 +36,8 @@ Timer::Timer()
Timer& Timer::the()
{
static Timer instance;
return instance;
static AK::NeverDestroyed<Timer> instance;
return *instance;
}
u64 Timer::microseconds_since_boot()