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())
|
||||
return ParseResult::Failure;
|
||||
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 (!object)
|
||||
|
|
|
@ -22,6 +22,8 @@ namespace Kernel::ACPI::AML
|
|||
if (!object_result.success())
|
||||
return ParseResult::Failure;
|
||||
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)
|
||||
{
|
||||
AML_ERROR("SizeOf object is null");
|
||||
|
|
|
@ -44,9 +44,9 @@ namespace Kernel::ACPI::AML
|
|||
AML_DEBUG_PRINTLN("}");
|
||||
#endif
|
||||
|
||||
if (!destination->store(source))
|
||||
return ParseResult::Failure;
|
||||
return ParseResult(destination);
|
||||
if (auto stored = destination->store(source))
|
||||
return ParseResult(stored);
|
||||
return ParseResult::Failure;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue