summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/components/debugger/dbfileio.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/components/debugger/dbfileio.c')
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbfileio.c148
1 files changed, 21 insertions, 127 deletions
diff --git a/sys/contrib/dev/acpica/components/debugger/dbfileio.c b/sys/contrib/dev/acpica/components/debugger/dbfileio.c
index 59a9a52..38f3678 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbfileio.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbfileio.c
@@ -6,7 +6,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
@@ -46,14 +46,16 @@
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
#include <contrib/dev/acpica/include/actables.h>
-
-#if (defined ACPI_DEBUGGER || defined ACPI_DISASSEMBLER)
+#include <stdio.h>
+#ifdef ACPI_APPLICATION
+#include <contrib/dev/acpica/include/acapps.h>
+#endif
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbfileio")
-#ifdef ACPI_DEBUGGER
+#ifdef ACPI_DEBUGGER
/*******************************************************************************
*
* FUNCTION: AcpiDbCloseDebugFile
@@ -78,7 +80,8 @@ AcpiDbCloseDebugFile (
fclose (AcpiGbl_DebugFile);
AcpiGbl_DebugFile = NULL;
AcpiGbl_DbOutputToFile = FALSE;
- AcpiOsPrintf ("Debug output file %s closed\n", AcpiGbl_DbDebugFilename);
+ AcpiOsPrintf ("Debug output file %s closed\n",
+ AcpiGbl_DbDebugFilename);
}
#endif
}
@@ -112,7 +115,7 @@ AcpiDbOpenDebugFile (
}
AcpiOsPrintf ("Debug output file %s opened\n", Name);
- ACPI_STRNCPY (AcpiGbl_DbDebugFilename, Name,
+ strncpy (AcpiGbl_DbDebugFilename, Name,
sizeof (AcpiGbl_DbDebugFilename));
AcpiGbl_DbOutputToFile = TRUE;
@@ -121,134 +124,35 @@ AcpiDbOpenDebugFile (
#endif
-#ifdef ACPI_APPLICATION
-#include <contrib/dev/acpica/include/acapps.h>
-
-/*******************************************************************************
- *
- * FUNCTION: AeLocalLoadTable
- *
- * PARAMETERS: Table - pointer to a buffer containing the entire
- * table to be loaded
- *
- * RETURN: Status
- *
- * DESCRIPTION: This function is called to load a table from the caller's
- * buffer. The buffer must contain an entire ACPI Table including
- * a valid header. The header fields will be verified, and if it
- * is determined that the table is invalid, the call will fail.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AeLocalLoadTable (
- ACPI_TABLE_HEADER *Table)
-{
- ACPI_STATUS Status = AE_OK;
-/* ACPI_TABLE_DESC TableInfo; */
-
-
- ACPI_FUNCTION_TRACE (AeLocalLoadTable);
-#if 0
-
-
- if (!Table)
- {
- return_ACPI_STATUS (AE_BAD_PARAMETER);
- }
-
- TableInfo.Pointer = Table;
- Status = AcpiTbRecognizeTable (&TableInfo, ACPI_TABLE_ALL);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- /* Install the new table into the local data structures */
-
- Status = AcpiTbInitTableDescriptor (&TableInfo);
- if (ACPI_FAILURE (Status))
- {
- if (Status == AE_ALREADY_EXISTS)
- {
- /* Table already exists, no error */
-
- Status = AE_OK;
- }
-
- /* Free table allocated by AcpiTbGetTable */
-
- AcpiTbDeleteSingleTable (&TableInfo);
- return_ACPI_STATUS (Status);
- }
-
-#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
-
- Status = AcpiNsLoadTable (TableInfo.InstalledDesc, AcpiGbl_RootNode);
- if (ACPI_FAILURE (Status))
- {
- /* Uninstall table and free the buffer */
-
- AcpiTbDeleteTablesByType (ACPI_TABLE_ID_DSDT);
- return_ACPI_STATUS (Status);
- }
-#endif
-#endif
-
- return_ACPI_STATUS (Status);
-}
-#endif
-
-
/*******************************************************************************
*
- * FUNCTION: AcpiDbGetTableFromFile
+ * FUNCTION: AcpiDbLoadTables
*
- * PARAMETERS: Filename - File where table is located
- * ReturnTable - Where a pointer to the table is returned
+ * PARAMETERS: ListHead - List of ACPI tables to load
*
* RETURN: Status
*
- * DESCRIPTION: Load an ACPI table from a file
+ * DESCRIPTION: Load ACPI tables from a previously constructed table list.
*
******************************************************************************/
ACPI_STATUS
-AcpiDbGetTableFromFile (
- char *Filename,
- ACPI_TABLE_HEADER **ReturnTable,
- BOOLEAN MustBeAmlFile)
+AcpiDbLoadTables (
+ ACPI_NEW_TABLE_DESC *ListHead)
{
-#ifdef ACPI_APPLICATION
ACPI_STATUS Status;
+ ACPI_NEW_TABLE_DESC *TableListHead;
ACPI_TABLE_HEADER *Table;
- BOOLEAN IsAmlTable = TRUE;
- Status = AcpiUtReadTableFromFile (Filename, &Table);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
+ /* Load all ACPI tables in the list */
- if (MustBeAmlFile)
+ TableListHead = ListHead;
+ while (TableListHead)
{
- IsAmlTable = AcpiUtIsAmlTable (Table);
- if (!IsAmlTable)
- {
- ACPI_EXCEPTION ((AE_INFO, AE_OK,
- "Input for -e is not an AML table: "
- "\"%4.4s\" (must be DSDT/SSDT)",
- Table->Signature));
- return (AE_TYPE);
- }
- }
+ Table = TableListHead->Table;
- if (IsAmlTable)
- {
- /* Attempt to recognize and install the table */
-
- Status = AeLocalLoadTable (Table);
+ Status = AcpiLoadTable (Table);
if (ACPI_FAILURE (Status))
{
if (Status == AE_ALREADY_EXISTS)
@@ -265,22 +169,12 @@ AcpiDbGetTableFromFile (
return (Status);
}
- AcpiTbPrintTableHeader (0, Table);
-
fprintf (stderr,
"Acpi table [%4.4s] successfully installed and loaded\n",
Table->Signature);
- }
- AcpiGbl_AcpiHardwarePresent = FALSE;
- if (ReturnTable)
- {
- *ReturnTable = Table;
+ TableListHead = TableListHead->Next;
}
-
-#endif /* ACPI_APPLICATION */
return (AE_OK);
}
-
-#endif /* ACPI_DEBUGGER */
OpenPOWER on IntegriCloud