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

Revert "Kernel: Switch singletons to use new Singleton class"

This reverts commit f48feae0b2.
This commit is contained in:
Andreas Kling 2020-08-22 17:53:34 +02:00
parent 0addcb45b8
commit 2fd9e72264
44 changed files with 146 additions and 184 deletions

View file

@ -31,7 +31,6 @@
#include <Kernel/Arch/i386/CPU.h>
#include <Kernel/Devices/KeyboardDevice.h>
#include <Kernel/IO.h>
#include <Kernel/Singleton.h>
#include <Kernel/TTY/VirtualConsole.h>
//#define KEYBOARD_DEBUG
@ -336,15 +335,11 @@ void KeyboardDevice::handle_irq(const RegisterState&)
}
}
static auto s_the = make_singleton<KeyboardDevice>();
void KeyboardDevice::initialize()
{
s_the.ensure_instance();
}
static KeyboardDevice* s_the;
KeyboardDevice& KeyboardDevice::the()
{
ASSERT(s_the);
return *s_the;
}
@ -352,6 +347,8 @@ KeyboardDevice::KeyboardDevice()
: IRQHandler(IRQ_KEYBOARD)
, CharacterDevice(85, 1)
{
s_the = this;
// Empty the buffer of any pending data.
// I don't care what you've been pressing until now!
while (IO::in8(I8042_STATUS) & I8042_BUFFER_FULL)