1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

Kernel: Switch singletons to use new Singleton class

Fixes #3226
This commit is contained in:
Tom 2020-08-20 09:36:06 -06:00 committed by Andreas Kling
parent 527c8047fe
commit f48feae0b2
44 changed files with 184 additions and 146 deletions

View file

@ -34,6 +34,7 @@
#include <Kernel/IO.h>
#include <Kernel/Interrupts/APIC.h>
#include <Kernel/Interrupts/SpuriousInterruptHandler.h>
#include <Kernel/Singleton.h>
#include <Kernel/Thread.h>
#include <Kernel/VM/MemoryManager.h>
#include <Kernel/VM/PageDirectory.h>
@ -68,7 +69,7 @@
namespace Kernel {
static APIC* s_apic;
static auto s_apic = make_singleton<APIC>();
class APICIPIInterruptHandler final : public GenericInterruptHandler {
public:
@ -132,7 +133,7 @@ private:
bool APIC::initialized()
{
return (s_apic != nullptr);
return s_apic.is_initialized();
}
APIC& APIC::the()
@ -144,7 +145,7 @@ APIC& APIC::the()
void APIC::initialize()
{
ASSERT(!APIC::initialized());
s_apic = new APIC();
s_apic.ensure_instance();
}
PhysicalAddress APIC::get_base()