Kernel: Replace CriticalScopes with SpinLock in PS/2 and input code

This commit is contained in:
2024-02-29 11:41:57 +02:00
parent ec0cb5fd54
commit 7f028f70d5
8 changed files with 58 additions and 53 deletions

View File

@@ -3,6 +3,7 @@
#include <BAN/Array.h>
#include <BAN/UniqPtr.h>
#include <kernel/Input/KeyEvent.h>
#include <kernel/Lock/SpinLock.h>
namespace Kernel::Input
{
@@ -23,6 +24,7 @@ namespace Kernel::Input
BAN::Array<Key, 0xFF> m_keycode_to_key_normal;
BAN::Array<Key, 0xFF> m_keycode_to_key_shift;
BAN::Array<Key, 0xFF> m_keycode_to_key_altgr;
SpinLock m_lock;
friend class BAN::UniqPtr<KeyboardLayout>;
};

View File

@@ -64,6 +64,7 @@ namespace Kernel::Input
BAN::CircularQueue<Command, 128> m_command_queue;
uint64_t m_command_send_time { 0 };
SpinLock m_command_lock;
};
}

View File

@@ -41,6 +41,7 @@ namespace Kernel::Input
uint16_t m_modifiers { 0 };
BAN::CircularQueue<KeyEvent, 50> m_event_queue;
SpinLock m_event_lock;
PS2Keymap m_keymap;

View File

@@ -37,6 +37,7 @@ namespace Kernel::Input
uint8_t m_button_mask { 0x00 };
BAN::CircularQueue<MouseEvent, 128> m_event_queue;
SpinLock m_event_lock;
Semaphore m_semaphore;