summaryrefslogtreecommitdiff
path: root/Kernel/Devices/BXVGADevice.cpp
diff options
context:
space:
mode:
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..c9f1732260 100644
--- a/Kernel/Devices/BXVGADevice.cpp
+++ b/Kernel/Devices/BXVGADevice.cpp
@@ -25,6 +25,7 @@
*/
#include <AK/Checked.h>
+#include <AK/Singleton.h>
#include <Kernel/Devices/BXVGADevice.h>
#include <Kernel/IO.h>
#include <Kernel/PCI/Access.h>
@@ -56,7 +57,12 @@ namespace Kernel {
#define VBE_DISPI_ENABLED 0x01
#define VBE_DISPI_LFB_ENABLED 0x40
-static BXVGADevice* s_the;
+static AK::Singleton<BXVGADevice> s_the;
+
+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();
}