Kernel: Add _GL to ACPI root namespace

This commit is contained in:
Bananymous 2024-08-15 02:28:22 +03:00
parent 3f5ee6f414
commit e0a447bfaf
2 changed files with 7 additions and 1 deletions

View File

@ -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<AML::Node> convert(uint8_t) override { return {}; }

View File

@ -1,6 +1,7 @@
#include <kernel/ACPI/AML/Device.h>
#include <kernel/ACPI/AML/Integer.h>
#include <kernel/ACPI/AML/Method.h>
#include <kernel/ACPI/AML/Mutex.h>
#include <kernel/ACPI/AML/Namespace.h>
#include <kernel/ACPI/AML/ParseContext.h>
#include <kernel/ACPI/AML/Region.h>
@ -233,6 +234,9 @@ namespace Kernel::ACPI
ADD_PREDEFIED_NAMESPACE("_TZ"_sv);
#undef ADD_PREDEFIED_NAMESPACE
auto gl = MUST(BAN::RefPtr<AML::Mutex>::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<AML::Method>::create(NameSeg("_OSI"_sv), 1, false, 0));
osi->override_function = [](AML::ParseContext& context) -> BAN::RefPtr<AML::Node> {