From e0a447bfafe5c7d6e6af75f6fc2072a0c981988a Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 15 Aug 2024 02:28:22 +0300 Subject: [PATCH] Kernel: Add _GL to ACPI root namespace --- kernel/include/kernel/ACPI/AML/Mutex.h | 4 +++- kernel/kernel/ACPI/AML/Namespace.cpp | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/include/kernel/ACPI/AML/Mutex.h b/kernel/include/kernel/ACPI/AML/Mutex.h index d10cdf7a..95827dd7 100644 --- a/kernel/include/kernel/ACPI/AML/Mutex.h +++ b/kernel/include/kernel/ACPI/AML/Mutex.h @@ -14,10 +14,12 @@ namespace Kernel::ACPI::AML { Kernel::Mutex mutex; uint8_t sync_level; + bool global; - Mutex(NameSeg name, uint8_t sync_level) + Mutex(NameSeg name, uint8_t sync_level, bool global = false) : NamedObject(Node::Type::Mutex, name) , sync_level(sync_level) + , global(global) {} BAN::RefPtr convert(uint8_t) override { return {}; } diff --git a/kernel/kernel/ACPI/AML/Namespace.cpp b/kernel/kernel/ACPI/AML/Namespace.cpp index 66bcfb4e..014a40e5 100644 --- a/kernel/kernel/ACPI/AML/Namespace.cpp +++ b/kernel/kernel/ACPI/AML/Namespace.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -233,6 +234,9 @@ namespace Kernel::ACPI ADD_PREDEFIED_NAMESPACE("_TZ"_sv); #undef ADD_PREDEFIED_NAMESPACE + auto gl = MUST(BAN::RefPtr::create(NameSeg("_GL"_sv), 0, true)); + ASSERT(s_root_namespace->add_named_object(context, AML::NameString("\\_GL"), gl)); + // Add \_OSI that returns true for Linux compatibility auto osi = MUST(BAN::RefPtr::create(NameSeg("_OSI"_sv), 1, false, 0)); osi->override_function = [](AML::ParseContext& context) -> BAN::RefPtr {