summaryrefslogtreecommitdiff
path: root/source/tools
diff options
context:
space:
mode:
Diffstat (limited to 'source/tools')
-rw-r--r--source/tools/acpibin/abmain.c5
-rw-r--r--source/tools/acpiexec/aecommon.h4
-rw-r--r--source/tools/acpiexec/aehandlers.c63
-rw-r--r--source/tools/acpiexec/aemain.c54
-rw-r--r--source/tools/acpiexec/aeregion.c58
-rw-r--r--source/tools/acpiexec/aetables.c70
-rw-r--r--source/tools/acpinames/anmain.c2
-rw-r--r--source/tools/examples/examples.c34
8 files changed, 186 insertions, 104 deletions
diff --git a/source/tools/acpibin/abmain.c b/source/tools/acpibin/abmain.c
index 85f204527e8e..f5671891c984 100644
--- a/source/tools/acpibin/abmain.c
+++ b/source/tools/acpibin/abmain.c
@@ -76,8 +76,9 @@ AbDisplayUsage (
ACPI_USAGE_HEADER ("acpibin [options]");
- ACPI_OPTION ("-c <File1><File2>", "Compare two binary AML files");
- ACPI_OPTION ("-d <In><Out>", "Dump AML binary to text file");
+ ACPI_OPTION ("-c <File1> <File2>", "Compare two binary AML files");
+ ACPI_OPTION ("-d <In> <Out>", "Dump AML binary to text file");
+ ACPI_OPTION ("-e <Sig> <In> <Out>", "Extract binary AML table from acpidump file");
ACPI_OPTION ("-h <File>", "Display table header for binary AML file");
ACPI_OPTION ("-s <File>", "Update checksum for binary AML file");
ACPI_OPTION ("-t", "Terse mode");
diff --git a/source/tools/acpiexec/aecommon.h b/source/tools/acpiexec/aecommon.h
index bc30acf0ea11..6184c6b62b40 100644
--- a/source/tools/acpiexec/aecommon.h
+++ b/source/tools/acpiexec/aecommon.h
@@ -113,6 +113,10 @@ ACPI_STATUS
AeInstallTables (
void);
+ACPI_STATUS
+AeLoadTables (
+ void);
+
void
AeDumpNamespace (
void);
diff --git a/source/tools/acpiexec/aehandlers.c b/source/tools/acpiexec/aehandlers.c
index 625cf5704d4f..ba461dd453b1 100644
--- a/source/tools/acpiexec/aehandlers.c
+++ b/source/tools/acpiexec/aehandlers.c
@@ -693,7 +693,39 @@ AeInstallLateHandlers (
void)
{
ACPI_STATUS Status;
+ ACPI_HANDLE Handle;
+
+
+ Status = AcpiGetHandle (NULL, "\\_TZ.TZ1", &Handle);
+ if (ACPI_SUCCESS (Status))
+ {
+ Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
+ AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567));
+
+ Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
+ AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF));
+
+ Status = AcpiRemoveNotifyHandler (Handle, ACPI_ALL_NOTIFY,
+ AeNotifyHandler1);
+ Status = AcpiRemoveNotifyHandler (Handle, ACPI_ALL_NOTIFY,
+ AeNotifyHandler2);
+ Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
+ AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF));
+
+ Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
+ AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567));
+ }
+
+ Status = AcpiGetHandle (NULL, "\\_PR.CPU0", &Handle);
+ if (ACPI_SUCCESS (Status))
+ {
+ Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
+ AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567));
+
+ Status = AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY,
+ AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF));
+ }
#if (!ACPI_REDUCED_HARDWARE)
if (!AcpiGbl_ReducedHardware)
@@ -879,37 +911,6 @@ AeInstallEarlyHandlers (
printf ("No _SB_ found, %s\n", AcpiFormatException (Status));
}
- Status = AcpiGetHandle (NULL, "\\_TZ.TZ1", &Handle);
- if (ACPI_SUCCESS (Status))
- {
- Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
- AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567));
-
- Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
- AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF));
-
- Status = AcpiRemoveNotifyHandler (Handle, ACPI_ALL_NOTIFY,
- AeNotifyHandler1);
- Status = AcpiRemoveNotifyHandler (Handle, ACPI_ALL_NOTIFY,
- AeNotifyHandler2);
-
- Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
- AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF));
-
- Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
- AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567));
- }
-
- Status = AcpiGetHandle (NULL, "\\_PR.CPU0", &Handle);
- if (ACPI_SUCCESS (Status))
- {
- Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY,
- AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567));
-
- Status = AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY,
- AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF));
- }
-
/*
* Install handlers that will override the default handlers for some of
* the space IDs.
diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c
index bc35036df4b4..a5f168c237b0 100644
--- a/source/tools/acpiexec/aemain.c
+++ b/source/tools/acpiexec/aemain.c
@@ -152,9 +152,11 @@ usage (
ACPI_OPTION ("-dt", "Disable allocation tracking (performance)");
printf ("\n");
+ ACPI_OPTION ("-ed", "Enable timer output for Debug Object");
ACPI_OPTION ("-ef", "Enable display of final memory statistics");
ACPI_OPTION ("-ei", "Enable additional tests for ACPICA interfaces");
ACPI_OPTION ("-el", "Enable loading of additional test tables");
+ ACPI_OPTION ("-em", "Enable grouping of module-level code");
ACPI_OPTION ("-es", "Enable Interpreter Slack Mode");
ACPI_OPTION ("-et", "Enable debug semaphore timeout");
printf ("\n");
@@ -258,6 +260,11 @@ AeDoOptions (
switch (AcpiGbl_Optarg[0])
{
+ case 'd':
+
+ AcpiGbl_DisplayDebugTimer = TRUE;
+ break;
+
case 'f':
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
@@ -275,6 +282,11 @@ AeDoOptions (
AcpiGbl_LoadTestTables = TRUE;
break;
+ case 'm':
+
+ AcpiGbl_GroupModuleLevelCode = TRUE;
+ break;
+
case 's':
AcpiGbl_EnableInterpreterSlack = TRUE;
@@ -456,6 +468,7 @@ main (
/* Init ACPICA and start debugger thread */
+ AcpiGbl_OverrideDefaultRegionHandlers = TRUE;
Status = AcpiInitializeSubsystem ();
ACPI_CHECK_OK (AcpiInitializeSubsystem, Status);
if (ACPI_FAILURE (Status))
@@ -513,7 +526,7 @@ main (
{
/* Get all ACPI AML tables in this file */
- Status = AcpiAcGetAllTablesFromFile (argv[AcpiGbl_Optind],
+ Status = AcGetAllTablesFromFile (argv[AcpiGbl_Optind],
ACPI_GET_ONLY_AML_TABLES, &ListHead);
if (ACPI_FAILURE (Status))
{
@@ -534,28 +547,21 @@ main (
goto ErrorExit;
}
- Status = AeInstallTables ();
+ /* Install all of the ACPI tables */
- /*
- * Exit namespace initialization for the "load namespace only" option.
- * No control methods will be executed. However, still enter the
- * the debugger.
- */
- if (AcpiGbl_AeLoadOnly)
- {
- goto EnterDebugger;
- }
+ Status = AeInstallTables ();
if (ACPI_FAILURE (Status))
{
- printf ("**** Could not load ACPI tables, %s\n",
+ printf ("**** Could not install ACPI tables, %s\n",
AcpiFormatException (Status));
goto EnterDebugger;
}
/*
- * Install most of the handlers.
- * Override some default region handlers, especially SystemMemory
+ * Install most of the handlers (Regions, Notify, Table, etc.)
+ * Override the default region handlers, especially SystemMemory,
+ * which is simulated in this utility.
*/
Status = AeInstallEarlyHandlers ();
if (ACPI_FAILURE (Status))
@@ -583,6 +589,25 @@ main (
goto EnterDebugger;
}
+ Status = AeLoadTables ();
+
+ /*
+ * Exit namespace initialization for the "load namespace only" option.
+ * No control methods will be executed. However, still enter the
+ * the debugger.
+ */
+ if (AcpiGbl_AeLoadOnly)
+ {
+ goto EnterDebugger;
+ }
+
+ if (ACPI_FAILURE (Status))
+ {
+ printf ("**** Could not load ACPI tables, %s\n",
+ AcpiFormatException (Status));
+ goto EnterDebugger;
+ }
+
/*
* Install handlers for "device driver" space IDs (EC,SMBus, etc.)
* and fixed event handlers
@@ -637,6 +662,7 @@ EnterDebugger:
break;
}
+ (void) AcpiOsTerminate ();
return (0);
diff --git a/source/tools/acpiexec/aeregion.c b/source/tools/acpiexec/aeregion.c
index a33e9e70def1..31b4202974b0 100644
--- a/source/tools/acpiexec/aeregion.c
+++ b/source/tools/acpiexec/aeregion.c
@@ -149,59 +149,87 @@ AeRegionInit (
}
+/******************************************************************************
+ *
+ * FUNCTION: AeOverrideRegionHandlers
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Override the default region handlers for memory, i/o, and
+ * pci_config. Also install a handler for EC. This is part of
+ * the "install early handlers" functionality.
+ *
+ *****************************************************************************/
+
void
-AeInstallRegionHandlers (
+AeOverrideRegionHandlers (
void)
{
UINT32 i;
ACPI_STATUS Status;
/*
- * Install handlers for some of the "device driver" address spaces
- * such as SMBus, etc.
+ * Install handlers that will override the default handlers for some of
+ * the space IDs.
*/
- for (i = 0; i < ACPI_ARRAY_LENGTH (SpaceIdList); i++)
+ for (i = 0; i < ACPI_ARRAY_LENGTH (DefaultSpaceIdList); i++)
{
/* Install handler at the root object */
Status = AcpiInstallAddressSpaceHandler (ACPI_ROOT_OBJECT,
- SpaceIdList[i], AeRegionHandler,
+ DefaultSpaceIdList[i], AeRegionHandler,
AeRegionInit, &AeMyContext);
+
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not install an OpRegion handler for %s space(%u)",
- AcpiUtGetRegionName((UINT8) SpaceIdList[i]), SpaceIdList[i]));
- return;
+ AcpiUtGetRegionName ((UINT8) DefaultSpaceIdList[i]),
+ DefaultSpaceIdList[i]));
}
}
}
+/******************************************************************************
+ *
+ * FUNCTION: AeInstallRegionHandlers
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Install handlers for the address spaces other than memory,
+ * i/o, and pci_config.
+ *
+ *****************************************************************************/
+
void
-AeOverrideRegionHandlers (
+AeInstallRegionHandlers (
void)
{
UINT32 i;
ACPI_STATUS Status;
/*
- * Install handlers that will override the default handlers for some of
- * the space IDs.
+ * Install handlers for some of the "device driver" address spaces
+ * such as SMBus, etc.
*/
- for (i = 0; i < ACPI_ARRAY_LENGTH (DefaultSpaceIdList); i++)
+ for (i = 0; i < ACPI_ARRAY_LENGTH (SpaceIdList); i++)
{
/* Install handler at the root object */
Status = AcpiInstallAddressSpaceHandler (ACPI_ROOT_OBJECT,
- DefaultSpaceIdList[i], AeRegionHandler,
+ SpaceIdList[i], AeRegionHandler,
AeRegionInit, &AeMyContext);
+
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
- "Could not install a default OpRegion handler for %s space(%u)",
- AcpiUtGetRegionName ((UINT8) DefaultSpaceIdList[i]),
- DefaultSpaceIdList[i]));
+ "Could not install an OpRegion handler for %s space(%u)",
+ AcpiUtGetRegionName((UINT8) SpaceIdList[i]), SpaceIdList[i]));
return;
}
}
diff --git a/source/tools/acpiexec/aetables.c b/source/tools/acpiexec/aetables.c
index 7e81fc3cefd0..a5129b896cdb 100644
--- a/source/tools/acpiexec/aetables.c
+++ b/source/tools/acpiexec/aetables.c
@@ -229,9 +229,6 @@ AeBuildLocalTables (
/*
* Install the user tables. The DSDT must be installed in the FADT.
* All other tables are installed directly into the XSDT.
- *
- * Note: The tables are loaded in reverse order from the incoming
- * input, which makes it match the command line order.
*/
NextTable = ListHead;
while (NextTable)
@@ -262,7 +259,7 @@ AeBuildLocalTables (
{
/* Install the table in the XSDT */
- LocalXSDT->TableOffsetEntry[TableCount - NextIndex + 1] =
+ LocalXSDT->TableOffsetEntry[NextIndex] =
ACPI_PTR_TO_PHYSADDR (NextTable->Table);
NextIndex++;
}
@@ -493,27 +490,6 @@ AeInstallTables (
Status = AcpiInitializeTables (NULL, ACPI_MAX_INIT_TABLES, TRUE);
ACPI_CHECK_OK (AcpiInitializeTables, Status);
- Status = AcpiLoadTables ();
- ACPI_CHECK_OK (AcpiLoadTables, Status);
-
- /*
- * Test run-time control method installation. Do it twice to test code
- * for an existing name.
- */
- Status = AcpiInstallMethod (MethodCode);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("%s, Could not install method\n",
- AcpiFormatException (Status));
- }
-
- Status = AcpiInstallMethod (MethodCode);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("%s, Could not install method\n",
- AcpiFormatException (Status));
- }
-
if (AcpiGbl_LoadTestTables)
{
/* Test multiple table/UEFI support. First, get the headers */
@@ -558,6 +534,50 @@ AeInstallTables (
/******************************************************************************
*
+ * FUNCTION: AeLoadTables
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Load the definition block ACPI tables
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AeLoadTables (
+ void)
+{
+ ACPI_STATUS Status;
+
+
+ Status = AcpiLoadTables ();
+ ACPI_CHECK_OK (AcpiLoadTables, Status);
+
+ /*
+ * Test run-time control method installation. Do it twice to test code
+ * for an existing name.
+ */
+ Status = AcpiInstallMethod (MethodCode);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("%s, Could not install method\n",
+ AcpiFormatException (Status));
+ }
+
+ Status = AcpiInstallMethod (MethodCode);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("%s, Could not install method\n",
+ AcpiFormatException (Status));
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: AcpiOsGetRootPointer
*
* PARAMETERS: Flags - not used
diff --git a/source/tools/acpinames/anmain.c b/source/tools/acpinames/anmain.c
index 8b0e0220aa01..9eaed3b0dccd 100644
--- a/source/tools/acpinames/anmain.c
+++ b/source/tools/acpinames/anmain.c
@@ -175,7 +175,7 @@ main (
{
/* Get all ACPI AML tables in this file */
- Status = AcpiAcGetAllTablesFromFile (argv[AcpiGbl_Optind],
+ Status = AcGetAllTablesFromFile (argv[AcpiGbl_Optind],
ACPI_GET_ONLY_AML_TABLES, &ListHead);
if (ACPI_FAILURE (Status))
{
diff --git a/source/tools/examples/examples.c b/source/tools/examples/examples.c
index 98d7bbcb908b..4b1d9fcc107f 100644
--- a/source/tools/examples/examples.c
+++ b/source/tools/examples/examples.c
@@ -176,6 +176,7 @@ InitializeFullAcpica (void)
/* Initialize the ACPICA subsystem */
+ AcpiGbl_OverrideDefaultRegionHandlers = TRUE;
Status = AcpiInitializeSubsystem ();
if (ACPI_FAILURE (Status))
{
@@ -194,15 +195,6 @@ InitializeFullAcpica (void)
return (Status);
}
- /* Create the ACPI namespace from ACPI tables */
-
- Status = AcpiLoadTables ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "While loading ACPI tables"));
- return (Status);
- }
-
/* Install local handlers */
Status = InstallHandlers ();
@@ -221,6 +213,15 @@ InitializeFullAcpica (void)
return (Status);
}
+ /* Create the ACPI namespace from ACPI tables */
+
+ Status = AcpiLoadTables ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "While loading ACPI tables"));
+ return (Status);
+ }
+
/* Complete the ACPI namespace object initialization */
Status = AcpiInitializeObjects (ACPI_FULL_INITIALIZATION);
@@ -283,6 +284,7 @@ InitializeAcpi (
/* Initialize the ACPICA subsystem */
+ AcpiGbl_OverrideDefaultRegionHandlers = TRUE;
Status = AcpiInitializeSubsystem ();
if (ACPI_FAILURE (Status))
{
@@ -297,26 +299,26 @@ InitializeAcpi (
return (Status);
}
- /* Create the ACPI namespace from ACPI tables */
+ /* Install local handlers */
- Status = AcpiLoadTables ();
+ Status = InstallHandlers ();
if (ACPI_FAILURE (Status))
{
+ ACPI_EXCEPTION ((AE_INFO, Status, "While installing handlers"));
return (Status);
}
- /* Install local handlers */
+ /* Initialize the ACPI hardware */
- Status = InstallHandlers ();
+ Status = AcpiEnableSubsystem (ACPI_FULL_INITIALIZATION);
if (ACPI_FAILURE (Status))
{
- ACPI_EXCEPTION ((AE_INFO, Status, "While installing handlers"));
return (Status);
}
- /* Initialize the ACPI hardware */
+ /* Create the ACPI namespace from ACPI tables */
- Status = AcpiEnableSubsystem (ACPI_FULL_INITIALIZATION);
+ Status = AcpiLoadTables ();
if (ACPI_FAILURE (Status))
{
return (Status);