summaryrefslogtreecommitdiff
path: root/source/components/debugger/dbfileio.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2015-11-25 21:04:42 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2015-11-25 21:04:42 +0000
commitb9098066cd6284319bca922f13e59517f774a103 (patch)
treef01fd6c9053cb01ed84c00cb42ee789adafceaf5 /source/components/debugger/dbfileio.c
parent1e24cf365bc9c8df179b145c90d52852724e54ee (diff)
Notes
Diffstat (limited to 'source/components/debugger/dbfileio.c')
-rw-r--r--source/components/debugger/dbfileio.c136
1 files changed, 16 insertions, 120 deletions
diff --git a/source/components/debugger/dbfileio.c b/source/components/debugger/dbfileio.c
index aaeda4527f86..9ce3f2ff6a52 100644
--- a/source/components/debugger/dbfileio.c
+++ b/source/components/debugger/dbfileio.c
@@ -46,7 +46,10 @@
#include "accommon.h"
#include "acdebug.h"
#include "actables.h"
-
+#include <stdio.h>
+#ifdef ACPI_APPLICATION
+#include "acapps.h"
+#endif
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbfileio")
@@ -121,134 +124,35 @@ AcpiDbOpenDebugFile (
#endif
-#ifdef ACPI_APPLICATION
-#include "acapps.h"
-
/*******************************************************************************
*
- * FUNCTION: AeLocalLoadTable
+ * FUNCTION: AcpiDbLoadTables
*
- * PARAMETERS: Table - pointer to a buffer containing the entire
- * table to be loaded
+ * PARAMETERS: ListHead - List of ACPI tables to load
*
* 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_FUNCTION_TRACE (AeLocalLoadTable);
-
-#if 0
-/* ACPI_TABLE_DESC TableInfo; */
-
- 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
- *
- * PARAMETERS: Filename - File where table is located
- * ReturnTable - Where a pointer to the table is returned
- *
- * 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);
- }
-
- if (MustBeAmlFile)
- {
- 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);
- }
- }
+ /* Load all ACPI tables in the list */
- if (IsAmlTable)
+ TableListHead = ListHead;
+ while (TableListHead)
{
- /* Attempt to recognize and install the table */
+ Table = TableListHead->Table;
- Status = AeLocalLoadTable (Table);
+ Status = AcpiLoadTable (Table);
if (ACPI_FAILURE (Status))
{
if (Status == AE_ALREADY_EXISTS)
@@ -265,20 +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);
}