summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/tbxface.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/tbxface.c')
-rw-r--r--sys/contrib/dev/acpica/tbxface.c62
1 files changed, 53 insertions, 9 deletions
diff --git a/sys/contrib/dev/acpica/tbxface.c b/sys/contrib/dev/acpica/tbxface.c
index d2bc9cb..4accd25 100644
--- a/sys/contrib/dev/acpica/tbxface.c
+++ b/sys/contrib/dev/acpica/tbxface.c
@@ -2,7 +2,7 @@
*
* Module Name: tbxface - Public interfaces to the ACPI subsystem
* ACPI table oriented interfaces
- * $Revision: 34 $
+ * $Revision: 38 $
*
*****************************************************************************/
@@ -123,7 +123,7 @@
#include "actables.h"
-#define _COMPONENT TABLE_MANAGER
+#define _COMPONENT ACPI_TABLES
MODULE_NAME ("tbxface")
@@ -144,20 +144,28 @@ ACPI_STATUS
AcpiLoadTables (
ACPI_PHYSICAL_ADDRESS RsdpPhysicalAddress)
{
- ACPI_STATUS Status = AE_OK;
+ ACPI_STATUS Status;
UINT32 NumberOfTables = 0;
FUNCTION_TRACE ("AcpiLoadTables");
+ /* Ensure that ACPI has been initialized */
+
+ ACPI_IS_INITIALIZATION_COMPLETE (Status);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
/* Map and validate the RSDP */
Status = AcpiTbVerifyRsdp (RsdpPhysicalAddress);
if (ACPI_FAILURE (Status))
{
REPORT_ERROR (("AcpiLoadTables: RSDP Failed validation: %s\n",
- AcpiCmFormatException (Status)));
+ AcpiUtFormatException (Status)));
goto ErrorExit;
}
@@ -167,7 +175,7 @@ AcpiLoadTables (
if (ACPI_FAILURE (Status))
{
REPORT_ERROR (("AcpiLoadTables: Could not load RSDT: %s\n",
- AcpiCmFormatException (Status)));
+ AcpiUtFormatException (Status)));
goto ErrorExit;
}
@@ -177,11 +185,11 @@ AcpiLoadTables (
if (ACPI_FAILURE (Status))
{
REPORT_ERROR (("AcpiLoadTables: Error getting required tables (DSDT/FADT/FACS): %s\n",
- AcpiCmFormatException (Status)));
+ AcpiUtFormatException (Status)));
goto ErrorExit;
}
- DEBUG_PRINT (ACPI_OK, ("ACPI Tables successfully loaded\n"));
+ DEBUG_PRINTP (ACPI_OK, ("ACPI Tables successfully loaded\n"));
/* Load the namespace from the tables */
@@ -190,7 +198,7 @@ AcpiLoadTables (
if (ACPI_FAILURE (Status))
{
REPORT_ERROR (("AcpiLoadTables: Could not load namespace: %s\n",
- AcpiCmFormatException (Status)));
+ AcpiUtFormatException (Status)));
goto ErrorExit;
}
@@ -199,7 +207,7 @@ AcpiLoadTables (
ErrorExit:
REPORT_ERROR (("AcpiLoadTables: Could not load tables: %s\n",
- AcpiCmFormatException (Status)));
+ AcpiUtFormatException (Status)));
return_ACPI_STATUS (Status);
}
@@ -233,6 +241,15 @@ AcpiLoadTable (
FUNCTION_TRACE ("AcpiLoadTable");
+
+ /* Ensure that ACPI has been initialized */
+
+ ACPI_IS_INITIALIZATION_COMPLETE (Status);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
if (!TablePtr)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
@@ -289,11 +306,20 @@ AcpiUnloadTable (
ACPI_TABLE_TYPE TableType)
{
ACPI_TABLE_DESC *ListHead;
+ ACPI_STATUS Status;
FUNCTION_TRACE ("AcpiUnloadTable");
+ /* Ensure that ACPI has been initialized */
+
+ ACPI_IS_INITIALIZATION_COMPLETE (Status);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
/* Parameter validation */
if (TableType > ACPI_TABLE_MAX)
@@ -362,6 +388,15 @@ AcpiGetTableHeader (
FUNCTION_TRACE ("AcpiGetTableHeader");
+
+ /* Ensure that ACPI has been initialized */
+
+ ACPI_IS_INITIALIZATION_COMPLETE (Status);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
if ((Instance == 0) ||
(TableType == ACPI_TABLE_RSDP) ||
(!OutTableHeader))
@@ -444,6 +479,15 @@ AcpiGetTable (
FUNCTION_TRACE ("AcpiGetTable");
+
+ /* Ensure that ACPI has been initialized */
+
+ ACPI_IS_INITIALIZATION_COMPLETE (Status);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
/*
* If we have a buffer, we must have a length too
*/
OpenPOWER on IntegriCloud