Kernel: Implement more features for AML parser/interpreter

Added
   - BankField
   - BufferField
   - PowerResource
   - ThermalZone
   - Reference
   - Package element forward declare
This commit is contained in:
2024-04-12 01:47:40 +03:00
parent 93ddee5956
commit afb1d7ef0c
14 changed files with 782 additions and 47 deletions

View File

@@ -106,6 +106,23 @@ namespace Kernel::ACPI::AML
}
}
static bool can_parse(BAN::ConstByteSpan aml_data)
{
if (aml_data.size() == 0)
return false;
switch (static_cast<AML::Byte>(aml_data[0]))
{
case AML::Byte::RootChar:
case AML::Byte::ParentPrefixChar:
case AML::Byte::NullName:
case AML::Byte::DualNamePrefix:
case AML::Byte::MultiNamePrefix:
return true;
default:
return is_lead_name_char(aml_data[0]);
}
}
static BAN::Optional<NameString> parse(BAN::ConstByteSpan& aml_data)
{
if (aml_data.size() == 0)