From b55199c227756c884b9b4ee632c8575bc9dcd35f Mon Sep 17 00:00:00 2001 From: Liav A Date: Sat, 8 Jul 2023 14:18:32 +0300 Subject: [PATCH] Kernel: Move TTY-related code to a new subdirectory under Devices The TTY subsystem is represented with unix devices, so it should be under the Devices directory like the Audio, Storage, GPU and HID subsystems. --- Kernel/Arch/init.cpp | 6 +++--- Kernel/CMakeLists.txt | 12 ++++++------ .../GPU/Console/ContiguousFramebufferConsole.cpp | 2 +- .../GPU/Console/GenericFramebufferConsole.cpp | 2 +- Kernel/Devices/GPU/VirtIO/Console.cpp | 2 +- Kernel/Devices/Generic/SelfTTYDevice.cpp | 2 +- Kernel/Devices/HID/KeyboardDevice.cpp | 4 ++-- Kernel/Devices/HID/PS2/KeyboardDevice.cpp | 2 +- Kernel/{ => Devices}/TTY/ConsoleManagement.cpp | 2 +- Kernel/{ => Devices}/TTY/ConsoleManagement.h | 2 +- Kernel/{ => Devices}/TTY/MasterPTY.cpp | 6 +++--- Kernel/{ => Devices}/TTY/MasterPTY.h | 0 Kernel/{ => Devices}/TTY/PTYMultiplexer.cpp | 4 ++-- Kernel/{ => Devices}/TTY/PTYMultiplexer.h | 0 Kernel/{ => Devices}/TTY/SlavePTY.cpp | 4 ++-- Kernel/{ => Devices}/TTY/SlavePTY.h | 2 +- Kernel/{ => Devices}/TTY/TTY.cpp | 2 +- Kernel/{ => Devices}/TTY/TTY.h | 0 Kernel/{ => Devices}/TTY/VirtualConsole.cpp | 4 ++-- Kernel/{ => Devices}/TTY/VirtualConsole.h | 2 +- Kernel/FileSystem/DevPtsFS/FileSystem.cpp | 2 +- Kernel/FileSystem/DevPtsFS/Inode.h | 2 +- Kernel/FileSystem/OpenFileDescription.cpp | 4 ++-- Kernel/FileSystem/ProcFS/ProcessExposed.cpp | 2 +- .../FileSystem/SysFS/Subsystems/Kernel/Processes.cpp | 2 +- Kernel/Syscalls/fork.cpp | 2 +- Kernel/Syscalls/setpgid.cpp | 2 +- Kernel/Tasks/PowerStateSwitchTask.cpp | 2 +- Kernel/Tasks/Process.cpp | 2 +- Kernel/kprintf.cpp | 2 +- Userland/Libraries/LibVT/Terminal.cpp | 2 +- 31 files changed, 42 insertions(+), 42 deletions(-) rename Kernel/{ => Devices}/TTY/ConsoleManagement.cpp (98%) rename Kernel/{ => Devices}/TTY/ConsoleManagement.h (95%) rename Kernel/{ => Devices}/TTY/MasterPTY.cpp (96%) rename Kernel/{ => Devices}/TTY/MasterPTY.h (100%) rename Kernel/{ => Devices}/TTY/PTYMultiplexer.cpp (95%) rename Kernel/{ => Devices}/TTY/PTYMultiplexer.h (100%) rename Kernel/{ => Devices}/TTY/SlavePTY.cpp (97%) rename Kernel/{ => Devices}/TTY/SlavePTY.h (98%) rename Kernel/{ => Devices}/TTY/TTY.cpp (99%) rename Kernel/{ => Devices}/TTY/TTY.h (100%) rename Kernel/{ => Devices}/TTY/VirtualConsole.cpp (99%) rename Kernel/{ => Devices}/TTY/VirtualConsole.h (99%) diff --git a/Kernel/Arch/init.cpp b/Kernel/Arch/init.cpp index 91ff95862d7..3930da74f9b 100644 --- a/Kernel/Arch/init.cpp +++ b/Kernel/Arch/init.cpp @@ -31,6 +31,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -45,9 +48,6 @@ #include #include #include -#include -#include -#include #include #include #include diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index 5dce82bcd0a..c773efae2a1 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -340,12 +340,12 @@ set(KERNEL_SOURCES Syscalls/waitid.cpp Syscalls/inode_watcher.cpp Syscalls/write.cpp - TTY/ConsoleManagement.cpp - TTY/MasterPTY.cpp - TTY/PTYMultiplexer.cpp - TTY/SlavePTY.cpp - TTY/TTY.cpp - TTY/VirtualConsole.cpp + Devices/TTY/ConsoleManagement.cpp + Devices/TTY/MasterPTY.cpp + Devices/TTY/PTYMultiplexer.cpp + Devices/TTY/SlavePTY.cpp + Devices/TTY/TTY.cpp + Devices/TTY/VirtualConsole.cpp Tasks/Coredump.cpp Tasks/CrashHandler.cpp Tasks/FinalizerTask.cpp diff --git a/Kernel/Devices/GPU/Console/ContiguousFramebufferConsole.cpp b/Kernel/Devices/GPU/Console/ContiguousFramebufferConsole.cpp index 9c770339e40..093ba5b4887 100644 --- a/Kernel/Devices/GPU/Console/ContiguousFramebufferConsole.cpp +++ b/Kernel/Devices/GPU/Console/ContiguousFramebufferConsole.cpp @@ -5,7 +5,7 @@ */ #include -#include +#include namespace Kernel::Graphics { diff --git a/Kernel/Devices/GPU/Console/GenericFramebufferConsole.cpp b/Kernel/Devices/GPU/Console/GenericFramebufferConsole.cpp index afe3efd24d4..ebc10e2ddc5 100644 --- a/Kernel/Devices/GPU/Console/GenericFramebufferConsole.cpp +++ b/Kernel/Devices/GPU/Console/GenericFramebufferConsole.cpp @@ -6,7 +6,7 @@ */ #include -#include +#include namespace Kernel::Graphics { diff --git a/Kernel/Devices/GPU/VirtIO/Console.cpp b/Kernel/Devices/GPU/VirtIO/Console.cpp index 729b4d6d567..638054a1e41 100644 --- a/Kernel/Devices/GPU/VirtIO/Console.cpp +++ b/Kernel/Devices/GPU/VirtIO/Console.cpp @@ -5,7 +5,7 @@ */ #include -#include +#include #include namespace Kernel::Graphics::VirtIOGPU { diff --git a/Kernel/Devices/Generic/SelfTTYDevice.cpp b/Kernel/Devices/Generic/SelfTTYDevice.cpp index 6bf7794aab8..d4fd310341f 100644 --- a/Kernel/Devices/Generic/SelfTTYDevice.cpp +++ b/Kernel/Devices/Generic/SelfTTYDevice.cpp @@ -6,8 +6,8 @@ #include #include +#include #include -#include namespace Kernel { diff --git a/Kernel/Devices/HID/KeyboardDevice.cpp b/Kernel/Devices/HID/KeyboardDevice.cpp index 680cc7cbc49..9c893ac9a62 100644 --- a/Kernel/Devices/HID/KeyboardDevice.cpp +++ b/Kernel/Devices/HID/KeyboardDevice.cpp @@ -12,9 +12,9 @@ #include #include #include +#include +#include #include -#include -#include #include #include diff --git a/Kernel/Devices/HID/PS2/KeyboardDevice.cpp b/Kernel/Devices/HID/PS2/KeyboardDevice.cpp index b62e612071f..45e5a535fd4 100644 --- a/Kernel/Devices/HID/PS2/KeyboardDevice.cpp +++ b/Kernel/Devices/HID/PS2/KeyboardDevice.cpp @@ -12,8 +12,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/Kernel/TTY/ConsoleManagement.cpp b/Kernel/Devices/TTY/ConsoleManagement.cpp similarity index 98% rename from Kernel/TTY/ConsoleManagement.cpp rename to Kernel/Devices/TTY/ConsoleManagement.cpp index c5c0cdee1c7..96d997805f1 100644 --- a/Kernel/TTY/ConsoleManagement.cpp +++ b/Kernel/Devices/TTY/ConsoleManagement.cpp @@ -9,9 +9,9 @@ #include #include #include +#include #include #include -#include namespace Kernel { diff --git a/Kernel/TTY/ConsoleManagement.h b/Kernel/Devices/TTY/ConsoleManagement.h similarity index 95% rename from Kernel/TTY/ConsoleManagement.h rename to Kernel/Devices/TTY/ConsoleManagement.h index ff8122f7773..3ce50a1e69b 100644 --- a/Kernel/TTY/ConsoleManagement.h +++ b/Kernel/Devices/TTY/ConsoleManagement.h @@ -7,8 +7,8 @@ #pragma once #include +#include #include -#include namespace Kernel { diff --git a/Kernel/TTY/MasterPTY.cpp b/Kernel/Devices/TTY/MasterPTY.cpp similarity index 96% rename from Kernel/TTY/MasterPTY.cpp rename to Kernel/Devices/TTY/MasterPTY.cpp index b900e8b6764..eda6d5f27f7 100644 --- a/Kernel/TTY/MasterPTY.cpp +++ b/Kernel/Devices/TTY/MasterPTY.cpp @@ -8,10 +8,10 @@ #include #include #include +#include +#include +#include #include -#include -#include -#include #include namespace Kernel { diff --git a/Kernel/TTY/MasterPTY.h b/Kernel/Devices/TTY/MasterPTY.h similarity index 100% rename from Kernel/TTY/MasterPTY.h rename to Kernel/Devices/TTY/MasterPTY.h diff --git a/Kernel/TTY/PTYMultiplexer.cpp b/Kernel/Devices/TTY/PTYMultiplexer.cpp similarity index 95% rename from Kernel/TTY/PTYMultiplexer.cpp rename to Kernel/Devices/TTY/PTYMultiplexer.cpp index 541e5e9a8e1..6aa2fad22cf 100644 --- a/Kernel/TTY/PTYMultiplexer.cpp +++ b/Kernel/Devices/TTY/PTYMultiplexer.cpp @@ -7,10 +7,10 @@ #include #include #include +#include +#include #include #include -#include -#include namespace Kernel { diff --git a/Kernel/TTY/PTYMultiplexer.h b/Kernel/Devices/TTY/PTYMultiplexer.h similarity index 100% rename from Kernel/TTY/PTYMultiplexer.h rename to Kernel/Devices/TTY/PTYMultiplexer.h diff --git a/Kernel/TTY/SlavePTY.cpp b/Kernel/Devices/TTY/SlavePTY.cpp similarity index 97% rename from Kernel/TTY/SlavePTY.cpp rename to Kernel/Devices/TTY/SlavePTY.cpp index c185c0571cb..284fa42c3c4 100644 --- a/Kernel/TTY/SlavePTY.cpp +++ b/Kernel/Devices/TTY/SlavePTY.cpp @@ -6,8 +6,8 @@ #include #include -#include -#include +#include +#include #include namespace Kernel { diff --git a/Kernel/TTY/SlavePTY.h b/Kernel/Devices/TTY/SlavePTY.h similarity index 98% rename from Kernel/TTY/SlavePTY.h rename to Kernel/Devices/TTY/SlavePTY.h index 7a7e0e6a33c..092b8d9649b 100644 --- a/Kernel/TTY/SlavePTY.h +++ b/Kernel/Devices/TTY/SlavePTY.h @@ -6,8 +6,8 @@ #pragma once +#include #include -#include namespace Kernel { diff --git a/Kernel/TTY/TTY.cpp b/Kernel/Devices/TTY/TTY.cpp similarity index 99% rename from Kernel/TTY/TTY.cpp rename to Kernel/Devices/TTY/TTY.cpp index 90db0b50c99..b0e1cf9dc59 100644 --- a/Kernel/TTY/TTY.cpp +++ b/Kernel/Devices/TTY/TTY.cpp @@ -13,8 +13,8 @@ #include #include #include +#include #include -#include #include namespace Kernel { diff --git a/Kernel/TTY/TTY.h b/Kernel/Devices/TTY/TTY.h similarity index 100% rename from Kernel/TTY/TTY.h rename to Kernel/Devices/TTY/TTY.h diff --git a/Kernel/TTY/VirtualConsole.cpp b/Kernel/Devices/TTY/VirtualConsole.cpp similarity index 99% rename from Kernel/TTY/VirtualConsole.cpp rename to Kernel/Devices/TTY/VirtualConsole.cpp index 5ff9aac7a53..98c6ebdb0cf 100644 --- a/Kernel/TTY/VirtualConsole.cpp +++ b/Kernel/Devices/TTY/VirtualConsole.cpp @@ -15,11 +15,11 @@ #include #include #include +#include +#include #include #include #include -#include -#include #include namespace Kernel { diff --git a/Kernel/TTY/VirtualConsole.h b/Kernel/Devices/TTY/VirtualConsole.h similarity index 99% rename from Kernel/TTY/VirtualConsole.h rename to Kernel/Devices/TTY/VirtualConsole.h index cfb1e4f2964..ee9856c136e 100644 --- a/Kernel/TTY/VirtualConsole.h +++ b/Kernel/Devices/TTY/VirtualConsole.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Kernel/FileSystem/DevPtsFS/FileSystem.cpp b/Kernel/FileSystem/DevPtsFS/FileSystem.cpp index e6a5cd6382e..2cffb27f6e5 100644 --- a/Kernel/FileSystem/DevPtsFS/FileSystem.cpp +++ b/Kernel/FileSystem/DevPtsFS/FileSystem.cpp @@ -6,9 +6,9 @@ */ #include +#include #include #include -#include #include namespace Kernel { diff --git a/Kernel/FileSystem/DevPtsFS/Inode.h b/Kernel/FileSystem/DevPtsFS/Inode.h index c1331857785..3a581a530c8 100644 --- a/Kernel/FileSystem/DevPtsFS/Inode.h +++ b/Kernel/FileSystem/DevPtsFS/Inode.h @@ -7,9 +7,9 @@ #pragma once #include +#include #include #include -#include namespace Kernel { diff --git a/Kernel/FileSystem/OpenFileDescription.cpp b/Kernel/FileSystem/OpenFileDescription.cpp index 169ba8e309c..603ab0fdad2 100644 --- a/Kernel/FileSystem/OpenFileDescription.cpp +++ b/Kernel/FileSystem/OpenFileDescription.cpp @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include #include #include @@ -17,8 +19,6 @@ #include #include #include -#include -#include #include #include diff --git a/Kernel/FileSystem/ProcFS/ProcessExposed.cpp b/Kernel/FileSystem/ProcFS/ProcessExposed.cpp index 27c17bd1663..99793c38f70 100644 --- a/Kernel/FileSystem/ProcFS/ProcessExposed.cpp +++ b/Kernel/FileSystem/ProcFS/ProcessExposed.cpp @@ -7,13 +7,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include namespace Kernel { diff --git a/Kernel/FileSystem/SysFS/Subsystems/Kernel/Processes.cpp b/Kernel/FileSystem/SysFS/Subsystems/Kernel/Processes.cpp index a9f33351b12..137dfeb7901 100644 --- a/Kernel/FileSystem/SysFS/Subsystems/Kernel/Processes.cpp +++ b/Kernel/FileSystem/SysFS/Subsystems/Kernel/Processes.cpp @@ -6,9 +6,9 @@ #include #include +#include #include #include -#include #include #include diff --git a/Kernel/Syscalls/fork.cpp b/Kernel/Syscalls/fork.cpp index 219c0726a7f..e598bbcfb78 100644 --- a/Kernel/Syscalls/fork.cpp +++ b/Kernel/Syscalls/fork.cpp @@ -6,9 +6,9 @@ */ #include +#include #include #include -#include #include #include #include diff --git a/Kernel/Syscalls/setpgid.cpp b/Kernel/Syscalls/setpgid.cpp index b65f384819f..0517d5d44b2 100644 --- a/Kernel/Syscalls/setpgid.cpp +++ b/Kernel/Syscalls/setpgid.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include #include namespace Kernel { diff --git a/Kernel/Tasks/PowerStateSwitchTask.cpp b/Kernel/Tasks/PowerStateSwitchTask.cpp index fff0ef43193..8fc66a72a56 100644 --- a/Kernel/Tasks/PowerStateSwitchTask.cpp +++ b/Kernel/Tasks/PowerStateSwitchTask.cpp @@ -13,12 +13,12 @@ #endif #include #include +#include #include #include #include #include #include -#include #include #include #include diff --git a/Kernel/Tasks/Process.cpp b/Kernel/Tasks/Process.cpp index 40a09015599..8c4ae838c2b 100644 --- a/Kernel/Tasks/Process.cpp +++ b/Kernel/Tasks/Process.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -32,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/Kernel/kprintf.cpp b/Kernel/kprintf.cpp index 57a5465472a..c9b0bb28ba6 100644 --- a/Kernel/kprintf.cpp +++ b/Kernel/kprintf.cpp @@ -16,8 +16,8 @@ #include #include #include +#include #include -#include #include namespace Kernel { diff --git a/Userland/Libraries/LibVT/Terminal.cpp b/Userland/Libraries/LibVT/Terminal.cpp index 3ea160f2665..eb241fdac89 100644 --- a/Userland/Libraries/LibVT/Terminal.cpp +++ b/Userland/Libraries/LibVT/Terminal.cpp @@ -13,7 +13,7 @@ #include #include #ifdef KERNEL -# include +# include #endif namespace VT {