Kernel: Fix and add some AML to_underlying functions
This commit is contained in:
parent
8902032b42
commit
0fa16cf982
|
@ -67,7 +67,7 @@ namespace Kernel::ACPI::AML
|
||||||
return ParseResult::Failure;
|
return ParseResult::Failure;
|
||||||
}
|
}
|
||||||
auto package_element = package->elements[index];
|
auto package_element = package->elements[index];
|
||||||
result = MUST(BAN::RefPtr<AML::Reference>::create(package_element));
|
result = MUST(BAN::RefPtr<AML::Reference>::create(package_element->to_underlying()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AML::Node::Type::String:
|
case AML::Node::Type::String:
|
||||||
|
|
|
@ -92,6 +92,18 @@ namespace Kernel::ACPI::AML
|
||||||
return element->convert(mask);
|
return element->convert(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BAN::RefPtr<AML::Node> to_underlying() override
|
||||||
|
{
|
||||||
|
if (!initialized)
|
||||||
|
{
|
||||||
|
AML_ERROR("Trying to store into uninitialized PackageElement");
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
if (!resolved && !resolve())
|
||||||
|
return {};
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
|
||||||
BAN::RefPtr<AML::Node> store(BAN::RefPtr<AML::Node> node) override
|
BAN::RefPtr<AML::Node> store(BAN::RefPtr<AML::Node> node) override
|
||||||
{
|
{
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace Kernel::ACPI::AML
|
||||||
Register();
|
Register();
|
||||||
Register(BAN::RefPtr<AML::Node> node);
|
Register(BAN::RefPtr<AML::Node> node);
|
||||||
|
|
||||||
BAN::RefPtr<AML::Node> to_underlying() override { return value; }
|
BAN::RefPtr<AML::Node> to_underlying() override { return value->to_underlying(); }
|
||||||
|
|
||||||
BAN::RefPtr<AML::Node> convert(uint8_t mask) override;
|
BAN::RefPtr<AML::Node> convert(uint8_t mask) override;
|
||||||
BAN::RefPtr<AML::Node> store(BAN::RefPtr<AML::Node> source) override;
|
BAN::RefPtr<AML::Node> store(BAN::RefPtr<AML::Node> source) override;
|
||||||
|
|
Loading…
Reference in New Issue