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 | |
| parent | 8bc6ab62dbdb3e8b0d2253e0440f6f58ac9afd3d (diff) | |
Notes
Diffstat (limited to 'source/tools')
| -rw-r--r-- | source/tools/acpidump/apdump.c | 4 | ||||
| -rw-r--r-- | source/tools/acpidump/apmain.c | 4 | ||||
| -rw-r--r-- | source/tools/acpiexec/aeexec.c | 15 | ||||
| -rw-r--r-- | source/tools/acpiexec/aehandlers.c | 2 | ||||
| -rw-r--r-- | source/tools/acpiexec/aeinitfile.c | 6 | ||||
| -rw-r--r-- | source/tools/acpiexec/aemain.c | 43 |
6 files changed, 50 insertions, 24 deletions
diff --git a/source/tools/acpidump/apdump.c b/source/tools/acpidump/apdump.c index 98ca3b6b4e5c..4941c0ecad86 100644 --- a/source/tools/acpidump/apdump.c +++ b/source/tools/acpidump/apdump.c @@ -326,8 +326,8 @@ ApDumpTableByAddress ( /* Convert argument to an integer physical address */ - Status = AcpiUtStrtoul64 (AsciiAddress, ACPI_ANY_BASE, - ACPI_MAX64_BYTE_WIDTH, &LongAddress); + Status = AcpiUtStrtoul64 (AsciiAddress, ACPI_STRTOUL_64BIT, + &LongAddress); if (ACPI_FAILURE (Status)) { fprintf (stderr, "%s: Could not convert to a physical address\n", diff --git a/source/tools/acpidump/apmain.c b/source/tools/acpidump/apmain.c index 26a956e043a8..9f7f3ef7afda 100644 --- a/source/tools/acpidump/apmain.c +++ b/source/tools/acpidump/apmain.c @@ -236,8 +236,8 @@ ApDoOptions ( case 'r': /* Dump tables from specified RSDP */ - Status = AcpiUtStrtoul64 (AcpiGbl_Optarg, ACPI_ANY_BASE, - ACPI_MAX64_BYTE_WIDTH, &Gbl_RsdpBase); + Status = AcpiUtStrtoul64 (AcpiGbl_Optarg, ACPI_STRTOUL_64BIT, + &Gbl_RsdpBase); if (ACPI_FAILURE (Status)) { fprintf (stderr, "%s: Could not convert to a physical address\n", diff --git a/source/tools/acpiexec/aeexec.c b/source/tools/acpiexec/aeexec.c index 9fc80078c4c3..5953e36cd1fd 100644 --- a/source/tools/acpiexec/aeexec.c +++ b/source/tools/acpiexec/aeexec.c @@ -70,7 +70,7 @@ AeGetDevices ( static ACPI_STATUS ExecuteOSI ( char *OsiString, - UINT32 ExpectedResult); + UINT64 ExpectedResult); static void AeMutexInterfaces ( @@ -328,7 +328,7 @@ AeGetDevices ( * FUNCTION: ExecuteOSI * * PARAMETERS: OsiString - String passed to _OSI method - * ExpectedResult - 0 (FALSE) or 0xFFFFFFFF (TRUE) + * ExpectedResult - 0 (FALSE) or ACPI_UINT64_MAX (TRUE) * * RETURN: Status * @@ -339,7 +339,7 @@ AeGetDevices ( static ACPI_STATUS ExecuteOSI ( char *OsiString, - UINT32 ExpectedResult) + UINT64 ExpectedResult) { ACPI_STATUS Status; ACPI_OBJECT_LIST ArgList; @@ -392,8 +392,9 @@ ExecuteOSI ( if (Obj->Integer.Value != ExpectedResult) { AcpiOsPrintf ( - "Invalid return value from _OSI, expected %.8X found %.8X\n", - ExpectedResult, (UINT32) Obj->Integer.Value); + "Invalid return value from _OSI, expected %8.8X%8.8X found %8.8X%8.8X\n", + ACPI_FORMAT_UINT64 (ExpectedResult), + ACPI_FORMAT_UINT64 (Obj->Integer.Value)); goto ErrorExit; } @@ -697,10 +698,10 @@ AeMiscellaneousTests ( /* Test _OSI execution */ - Status = ExecuteOSI ("Extended Address Space Descriptor", 0xFFFFFFFF); + Status = ExecuteOSI ("Extended Address Space Descriptor", ACPI_UINT64_MAX); ACPI_CHECK_OK (ExecuteOSI, Status); - Status = ExecuteOSI ("Windows 2001", 0xFFFFFFFF); + Status = ExecuteOSI ("Windows 2001", ACPI_UINT64_MAX); ACPI_CHECK_OK (ExecuteOSI, Status); Status = ExecuteOSI ("MichiganTerminalSystem", 0); diff --git a/source/tools/acpiexec/aehandlers.c b/source/tools/acpiexec/aehandlers.c index 811e41ec8586..1fa2d375cb67 100644 --- a/source/tools/acpiexec/aehandlers.c +++ b/source/tools/acpiexec/aehandlers.c @@ -115,6 +115,8 @@ static char *TableEvents[] = { "LOAD", "UNLOAD", + "INSTALL", + "UNINSTALL", "UNKNOWN" }; #endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/source/tools/acpiexec/aeinitfile.c b/source/tools/acpiexec/aeinitfile.c index d41ba1412aa6..8151435e3448 100644 --- a/source/tools/acpiexec/aeinitfile.c +++ b/source/tools/acpiexec/aeinitfile.c @@ -172,7 +172,7 @@ CleanupAndExit: * * RETURN: None * - * DESCRIPTION: Perform an overrided for a single namespace object + * DESCRIPTION: Perform an override for a single namespace object * *****************************************************************************/ @@ -203,8 +203,8 @@ AeDoOneOverride ( /* Extract the 64-bit integer */ - Status = AcpiUtStrtoul64 (ValueString, ACPI_ANY_BASE, - ACPI_MAX64_BYTE_WIDTH, &Value); + Status = AcpiUtStrtoul64 (ValueString, + (ACPI_STRTOUL_BASE16 | ACPI_STRTOUL_64BIT), &Value); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("%s %s\n", ValueString, 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); } |
