1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:18:12 +00:00

Kernel+Userland: Add constants subdirectory at /sys/kernel directory

This subdirectory is meant to hold all constant data related to the
kernel. This means that this data is never meant to updated and is
relevant from system boot to system shutdown.
Move the inodes of "load_base", "cmdline" and "system_mode" to that
directory. All nodes under this new subdirectory are generated during
boot, and therefore don't require calling kmalloc each time we need to
read them. Locking is also not necessary, because these nodes and their
data are completely static once being generated.
This commit is contained in:
Liav A 2023-02-18 18:52:44 +02:00 committed by Linus Groh
parent 52f156be01
commit 61f4914d6e
15 changed files with 200 additions and 199 deletions

View file

@ -72,7 +72,7 @@ static ErrorOr<void> determine_system_mode()
g_system_mode = "text";
});
auto f = Core::DeprecatedFile::construct("/sys/kernel/system_mode");
auto f = Core::DeprecatedFile::construct("/sys/kernel/constants/system_mode");
if (!f->open(Core::OpenMode::ReadOnly)) {
dbgln("Failed to read system_mode: {}", f->error_string());
// Continue and assume "text" mode.