Kernel: Implement dummy \_OSI method for AML

This always returns Zero (not supported)
This commit is contained in:
Bananymous 2024-04-12 01:49:54 +03:00
parent dd8060d64f
commit 46b5a7697c
1 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,4 @@
#include <kernel/ACPI/AML/Method.h>
#include <kernel/ACPI/AML/Namespace.h> #include <kernel/ACPI/AML/Namespace.h>
#include <kernel/ACPI/AML/ParseContext.h> #include <kernel/ACPI/AML/ParseContext.h>
#include <kernel/ACPI/AML/Region.h> #include <kernel/ACPI/AML/Region.h>
@ -6,6 +7,7 @@ namespace Kernel::ACPI
{ {
static BAN::RefPtr<AML::Namespace> s_root_namespace; static BAN::RefPtr<AML::Namespace> s_root_namespace;
static BAN::Vector<uint8_t> s_osi_aml_data;
BAN::RefPtr<AML::Namespace> AML::Namespace::root_namespace() BAN::RefPtr<AML::Namespace> AML::Namespace::root_namespace()
{ {
@ -209,6 +211,13 @@ namespace Kernel::ACPI
ADD_PREDEFIED_NAMESPACE("_TZ"sv); ADD_PREDEFIED_NAMESPACE("_TZ"sv);
#undef ADD_PREDEFIED_NAMESPACE #undef ADD_PREDEFIED_NAMESPACE
// Add dummy \_OSI
MUST(s_osi_aml_data.push_back(static_cast<uint8_t>(Byte::ReturnOp)));
MUST(s_osi_aml_data.push_back(static_cast<uint8_t>(Byte::ZeroOp)));
auto osi = MUST(BAN::RefPtr<AML::Method>::create(NameSeg("_OSI"sv), 1, false, 0));
osi->term_list = s_osi_aml_data.span();
ASSERT(s_root_namespace->add_named_object(context, AML::NameString("\\_OSI"), osi));
return s_root_namespace; return s_root_namespace;
} }