summaryrefslogtreecommitdiff
path: root/source/compiler/dttable.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/compiler/dttable.c')
-rw-r--r--source/compiler/dttable.c70
1 files changed, 36 insertions, 34 deletions
diff --git a/source/compiler/dttable.c b/source/compiler/dttable.c
index c1011f823135..7b33e4d2302e 100644
--- a/source/compiler/dttable.c
+++ b/source/compiler/dttable.c
@@ -129,12 +129,9 @@ DtCompileFadt (
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
ACPI_TABLE_HEADER *Table;
- UINT8 FadtRevision;
- UINT32 i;
+ UINT8 Revision;
- /* Minimum table is the FADT version 1 (ACPI 1.0) */
-
Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt1,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
@@ -146,41 +143,22 @@ DtCompileFadt (
DtInsertSubtable (ParentTable, Subtable);
Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer);
- FadtRevision = Table->Revision;
-
- /* Revision 0 and 2 are illegal */
-
- if ((FadtRevision == 0) ||
- (FadtRevision == 2))
- {
- DtError (ASL_ERROR, 0, NULL,
- "Invalid value for FADT revision");
-
- return (AE_BAD_VALUE);
- }
-
- /* Revision out of supported range? */
+ Revision = Table->Revision;
- if (FadtRevision > ACPI_FADT_MAX_VERSION)
+ if (Revision == 2)
{
- DtError (ASL_ERROR, 0, NULL,
- "Unknown or unsupported value for FADT revision");
-
- return (AE_BAD_VALUE);
- }
-
- /* Compile individual sub-parts of the FADT, per-revision */
-
- for (i = 3; i <= ACPI_FADT_MAX_VERSION; i++)
- {
- if (i > FadtRevision)
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt2,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
{
- break;
+ return (Status);
}
- /* Compile the fields specific to this FADT revision */
-
- Status = DtCompileTable (PFieldList, FadtRevisionInfo[i],
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+ else if (Revision >= 2)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt3,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
@@ -188,6 +166,30 @@ DtCompileFadt (
}
DtInsertSubtable (ParentTable, Subtable);
+
+ if (Revision >= 5)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt5,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ if (Revision >= 6)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt6,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ }
}
return (AE_OK);