/* AmlCodeGenDefinitionBlock (TableSignature, OemID, TableID, OEMRevision) is equivalent to the following ASL code: DefinitionBlock (AMLFileName, TableSignature, ComplianceRevision, OemID, TableID, OEMRevision) {} with the ComplianceRevision set to 2 and the AMLFileName is ignored. */
EFI_STATUS EFIAPI AmlCodeGenDefinitionBlock(IN CONST CHAR8 *TableSignature, IN CONST CHAR8 *OemId, IN CONST CHAR8 *OemTableId, IN UINT32 OemRevision, OUT AML_ROOT_NODE **NewRootNode)
/* AmlCodeGenDefinitionBlock (TableSignature, OemID, TableID, OEMRevision) is equivalent to the following ASL code: DefinitionBlock (AMLFileName, TableSignature, ComplianceRevision, OemID, TableID, OEMRevision) {} with the ComplianceRevision set to 2 and the AMLFileName is ignored. */
EFI_STATUS EFIAPI AmlCodeGenDefinitionBlock(IN CONST CHAR8 *TableSignature, IN CONST CHAR8 *OemId, IN CONST CHAR8 *OemTableId, IN UINT32 OemRevision, OUT AML_ROOT_NODE **NewRootNode)
{
  EFI_STATUS                   Status;
  EFI_ACPI_DESCRIPTION_HEADER  AcpiHeader;
  if ((TableSignature == NULL)  ||
      (OemId == NULL)           ||
      (OemTableId == NULL)      ||
      (NewRootNode == NULL))
  {
    ASSERT (0);
    return EFI_INVALID_PARAMETER;
  }
  CopyMem (&AcpiHeader.Signature, TableSignature, 4);
  AcpiHeader.Length   = sizeof (EFI_ACPI_DESCRIPTION_HEADER);
  AcpiHeader.Revision = 2;
  CopyMem (&AcpiHeader.OemId, OemId, 6);
  CopyMem (&AcpiHeader.OemTableId, OemTableId, 8);
  AcpiHeader.OemRevision     = OemRevision;
  AcpiHeader.CreatorId       = TABLE_GENERATOR_CREATOR_ID_ARM;
  AcpiHeader.CreatorRevision = CREATE_REVISION (1, 0);
  Status = AmlCreateRootNode (&AcpiHeader, NewRootNode);
  ASSERT_EFI_ERROR (Status);
  return Status;
}