diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2016-08-31 21:40:51 +0000 |
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2016-08-31 21:40:51 +0000 |
| commit | be99e84498e91a5930864ef7b92b1a7ceb815e44 (patch) | |
| tree | 7f5a2883a75b1713bdfe7d36ffa6217bac9187e2 /source/tools/acpiexec/aemain.c | |
| parent | 8bc6ab62dbdb3e8b0d2253e0440f6f58ac9afd3d (diff) | |
Notes
Diffstat (limited to 'source/tools/acpiexec/aemain.c')
| -rw-r--r-- | source/tools/acpiexec/aemain.c | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c index d2c9d519aa49..d4bf335a9801 100644 --- a/source/tools/acpiexec/aemain.c +++ b/source/tools/acpiexec/aemain.c @@ -92,6 +92,8 @@ BOOLEAN AcpiGbl_LoadTestTables = FALSE; BOOLEAN AcpiGbl_AeLoadOnly = FALSE; static UINT8 AcpiGbl_ExecutionMode = AE_MODE_COMMAND_LOOP; static char BatchBuffer[AE_BUFFER_SIZE]; /* Batch command buffer */ +static char AeBuildDate[] = __DATE__; +static char AeBuildTime[] = __TIME__; #define ACPIEXEC_NAME "AML Execution/Debug Utility" #define AE_SUPPORTED_OPTIONS "?b:d:e:f^ghi:lm^rv^:x:" @@ -155,6 +157,7 @@ usage ( 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 ("-ep", "Enable TermList parsing for scope objects"); ACPI_OPTION ("-es", "Enable Interpreter Slack Mode"); ACPI_OPTION ("-et", "Enable debug semaphore timeout"); printf ("\n"); @@ -167,6 +170,7 @@ usage ( ACPI_OPTION ("-l", "Load tables and namespace only"); ACPI_OPTION ("-r", "Use hardware-reduced FADT V5"); ACPI_OPTION ("-v", "Display version information"); + ACPI_OPTION ("-vd", "Display build date and time"); ACPI_OPTION ("-vi", "Verbose initialization output"); ACPI_OPTION ("-vr", "Verbose region handler output"); ACPI_OPTION ("-x <DebugLevel>", "Debug output level"); @@ -285,6 +289,11 @@ AeDoOptions ( AcpiGbl_GroupModuleLevelCode = TRUE; break; + case 'p': + + AcpiGbl_ParseTableAsTermList = TRUE; + break; + case 's': AcpiGbl_EnableInterpreterSlack = TRUE; @@ -399,6 +408,11 @@ AeDoOptions ( (void) AcpiOsTerminate (); return (1); + case 'd': + + printf ("Build date/time: %s %s\n", AeBuildDate, AeBuildTime); + return (1); + case 'i': AcpiDbgLevel |= ACPI_LV_INIT_NAMES; @@ -464,8 +478,13 @@ main ( AcpiDbgLevel = ACPI_NORMAL_DEFAULT; AcpiDbgLayer = 0xFFFFFFFF; - /* Init ACPICA and start debugger thread */ - + /* + * Initialize ACPICA and start debugger thread. + * + * NOTE: After ACPICA initialization, AcpiTerminate MUST be called + * before this procedure exits -- otherwise, the console may be + * left in an incorrect state. + */ Status = AcpiInitializeSubsystem (); ACPI_CHECK_OK (AcpiInitializeSubsystem, Status); if (ACPI_FAILURE (Status)) @@ -491,8 +510,7 @@ main ( if (argc < 2) { usage (); - (void) AcpiOsTerminate (); - return (0); + goto NormalExit; } /* Get the command line options */ @@ -547,7 +565,6 @@ main ( /* Install all of the ACPI tables */ Status = AeInstallTables (); - if (ACPI_FAILURE (Status)) { printf ("**** Could not install ACPI tables, %s\n", @@ -576,7 +593,13 @@ main ( /* * Main initialization for ACPICA subsystem - * TBD: Need a way to call this after the ACPI table "LOAD" command + * TBD: Need a way to call this after the ACPI table "LOAD" command? + * + * NOTE: This initialization does not match the _Lxx and _Exx methods + * to individual GPEs, as there are no real GPEs when the hardware + * is simulated - because there is no namespace until AeLoadTables is + * executed. This may have to change if AcpiExec is ever run natively + * on actual hardware (such as under UEFI). */ Status = AcpiEnableSubsystem (InitFlags); if (ACPI_FAILURE (Status)) @@ -660,14 +683,14 @@ EnterDebugger: /* Temporarily removed */ AcpiTerminateDebugger (); - Status = AcpiTerminate (); + (void) AcpiTerminate (); #endif - Status = AcpiOsTerminate (); - return (0); - +NormalExit: + ExitCode = 0; ErrorExit: + (void) AcpiOsTerminate (); return (ExitCode); } |
