summaryrefslogtreecommitdiff
path: root/Kernel/Devices/BXVGADevice.cpp
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2020-08-20 09:36:06 -0600
committerAndreas Kling <kling@serenityos.org>2020-08-21 11:47:35 +0200
commitf48feae0b2a300992479abf0b2ded85e45ac6045 (patch)
treed0b01169a60261135ee15a8d4a6abd01785a7bec /Kernel/Devices/BXVGADevice.cpp
parent527c8047fe0a08ade2e17fd096ad9b4ebc103ec5 (diff)
downloadserenity-f48feae0b2a300992479abf0b2ded85e45ac6045.zip
Kernel: Switch singletons to use new Singleton class
Fixes #3226
Diffstat (limited to 'Kernel/Devices/BXVGADevice.cpp')
-rw-r--r--Kernel/Devices/BXVGADevice.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/Kernel/Devices/BXVGADevice.cpp b/Kernel/Devices/BXVGADevice.cpp
index 1e3a4b5168..c31e6ec1f1 100644
--- a/Kernel/Devices/BXVGADevice.cpp
+++ b/Kernel/Devices/BXVGADevice.cpp
@@ -29,6 +29,7 @@
#include <Kernel/IO.h>
#include <Kernel/PCI/Access.h>
#include <Kernel/Process.h>
+#include <Kernel/Singleton.h>
#include <Kernel/VM/AnonymousVMObject.h>
#include <Kernel/VM/MemoryManager.h>
#include <LibC/errno_numbers.h>
@@ -56,7 +57,12 @@ namespace Kernel {
#define VBE_DISPI_ENABLED 0x01
#define VBE_DISPI_LFB_ENABLED 0x40
-static BXVGADevice* s_the;
+static auto s_the = make_singleton<BXVGADevice>();
+
+void BXVGADevice::initialize()
+{
+ s_the.ensure_instance();
+}
BXVGADevice& BXVGADevice::the()
{
@@ -67,7 +73,6 @@ BXVGADevice::BXVGADevice()
: BlockDevice(29, 0)
{
- s_the = this;
m_framebuffer_address = PhysicalAddress(find_framebuffer_address());
set_safe_resolution();
}