Kernel: Add more conversions for AML Integer, Register, String
This commit is contained in:
@@ -9,46 +9,13 @@ namespace Kernel::ACPI::AML
|
||||
{
|
||||
BAN::RefPtr<AML::Node> value;
|
||||
|
||||
Register()
|
||||
: Node(Node::Type::Register)
|
||||
{}
|
||||
Register(BAN::RefPtr<AML::Node> value)
|
||||
: Node(Node::Type::Register)
|
||||
, value(value)
|
||||
{}
|
||||
Register();
|
||||
Register(BAN::RefPtr<AML::Node> node);
|
||||
|
||||
BAN::RefPtr<AML::Node> convert(uint8_t mask) override
|
||||
{
|
||||
if (!value)
|
||||
{
|
||||
AML_ERROR("Trying to convert null Register");
|
||||
return {};
|
||||
}
|
||||
return value->convert(mask);
|
||||
}
|
||||
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
|
||||
{
|
||||
if (value && value->type == AML::Node::Type::Reference)
|
||||
return value->store(source);
|
||||
value = source->copy();
|
||||
return value;
|
||||
}
|
||||
|
||||
void debug_print(int indent) const override
|
||||
{
|
||||
AML_DEBUG_PRINT_INDENT(indent);
|
||||
if (!value)
|
||||
AML_DEBUG_PRINT("Register { No value }");
|
||||
else
|
||||
{
|
||||
AML_DEBUG_PRINTLN("Register { ");
|
||||
value->debug_print(indent + 1);
|
||||
AML_DEBUG_PRINTLN("");
|
||||
AML_DEBUG_PRINT_INDENT(indent);
|
||||
AML_DEBUG_PRINT(" }");
|
||||
}
|
||||
}
|
||||
void debug_print(int indent) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user