Kernel: Fix AML Register/Reference accesses
This commit is contained in:
parent
eaf06d239c
commit
4dc107f77a
|
@ -69,10 +69,13 @@ namespace Kernel::ACPI::AML
|
||||||
if (!parse_result.success())
|
if (!parse_result.success())
|
||||||
return ParseResult::Failure;
|
return ParseResult::Failure;
|
||||||
object = parse_result.node();
|
object = parse_result.node();
|
||||||
if (object && object->type == AML::Node::Type::Register)
|
|
||||||
object = static_cast<AML::Register*>(object.ptr())->value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (object && object->type == AML::Node::Type::Reference)
|
||||||
|
object = static_cast<AML::Reference*>(object.ptr())->node;
|
||||||
|
if (object && object->type == AML::Node::Type::Register)
|
||||||
|
object = static_cast<AML::Register*>(object.ptr())->value;
|
||||||
|
|
||||||
if (!conditional)
|
if (!conditional)
|
||||||
{
|
{
|
||||||
if (!object)
|
if (!object)
|
||||||
|
|
|
@ -22,6 +22,8 @@ namespace Kernel::ACPI::AML
|
||||||
if (!object_result.success())
|
if (!object_result.success())
|
||||||
return ParseResult::Failure;
|
return ParseResult::Failure;
|
||||||
auto object_node = object_result.node();
|
auto object_node = object_result.node();
|
||||||
|
if (object_node && object_node->type == AML::Node::Type::Register)
|
||||||
|
object_node = static_cast<AML::Register*>(object_node.ptr())->value;
|
||||||
if (!object_node)
|
if (!object_node)
|
||||||
{
|
{
|
||||||
AML_ERROR("SizeOf object is null");
|
AML_ERROR("SizeOf object is null");
|
||||||
|
|
|
@ -44,9 +44,9 @@ namespace Kernel::ACPI::AML
|
||||||
AML_DEBUG_PRINTLN("}");
|
AML_DEBUG_PRINTLN("}");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!destination->store(source))
|
if (auto stored = destination->store(source))
|
||||||
return ParseResult::Failure;
|
return ParseResult(stored);
|
||||||
return ParseResult(destination);
|
return ParseResult::Failure;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue