summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/common/dmtbinfo.c6
-rw-r--r--source/compiler/aslmessages.c2
-rw-r--r--source/compiler/aslmessages.h2
-rw-r--r--source/compiler/dttable.c59
4 files changed, 61 insertions, 8 deletions
diff --git a/source/common/dmtbinfo.c b/source/common/dmtbinfo.c
index 347f9d367..7d812315a 100644
--- a/source/common/dmtbinfo.c
+++ b/source/common/dmtbinfo.c
@@ -292,7 +292,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[] =
{
{ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Facs), "FACS Address", 0},
- {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Dsdt), "DSDT Address", DT_NON_ZERO},
+ {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Dsdt), "DSDT Address", 0},
{ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Model), "Model", 0},
{ACPI_DMT_FADTPM, ACPI_FADT_OFFSET (PreferredProfile), "PM Profile", 0},
{ACPI_DMT_UINT16, ACPI_FADT_OFFSET (SciInterrupt), "SCI Interrupt", 0},
@@ -408,7 +408,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[] =
ACPI_DMT_TERMINATOR
};
-/* ACPI 5.0 Extensions (FADT version 5) */
+/* Extensions for FADT version 5 */
ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[] =
{
@@ -417,7 +417,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[] =
ACPI_DMT_TERMINATOR
};
-/* ACPI 6.0 Extensions (FADT version 6) */
+/* Extensions for FADT version 6 */
ACPI_DMTABLE_INFO AcpiDmTableInfoFadt6[] =
{
diff --git a/source/compiler/aslmessages.c b/source/compiler/aslmessages.c
index 4dd6422ba..98c3b0ae5 100644
--- a/source/compiler/aslmessages.c
+++ b/source/compiler/aslmessages.c
@@ -410,6 +410,8 @@ const char *AslTableCompilerMsgs [] =
/* ASL_MSG_ENTRY_LIST */ "Invalid entry initializer list",
/* ASL_MSG_UNKNOWN_FORMAT */ "Unknown format value",
/* ASL_MSG_RESERVED_VALUE */ "Value for field is reserved or unknown",
+/* ASL_MSG_TWO_ZERO_VALUES */ "32-bit DSDT Address and 64-bit X_DSDT Address cannot both be zero",
+/* ASL_MSG_BAD_PARSE_TREE */ "Parse tree appears to be ill-defined",
};
/* Preprocessor */
diff --git a/source/compiler/aslmessages.h b/source/compiler/aslmessages.h
index 69c2561ba..0e9fefd4e 100644
--- a/source/compiler/aslmessages.h
+++ b/source/compiler/aslmessages.h
@@ -412,6 +412,8 @@ typedef enum
ASL_MSG_ENTRY_LIST,
ASL_MSG_UNKNOWN_FORMAT,
ASL_MSG_RESERVED_VALUE,
+ ASL_MSG_TWO_ZERO_VALUES,
+ ASL_MSG_BAD_PARSE_TREE,
/* These messages are used by the Preprocessor only */
diff --git a/source/compiler/dttable.c b/source/compiler/dttable.c
index 702c83ee2..312e9f1bd 100644
--- a/source/compiler/dttable.c
+++ b/source/compiler/dttable.c
@@ -223,10 +223,12 @@ DtCompileRsdp (
*
* RETURN: Status
*
- * DESCRIPTION: Compile FADT.
+ * DESCRIPTION: Compile FADT (signature FACP).
*
*****************************************************************************/
+#define ACPI_XDSDT_LOCATION_IN_LIST 11
+
ACPI_STATUS
DtCompileFadt (
void **List)
@@ -235,10 +237,17 @@ DtCompileFadt (
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
- ACPI_TABLE_HEADER *Table;
+ DT_FIELD *DsdtFieldList;
+ ACPI_TABLE_FADT *Table;
UINT8 Revision;
+ UINT32 DsdtAddress;
+ UINT64 X_DsdtAddress;
+ UINT32 i;
+
+ /* Get the table revision and 32-bit DSDT Address definition */
+ DsdtFieldList = (*PFieldList)->Next;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt1,
&Subtable);
if (ACPI_FAILURE (Status))
@@ -249,8 +258,16 @@ DtCompileFadt (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
- Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer);
- Revision = Table->Revision;
+ Table = ACPI_CAST_PTR (ACPI_TABLE_FADT, ParentTable->Buffer);
+ Revision = Table->Header.Revision;
+ DsdtAddress = Table->Dsdt;
+
+ /* FADT version 1 has only 32-bit addresses - error if DSDT address is NULL */
+
+ if ((Revision == 1) && (!DsdtAddress))
+ {
+ DtError (ASL_ERROR, ASL_MSG_ZERO_VALUE, DsdtFieldList, NULL);
+ }
if (Revision == 2)
{
@@ -263,8 +280,24 @@ DtCompileFadt (
DtInsertSubtable (ParentTable, Subtable);
}
- else if (Revision >= 2)
+
+ else if (Revision > 2)
{
+ /*
+ * Rev 2 and greater have 64-bit addresses (as well as 32-bit).
+ * Get the 64-bit DSDT (X_DSDT) Address definition. Note: This
+ * appears at field list offset 11 within AcpiDmTableInfoFadt3.
+ */
+ DsdtFieldList = *PFieldList;
+ for (i = 0; i < ACPI_XDSDT_LOCATION_IN_LIST; i++)
+ {
+ DsdtFieldList = DsdtFieldList->Next;
+ if (!DsdtFieldList)
+ {
+ return (ASL_MSG_BAD_PARSE_TREE);
+ }
+ }
+
Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt3,
&Subtable);
if (ACPI_FAILURE (Status))
@@ -274,6 +307,20 @@ DtCompileFadt (
DtInsertSubtable (ParentTable, Subtable);
+ Table = ACPI_CAST_PTR (ACPI_TABLE_FADT, ParentTable->Buffer);
+ X_DsdtAddress = Table->XDsdt;
+
+ /*
+ * Error if both the 32-bit DSDT address and the
+ * 64-bit X_DSDT address are zero.
+ */
+ if ((!X_DsdtAddress) && (!DsdtAddress))
+ {
+ DtError (ASL_ERROR, ASL_MSG_TWO_ZERO_VALUES, DsdtFieldList, NULL);
+ }
+
+ /* Fields specific to FADT Revision 5 (appended to previous) */
+
if (Revision >= 5)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt5,
@@ -286,6 +333,8 @@ DtCompileFadt (
DtInsertSubtable (ParentTable, Subtable);
}
+ /* Fields specific to FADT Revision 6 (appended to previous) */
+
if (Revision >= 6)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt6,