From d4191c0d9439647be49d4010741dbfa6ddc915b4 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 4 Jan 2024 11:00:10 +0200 Subject: [PATCH] Kernel: Reorganize PS/2 files to their own directory --- kernel/CMakeLists.txt | 8 ++++---- kernel/include/kernel/Input/{PS2Config.h => PS2/Config.h} | 2 +- .../kernel/Input/{PS2Controller.h => PS2/Controller.h} | 0 kernel/include/kernel/Input/{PS2Device.h => PS2/Device.h} | 6 ++++-- .../kernel/Input/{PS2Keyboard.h => PS2/Keyboard.h} | 6 +++--- kernel/include/kernel/Input/{PS2Keymap.h => PS2/Keymap.h} | 2 +- .../Input/{PS2Controller.cpp => PS2/Controller.cpp} | 8 ++++---- kernel/kernel/Input/{PS2Device.cpp => PS2/Device.cpp} | 6 +++--- kernel/kernel/Input/{PS2Keyboard.cpp => PS2/Keyboard.cpp} | 6 +++--- kernel/kernel/Input/{PS2Keymap.cpp => PS2/Keymap.cpp} | 4 ++-- kernel/kernel/kernel.cpp | 2 +- 11 files changed, 26 insertions(+), 24 deletions(-) rename kernel/include/kernel/Input/{PS2Config.h => PS2/Config.h} (99%) rename kernel/include/kernel/Input/{PS2Controller.h => PS2/Controller.h} (100%) rename kernel/include/kernel/Input/{PS2Device.h => PS2/Device.h} (93%) rename kernel/include/kernel/Input/{PS2Keyboard.h => PS2/Keyboard.h} (92%) rename kernel/include/kernel/Input/{PS2Keymap.h => PS2/Keymap.h} (99%) rename kernel/kernel/Input/{PS2Controller.cpp => PS2/Controller.cpp} (98%) rename kernel/kernel/Input/{PS2Device.cpp => PS2/Device.cpp} (95%) rename kernel/kernel/Input/{PS2Keyboard.cpp => PS2/Keyboard.cpp} (98%) rename kernel/kernel/Input/{PS2Keymap.cpp => PS2/Keymap.cpp} (99%) diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index 8ab65a888a..9514c2285b 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -32,10 +32,10 @@ set(KERNEL_SOURCES kernel/FS/TmpFS/FileSystem.cpp kernel/FS/TmpFS/Inode.cpp kernel/FS/VirtualFileSystem.cpp - kernel/Input/PS2Controller.cpp - kernel/Input/PS2Device.cpp - kernel/Input/PS2Keyboard.cpp - kernel/Input/PS2Keymap.cpp + kernel/Input/PS2/Controller.cpp + kernel/Input/PS2/Device.cpp + kernel/Input/PS2/Keyboard.cpp + kernel/Input/PS2/Keymap.cpp kernel/InterruptController.cpp kernel/kernel.cpp kernel/Memory/DMARegion.cpp diff --git a/kernel/include/kernel/Input/PS2Config.h b/kernel/include/kernel/Input/PS2/Config.h similarity index 99% rename from kernel/include/kernel/Input/PS2Config.h rename to kernel/include/kernel/Input/PS2/Config.h index b7c708ec3a..6a23b101dd 100644 --- a/kernel/include/kernel/Input/PS2Config.h +++ b/kernel/include/kernel/Input/PS2/Config.h @@ -92,4 +92,4 @@ namespace Kernel::Input::PS2 CAPS_LOCK = (1 << 2), }; -} \ No newline at end of file +} diff --git a/kernel/include/kernel/Input/PS2Controller.h b/kernel/include/kernel/Input/PS2/Controller.h similarity index 100% rename from kernel/include/kernel/Input/PS2Controller.h rename to kernel/include/kernel/Input/PS2/Controller.h diff --git a/kernel/include/kernel/Input/PS2Device.h b/kernel/include/kernel/Input/PS2/Device.h similarity index 93% rename from kernel/include/kernel/Input/PS2Device.h rename to kernel/include/kernel/Input/PS2/Device.h index db1ecb8b6d..71051a6e8c 100644 --- a/kernel/include/kernel/Input/PS2Device.h +++ b/kernel/include/kernel/Input/PS2/Device.h @@ -1,4 +1,6 @@ -#include +#pragma once + +#include namespace Kernel::Input { @@ -40,4 +42,4 @@ namespace Kernel::Input BAN::CircularQueue m_command_queue; }; -} \ No newline at end of file +} diff --git a/kernel/include/kernel/Input/PS2Keyboard.h b/kernel/include/kernel/Input/PS2/Keyboard.h similarity index 92% rename from kernel/include/kernel/Input/PS2Keyboard.h rename to kernel/include/kernel/Input/PS2/Keyboard.h index 3ee2fa46fe..b6c49af441 100644 --- a/kernel/include/kernel/Input/PS2Keyboard.h +++ b/kernel/include/kernel/Input/PS2/Keyboard.h @@ -1,8 +1,8 @@ #pragma once #include -#include -#include +#include +#include #include namespace Kernel::Input @@ -46,4 +46,4 @@ namespace Kernel::Input virtual bool has_data_impl() const override; }; -} \ No newline at end of file +} diff --git a/kernel/include/kernel/Input/PS2Keymap.h b/kernel/include/kernel/Input/PS2/Keymap.h similarity index 99% rename from kernel/include/kernel/Input/PS2Keymap.h rename to kernel/include/kernel/Input/PS2/Keymap.h index aab0c86fbf..b70c5321f2 100644 --- a/kernel/include/kernel/Input/PS2Keymap.h +++ b/kernel/include/kernel/Input/PS2/Keymap.h @@ -20,4 +20,4 @@ namespace Kernel::Input BAN::Vector m_extended_keymap; }; -} \ No newline at end of file +} diff --git a/kernel/kernel/Input/PS2Controller.cpp b/kernel/kernel/Input/PS2/Controller.cpp similarity index 98% rename from kernel/kernel/Input/PS2Controller.cpp rename to kernel/kernel/Input/PS2/Controller.cpp index 626adc3484..e533850f01 100644 --- a/kernel/kernel/Input/PS2Controller.cpp +++ b/kernel/kernel/Input/PS2/Controller.cpp @@ -2,9 +2,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -248,4 +248,4 @@ namespace Kernel::Input return {}; } -} \ No newline at end of file +} diff --git a/kernel/kernel/Input/PS2Device.cpp b/kernel/kernel/Input/PS2/Device.cpp similarity index 95% rename from kernel/kernel/Input/PS2Device.cpp rename to kernel/kernel/Input/PS2/Device.cpp index 9534c58fee..5682ba28c9 100644 --- a/kernel/kernel/Input/PS2Device.cpp +++ b/kernel/kernel/Input/PS2/Device.cpp @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #include #include @@ -85,4 +85,4 @@ namespace Kernel::Input m_controller.send_byte(this, m_command_queue.front()); } -} \ No newline at end of file +} diff --git a/kernel/kernel/Input/PS2Keyboard.cpp b/kernel/kernel/Input/PS2/Keyboard.cpp similarity index 98% rename from kernel/kernel/Input/PS2Keyboard.cpp rename to kernel/kernel/Input/PS2/Keyboard.cpp index 311fbcd473..bb2948ec62 100644 --- a/kernel/kernel/Input/PS2Keyboard.cpp +++ b/kernel/kernel/Input/PS2/Keyboard.cpp @@ -1,8 +1,8 @@ #include #include #include -#include -#include +#include +#include #define SET_MASK(byte, mask, on_off) ((on_off) ? ((byte) | (mask)) : ((byte) & ~(mask))) #define TOGGLE_MASK(byte, mask) ((byte) ^ (mask)) @@ -177,4 +177,4 @@ namespace Kernel::Input return !m_event_queue.empty(); } -} \ No newline at end of file +} diff --git a/kernel/kernel/Input/PS2Keymap.cpp b/kernel/kernel/Input/PS2/Keymap.cpp similarity index 99% rename from kernel/kernel/Input/PS2Keymap.cpp rename to kernel/kernel/Input/PS2/Keymap.cpp index 015f07fe57..0f512b8fb7 100644 --- a/kernel/kernel/Input/PS2Keymap.cpp +++ b/kernel/kernel/Input/PS2/Keymap.cpp @@ -1,4 +1,4 @@ -#include +#include namespace Kernel::Input { @@ -357,4 +357,4 @@ namespace Kernel::Input return key; } -} \ No newline at end of file +} diff --git a/kernel/kernel/kernel.cpp b/kernel/kernel/kernel.cpp index 1990356078..2e88d14d60 100644 --- a/kernel/kernel/kernel.cpp +++ b/kernel/kernel/kernel.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include