Kernel: Implement AML storing to Buffer

This commit is contained in:
Bananymous 2024-08-15 23:12:52 +03:00
parent 6408bb2efa
commit d729d7f570
1 changed files with 17 additions and 0 deletions

View File

@ -46,6 +46,23 @@ namespace Kernel::ACPI::AML
return {};
}
BAN::RefPtr<AML::Node> store(BAN::RefPtr<AML::Node> node) override
{
ASSERT(node);
auto conv_node = node->convert(AML::Node::ConvBuffer);
if (!conv_node)
{
AML_ERROR("Buffer store could not convert to buffer");
return {};
}
auto& conv_buffer = static_cast<AML::Buffer*>(conv_node.ptr())->buffer;
MUST(buffer.resize(conv_buffer.size()));
for (size_t i = 0; i < buffer.size(); i++)
buffer[i] = conv_buffer[i];
return this;
}
static ParseResult parse(AML::ParseContext& context)
{
ASSERT(context.aml_data.size() >= 1);