summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/components/tables/tbutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/components/tables/tbutils.c')
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbutils.c76
1 files changed, 29 insertions, 47 deletions
diff --git a/sys/contrib/dev/acpica/components/tables/tbutils.c b/sys/contrib/dev/acpica/components/tables/tbutils.c
index 8b80025..e99f1b9 100644
--- a/sys/contrib/dev/acpica/components/tables/tbutils.c
+++ b/sys/contrib/dev/acpica/components/tables/tbutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -75,7 +75,7 @@ ACPI_STATUS
AcpiTbInitializeFacs (
void)
{
- ACPI_STATUS Status;
+ ACPI_TABLE_FACS *Facs;
/* If Hardware Reduced flag is set, there is no FACS */
@@ -85,39 +85,25 @@ AcpiTbInitializeFacs (
AcpiGbl_FACS = NULL;
return (AE_OK);
}
-
- Status = AcpiGetTableByIndex (ACPI_TABLE_INDEX_FACS,
- ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_FACS));
- return (Status);
-}
-#endif /* !ACPI_REDUCED_HARDWARE */
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbTablesLoaded
- *
- * PARAMETERS: None
- *
- * RETURN: TRUE if required ACPI tables are loaded
- *
- * DESCRIPTION: Determine if the minimum required ACPI tables are present
- * (FADT, FACS, DSDT)
- *
- ******************************************************************************/
-
-BOOLEAN
-AcpiTbTablesLoaded (
- void)
-{
-
- if (AcpiGbl_RootTableList.CurrentTableCount >= 3)
+ else if (AcpiGbl_FADT.XFacs &&
+ (!AcpiGbl_FADT.Facs || !AcpiGbl_Use32BitFacsAddresses))
{
- return (TRUE);
+ (void) AcpiGetTableByIndex (AcpiGbl_XFacsIndex,
+ ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Facs));
+ AcpiGbl_FACS = Facs;
}
+ else if (AcpiGbl_FADT.Facs)
+ {
+ (void) AcpiGetTableByIndex (AcpiGbl_FacsIndex,
+ ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Facs));
+ AcpiGbl_FACS = Facs;
+ }
+
+ /* If there is no FACS, just continue. There was already an error msg */
- return (FALSE);
+ return (AE_OK);
}
+#endif /* !ACPI_REDUCED_HARDWARE */
/*******************************************************************************
@@ -147,6 +133,7 @@ AcpiTbCheckDsdtHeader (
ACPI_BIOS_ERROR ((AE_INFO,
"The DSDT has been corrupted or replaced - "
"old, new headers below"));
+
AcpiTbPrintTableHeader (0, &AcpiGbl_OriginalDsdtHeader);
AcpiTbPrintTableHeader (0, AcpiGbl_DSDT);
@@ -190,15 +177,15 @@ AcpiTbCopyDsdt (
return (NULL);
}
- ACPI_MEMCPY (NewTable, TableDesc->Pointer, TableDesc->Length);
+ memcpy (NewTable, TableDesc->Pointer, TableDesc->Length);
AcpiTbUninstallTable (TableDesc);
AcpiTbInitTableDescriptor (
- &AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT],
- ACPI_PTR_TO_PHYSADDR (NewTable), ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL,
- NewTable);
+ &AcpiGbl_RootTableList.Tables[AcpiGbl_DsdtIndex],
+ ACPI_PTR_TO_PHYSADDR (NewTable),
+ ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, NewTable);
- ACPI_INFO ((AE_INFO,
+ ACPI_INFO ((
"Forced DSDT copy: length 0x%05X copied locally, original unmapped",
NewTable->Length));
@@ -241,7 +228,8 @@ AcpiTbGetRootTableEntry (
* 32-bit platform, RSDT: Return 32-bit table entry
* 64-bit platform, RSDT: Expand 32-bit to 64-bit and return
*/
- return ((ACPI_PHYSICAL_ADDRESS) (*ACPI_CAST_PTR (UINT32, TableEntry)));
+ return ((ACPI_PHYSICAL_ADDRESS) (*ACPI_CAST_PTR (
+ UINT32, TableEntry)));
}
else
{
@@ -388,13 +376,6 @@ AcpiTbParseRootTable (
TableEntrySize);
TableEntry = ACPI_ADD_PTR (UINT8, Table, sizeof (ACPI_TABLE_HEADER));
- /*
- * First two entries in the table array are reserved for the DSDT
- * and FACS, which are not actually present in the RSDT/XSDT - they
- * come from the FADT
- */
- AcpiGbl_RootTableList.CurrentTableCount = 2;
-
/* Initialize the root table array from the RSDT/XSDT */
for (i = 0; i < TableCount; i++)
@@ -414,10 +395,12 @@ AcpiTbParseRootTable (
ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, FALSE, TRUE, &TableIndex);
if (ACPI_SUCCESS (Status) &&
- ACPI_COMPARE_NAME (&AcpiGbl_RootTableList.Tables[TableIndex].Signature,
+ ACPI_COMPARE_NAME (
+ &AcpiGbl_RootTableList.Tables[TableIndex].Signature,
ACPI_SIG_FADT))
{
- AcpiTbParseFadt (TableIndex);
+ AcpiGbl_FadtIndex = TableIndex;
+ AcpiTbParseFadt ();
}
NextTable:
@@ -426,6 +409,5 @@ NextTable:
}
AcpiOsUnmapMemory (Table, Length);
-
return_ACPI_STATUS (AE_OK);
}
OpenPOWER on IntegriCloud