diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2013-08-23 18:01:58 +0000 |
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2013-08-23 18:01:58 +0000 |
| commit | 59ce063597ddbda74269a45aba8187dece2fe00a (patch) | |
| tree | 89234dd9f502de2faaf4a280ccd0d3785a7ae96f /source/tools | |
| parent | dbded195f9840f9044a6828c8877c6bf0a956482 (diff) | |
Notes
Diffstat (limited to 'source/tools')
| -rw-r--r-- | source/tools/acpibin/abmain.c | 25 | ||||
| -rw-r--r-- | source/tools/acpidump/acpidump.h | 18 | ||||
| -rw-r--r-- | source/tools/acpidump/apdump.c | 145 | ||||
| -rw-r--r-- | source/tools/acpidump/apfiles.c | 40 | ||||
| -rw-r--r-- | source/tools/acpidump/apmain.c | 23 | ||||
| -rw-r--r-- | source/tools/acpiexec/aehandlers.c | 83 | ||||
| -rw-r--r-- | source/tools/acpiexec/aemain.c | 10 | ||||
| -rw-r--r-- | source/tools/acpiexec/aetables.c | 2 | ||||
| -rw-r--r-- | source/tools/acpihelp/ahmain.c | 12 | ||||
| -rw-r--r-- | source/tools/acpinames/anmain.c | 12 | ||||
| -rw-r--r-- | source/tools/acpinames/antables.c | 2 | ||||
| -rw-r--r-- | source/tools/acpisrc/asmain.c | 30 | ||||
| -rw-r--r-- | source/tools/acpisrc/astable.c | 2 | ||||
| -rw-r--r-- | source/tools/acpixtract/axmain.c | 12 |
14 files changed, 337 insertions, 79 deletions
diff --git a/source/tools/acpibin/abmain.c b/source/tools/acpibin/abmain.c index 67fbc2420dc7..a4ca919bd7c2 100644 --- a/source/tools/acpibin/abmain.c +++ b/source/tools/acpibin/abmain.c @@ -53,6 +53,10 @@ AbDisplayUsage ( UINT8 OptionCount); +#define AB_UTILITY_NAME "ACPI Binary Table Dump Utility" +#define AB_SUPPORTED_OPTIONS "c:d:e:h:s:tv" + + /****************************************************************************** * * FUNCTION: AbDisplayUsage @@ -73,12 +77,13 @@ 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 ("-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"); + 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"); + ACPI_OPTION ("-v", "Display version information"); } @@ -105,7 +110,7 @@ main ( AcpiGbl_DbOutputFlags = DB_CONSOLE_OUTPUT; AcpiOsInitialize (); - printf (ACPI_COMMON_SIGNON ("ACPI Binary AML File Utility")); + printf (ACPI_COMMON_SIGNON (AB_UTILITY_NAME)); if (argc < 2) { @@ -115,7 +120,7 @@ main ( /* Command line options */ - while ((j = AcpiGetopt (argc, argv, "c:d:e:h:s:t")) != EOF) switch(j) + while ((j = AcpiGetopt (argc, argv, AB_SUPPORTED_OPTIONS)) != EOF) switch(j) { case 'c': /* Compare Files */ @@ -178,6 +183,10 @@ main ( Gbl_TerseMode = TRUE; break; + case 'v': /* -v: (Version): signon already emitted, just exit */ + + return (0); + default: AbDisplayUsage (0); diff --git a/source/tools/acpidump/acpidump.h b/source/tools/acpidump/acpidump.h index 44fd7d3a9fbb..203108fc3f6f 100644 --- a/source/tools/acpidump/acpidump.h +++ b/source/tools/acpidump/acpidump.h @@ -67,9 +67,10 @@ EXTERN BOOLEAN INIT_GLOBAL (Gbl_SummaryMode, FALSE); EXTERN BOOLEAN INIT_GLOBAL (Gbl_VerboseMode, FALSE); EXTERN BOOLEAN INIT_GLOBAL (Gbl_BinaryMode, FALSE); -EXTERN UINT32 INIT_GLOBAL (Gbl_SsdtCount, 0); +EXTERN BOOLEAN INIT_GLOBAL (Gbl_DumpCustomizedTables, FALSE); EXTERN FILE INIT_GLOBAL (*Gbl_OutputFile, NULL); EXTERN char INIT_GLOBAL (*Gbl_OutputFilename, NULL); +EXTERN UINT64 INIT_GLOBAL (Gbl_RsdpBase, 0); /* Globals required for use with ACPICA modules */ @@ -89,6 +90,10 @@ typedef struct ap_dump_action } AP_DUMP_ACTION; +/* Local RSDP signature (Not the same as the actual signature which is "RSD PTR ") */ + +#define AP_DUMP_SIG_RSDP "RSDP" + #define AP_MAX_ACTIONS 32 #define AP_DUMP_ALL_TABLES 0 @@ -129,6 +134,14 @@ BOOLEAN ApIsValidHeader ( ACPI_TABLE_HEADER *Table); +BOOLEAN +ApIsValidChecksum ( + ACPI_TABLE_HEADER *Table); + +UINT32 +ApGetTableLength ( + ACPI_TABLE_HEADER *Table); + /* * apfiles - File I/O utilities @@ -143,7 +156,8 @@ ApOpenOutputFile ( int ApWriteToBinaryFile ( - ACPI_TABLE_HEADER *Table); + ACPI_TABLE_HEADER *Table, + UINT32 Instance); ACPI_TABLE_HEADER * ApGetTableFromFile ( diff --git a/source/tools/acpidump/apdump.c b/source/tools/acpidump/apdump.c index 5000e4db7f87..6317b25d223e 100644 --- a/source/tools/acpidump/apdump.c +++ b/source/tools/acpidump/apdump.c @@ -49,6 +49,7 @@ static int ApDumpTableBuffer ( ACPI_TABLE_HEADER *Table, + UINT32 Instance, ACPI_PHYSICAL_ADDRESS Address); @@ -68,26 +69,111 @@ BOOLEAN ApIsValidHeader ( ACPI_TABLE_HEADER *Table) { + if (!ACPI_VALIDATE_RSDP_SIG (Table->Signature)) + { + /* Make sure signature is all ASCII and a valid ACPI name */ + + if (!AcpiUtValidAcpiName (Table->Signature)) + { + fprintf (stderr, "Table signature (0x%8.8X) is invalid\n", + *(UINT32 *) Table->Signature); + return (FALSE); + } + + /* Check for minimum table length */ + + if (Table->Length <= sizeof (ACPI_TABLE_HEADER)) + { + fprintf (stderr, "Table length (0x%8.8X) is invalid\n", + Table->Length); + return (FALSE); + } + } - /* Make sure signature is all ASCII and a valid ACPI name */ + return (TRUE); +} + + +/****************************************************************************** + * + * FUNCTION: ApIsValidChecksum + * + * PARAMETERS: Table - Pointer to table to be validated + * + * RETURN: TRUE if the checksum appears to be valid. FALSE otherwise + * + * DESCRIPTION: Check for a valid ACPI table checksum + * + ******************************************************************************/ + +BOOLEAN +ApIsValidChecksum ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + ACPI_TABLE_RSDP *Rsdp; + + + if (ACPI_VALIDATE_RSDP_SIG (Table->Signature)) + { + /* + * Checksum for RSDP. + * Note: Other checksums are computed during the table dump. + */ + + Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table); + Status = AcpiTbValidateRsdp (Rsdp); + } + else + { + Status = AcpiTbVerifyChecksum (Table, Table->Length); + } - if (!AcpiUtValidAcpiName (Table->Signature)) + if (ACPI_FAILURE (Status)) { - fprintf (stderr, "Table signature (0x%8.8X) is invalid\n", - *(UINT32 *) Table->Signature); - return (FALSE); + fprintf (stderr, "%4.4s: Warning: wrong checksum\n", + Table->Signature); } - /* Check for minimum table length */ + return (AE_OK); +} + - if (Table->Length <= sizeof (ACPI_TABLE_HEADER)) +/****************************************************************************** + * + * FUNCTION: ApGetTableLength + * + * PARAMETERS: Table - Pointer to the table + * + * RETURN: Table length + * + * DESCRIPTION: Obtain table length according to table signature + * + ******************************************************************************/ + +UINT32 +ApGetTableLength ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_TABLE_RSDP *Rsdp; + + + /* Check if table is valid */ + + if (!ApIsValidHeader (Table)) { - fprintf (stderr, "Table length (0x%8.8X) is invalid\n", - Table->Length); - return (FALSE); + return (0); } - return (TRUE); + if (ACPI_VALIDATE_RSDP_SIG (Table->Signature)) + { + Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table); + return (Rsdp->Length); + } + else + { + return (Table->Length); + } } @@ -96,6 +182,7 @@ ApIsValidHeader ( * FUNCTION: ApDumpTableBuffer * * PARAMETERS: Table - ACPI table to be dumped + * Instance - ACPI table instance no. to be dumped * Address - Physical address of the table * * RETURN: None @@ -108,22 +195,13 @@ ApIsValidHeader ( static int ApDumpTableBuffer ( ACPI_TABLE_HEADER *Table, + UINT32 Instance, ACPI_PHYSICAL_ADDRESS Address) { + UINT32 TableLength; - /* Check if the table header appears to be valid */ - - if (!ApIsValidHeader (Table)) - { - return (-1); - } - - /* Validate the table checksum (except FACS - has no checksum) */ - if (!ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS)) - { - (void) AcpiTbVerifyChecksum (Table, Table->Length); - } + TableLength = ApGetTableLength (Table); /* Print only the header if requested */ @@ -137,7 +215,7 @@ ApDumpTableBuffer ( if (Gbl_BinaryMode) { - return (ApWriteToBinaryFile (Table)); + return (ApWriteToBinaryFile (Table, Instance)); } /* @@ -148,7 +226,7 @@ ApDumpTableBuffer ( printf ("%4.4s @ 0x%8.8X%8.8X\n", Table->Signature, ACPI_FORMAT_UINT64 (Address)); - AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table), Table->Length, + AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table), TableLength, DB_BYTE_DISPLAY, 0); printf ("\n"); return (0); @@ -173,6 +251,7 @@ ApDumpAllTables ( void) { ACPI_TABLE_HEADER *Table; + UINT32 Instance = 0; ACPI_PHYSICAL_ADDRESS Address; ACPI_STATUS Status; UINT32 i; @@ -182,7 +261,7 @@ ApDumpAllTables ( for (i = 0; i < AP_MAX_ACPI_FILES; i++) { - Status = AcpiOsGetTableByIndex (i, &Table, &Address); + Status = AcpiOsGetTableByIndex (i, &Table, &Instance, &Address); if (ACPI_FAILURE (Status)) { /* AE_LIMIT means that no more tables are available */ @@ -205,7 +284,7 @@ ApDumpAllTables ( } } - if (ApDumpTableBuffer (Table, Address)) + if (ApDumpTableBuffer (Table, Instance, Address)) { return (-1); } @@ -261,7 +340,7 @@ ApDumpTableByAddress ( return (-1); } - TableStatus = ApDumpTableBuffer (Table, Address); + TableStatus = ApDumpTableBuffer (Table, 0, Address); free (Table); return (TableStatus); } @@ -306,7 +385,11 @@ ApDumpTableByName ( /* To be friendly, handle tables whose signatures do not match the name */ - if (ACPI_COMPARE_NAME (LocalSignature, "FADT")) + if (ACPI_COMPARE_NAME (LocalSignature, AP_DUMP_SIG_RSDP)) + { + strcpy (LocalSignature, AP_DUMP_SIG_RSDP); + } + else if (ACPI_COMPARE_NAME (LocalSignature, "FADT")) { strcpy (LocalSignature, ACPI_SIG_FADT); } @@ -336,7 +419,7 @@ ApDumpTableByName ( return (-1); } - if (ApDumpTableBuffer (Table, Address)) + if (ApDumpTableBuffer (Table, Instance, Address)) { return (-1); } @@ -395,7 +478,7 @@ ApDumpTableFromFile ( Pathname, Table->Signature, FileSize, FileSize); } - TableStatus = ApDumpTableBuffer (Table, 0); + TableStatus = ApDumpTableBuffer (Table, 0, 0); free (Table); return (TableStatus); } diff --git a/source/tools/acpidump/apfiles.c b/source/tools/acpidump/apfiles.c index fd17423d665b..5c4b0dce4dc5 100644 --- a/source/tools/acpidump/apfiles.c +++ b/source/tools/acpidump/apfiles.c @@ -100,6 +100,7 @@ ApOpenOutputFile ( * FUNCTION: ApWriteToBinaryFile * * PARAMETERS: Table - ACPI table to be written + * Instance - ACPI table instance no. to be written * * RETURN: Status * @@ -110,29 +111,42 @@ ApOpenOutputFile ( int ApWriteToBinaryFile ( - ACPI_TABLE_HEADER *Table) + ACPI_TABLE_HEADER *Table, + UINT32 Instance) { char Filename[ACPI_NAME_SIZE + 16]; - char SsdtInstance [16]; + char InstanceStr [16]; FILE *File; size_t Actual; + UINT32 TableLength; - /* Construct lower-case filename from the table signature */ + /* Obtain table length */ - Filename[0] = (char) ACPI_TOLOWER (Table->Signature[0]); - Filename[1] = (char) ACPI_TOLOWER (Table->Signature[1]); - Filename[2] = (char) ACPI_TOLOWER (Table->Signature[2]); - Filename[3] = (char) ACPI_TOLOWER (Table->Signature[3]); + TableLength = ApGetTableLength (Table); + + /* Construct lower-case filename from the table local signature */ + + if (ACPI_VALIDATE_RSDP_SIG (Table->Signature)) + { + ACPI_MOVE_NAME (Filename, AP_DUMP_SIG_RSDP); + } + else + { + ACPI_MOVE_NAME (Filename, Table->Signature); + } + Filename[0] = (char) ACPI_TOLOWER (Filename[0]); + Filename[1] = (char) ACPI_TOLOWER (Filename[1]); + Filename[2] = (char) ACPI_TOLOWER (Filename[2]); + Filename[3] = (char) ACPI_TOLOWER (Filename[3]); Filename[ACPI_NAME_SIZE] = 0; /* Handle multiple SSDTs - create different filenames for each */ - if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_SSDT)) + if (Instance > 0) { - sprintf (SsdtInstance, "%u", Gbl_SsdtCount); - strcat (Filename, SsdtInstance); - Gbl_SsdtCount++; + sprintf (InstanceStr, "%u", Instance); + strcat (Filename, InstanceStr); } strcat (Filename, ACPI_TABLE_FILE_SUFFIX); @@ -153,8 +167,8 @@ ApWriteToBinaryFile ( return (-1); } - Actual = fwrite (Table, 1, Table->Length, File); - if (Actual != Table->Length) + Actual = fwrite (Table, 1, TableLength, File); + if (Actual != TableLength) { perror ("Error writing binary output file"); fclose (File); diff --git a/source/tools/acpidump/apmain.c b/source/tools/acpidump/apmain.c index 4c90cb7dcc85..b9e62eb17e8f 100644 --- a/source/tools/acpidump/apmain.c +++ b/source/tools/acpidump/apmain.c @@ -92,7 +92,7 @@ UINT32 CurrentAction = 0; #define AP_UTILITY_NAME "ACPI Binary Table Dump Utility" -#define AP_SUPPORTED_OPTIONS "?a:bf:hn:o:svz" +#define AP_SUPPORTED_OPTIONS "?a:bcf:hn:o:r:svz" /****************************************************************************** @@ -111,10 +111,12 @@ ApDisplayUsage ( ACPI_USAGE_HEADER ("acpidump [options]"); ACPI_OPTION ("-b", "Dump tables to binary files"); + ACPI_OPTION ("-c", "Dump customized tables"); ACPI_OPTION ("-h -?", "This help message"); ACPI_OPTION ("-o <File>", "Redirect output to file"); + ACPI_OPTION ("-r <Address>", "Dump tables from specified RSDP"); ACPI_OPTION ("-s", "Print table summaries only"); - ACPI_OPTION ("-v", "Version of this utility"); + ACPI_OPTION ("-v", "Display version information"); ACPI_OPTION ("-z", "Verbose mode"); printf ("\nTable Options:\n"); @@ -182,6 +184,7 @@ ApDoOptions ( char **argv) { int j; + ACPI_STATUS Status; /* Command line options */ @@ -196,6 +199,11 @@ ApDoOptions ( Gbl_BinaryMode = TRUE; continue; + case 'c': /* Dump customized tables */ + + Gbl_DumpCustomizedTables = TRUE; + continue; + case 'h': case '?': @@ -210,6 +218,17 @@ ApDoOptions ( } continue; + case 'r': /* Dump tables from specified RSDP */ + + Status = AcpiUtStrtoul64 (AcpiGbl_Optarg, 0, &Gbl_RsdpBase); + if (ACPI_FAILURE (Status)) + { + fprintf (stderr, "%s: Could not convert to a physical address\n", + AcpiGbl_Optarg); + exit (-1); + } + continue; + case 's': /* Print table summaries only */ Gbl_SummaryMode = TRUE; diff --git a/source/tools/acpiexec/aehandlers.c b/source/tools/acpiexec/aehandlers.c index 44ce31fdebc3..5272f4170133 100644 --- a/source/tools/acpiexec/aehandlers.c +++ b/source/tools/acpiexec/aehandlers.c @@ -126,6 +126,10 @@ static UINT32 AeEventHandler ( void *Context); +static UINT32 +AeSciHandler ( + void *Context); + static char *TableEvents[] = { "LOAD", @@ -632,9 +636,9 @@ AeInterfaceHandler ( #if (!ACPI_REDUCED_HARDWARE) /****************************************************************************** * - * FUNCTION: AeEventHandler + * FUNCTION: AeEventHandler, AeSciHandler * - * DESCRIPTION: Handler for Fixed Events + * DESCRIPTION: Handler for Fixed Events and SCIs * *****************************************************************************/ @@ -644,6 +648,16 @@ AeEventHandler ( { return (0); } + +static UINT32 +AeSciHandler ( + void *Context) +{ + + AcpiOsPrintf ("[AcpiExec] Received an SCI at handler\n"); + return (0); +} + #endif /* !ACPI_REDUCED_HARDWARE */ @@ -666,10 +680,15 @@ AeRegionInit ( void *HandlerContext, void **RegionContext) { - /* - * Real simple, set the RegionContext to the RegionHandle - */ - *RegionContext = RegionHandle; + + if (Function == ACPI_REGION_DEACTIVATE) + { + *RegionContext = NULL; + } + else + { + *RegionContext = RegionHandle; + } return (AE_OK); } @@ -677,6 +696,51 @@ AeRegionInit ( /******************************************************************************* * + * FUNCTION: AeInstallSciHandler + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Install handler for SCIs. Exercise the code by doing an + * install/remove/install. + * + ******************************************************************************/ + +static ACPI_STATUS +AeInstallSciHandler ( + void) +{ + ACPI_STATUS Status; + + + Status = AcpiInstallSciHandler (AeSciHandler, &AeMyContext); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "Could not install an SCI handler (1)")); + } + + Status = AcpiRemoveSciHandler (AeSciHandler); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "Could not remove an SCI handler")); + } + + Status = AcpiInstallSciHandler (AeSciHandler, &AeMyContext); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "Could not install an SCI handler (2)")); + } + + return (Status); +} + + +/******************************************************************************* + * * FUNCTION: AeInstallDeviceHandlers, AeInstallEcHandler, * AeInstallPciHandler * @@ -685,7 +749,7 @@ AeRegionInit ( * RETURN: Status * * DESCRIPTION: Walk entire namespace, install a handler for every EC - * device found. + * and PCI device found. * ******************************************************************************/ @@ -785,6 +849,11 @@ AeInstallLateHandlers ( #if (!ACPI_REDUCED_HARDWARE) if (!AcpiGbl_ReducedHardware) { + /* Install a user SCI handler */ + + Status = AeInstallSciHandler (); + AE_CHECK_OK (AeInstallSciHandler, Status); + /* Install some fixed event handlers */ Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL, AeEventHandler, NULL); diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c index aa0612c0703f..dbd030135742 100644 --- a/source/tools/acpiexec/aemain.c +++ b/source/tools/acpiexec/aemain.c @@ -91,7 +91,8 @@ static char BatchBuffer[AE_BUFFER_SIZE]; /* Batch command buf static char *FileList[ASL_MAX_FILES]; static AE_TABLE_DESC *AeTableListHead = NULL; -#define AE_SUPPORTED_OPTIONS "?b:d:e:f:ghm^orv:x:" +#define ACPIEXEC_NAME "AML Execution/Debug Utility" +#define AE_SUPPORTED_OPTIONS "?b:d:e:f:ghm^orv^:x:" /****************************************************************************** @@ -134,6 +135,7 @@ usage ( ACPI_OPTION ("-f <Value>", "Operation Region initialization fill value"); ACPI_OPTION ("-r", "Use hardware-reduced FADT V5"); + ACPI_OPTION ("-v", "Display version information"); ACPI_OPTION ("-vi", "Verbose initialization output"); ACPI_OPTION ("-vr", "Verbose region handler output"); ACPI_OPTION ("-x <DebugLevel>", "Debug output level"); @@ -302,6 +304,10 @@ AeDoOptions ( switch (AcpiGbl_Optarg[0]) { + case '^': /* -v: (Version): signon already emitted, just exit */ + + exit (0); + case 'i': AcpiDbgLevel |= ACPI_LV_INIT_NAMES; @@ -366,7 +372,7 @@ main ( ACPI_DEBUG_INITIALIZE (); /* For debug version only */ - printf (ACPI_COMMON_SIGNON ("AML Execution/Debug Utility")); + printf (ACPI_COMMON_SIGNON (ACPIEXEC_NAME)); if (argc < 2) { usage (); diff --git a/source/tools/acpiexec/aetables.c b/source/tools/acpiexec/aetables.c index a32c4c54dea8..1ba876e25333 100644 --- a/source/tools/acpiexec/aetables.c +++ b/source/tools/acpiexec/aetables.c @@ -247,7 +247,7 @@ AeBuildLocalTables ( /* Build an RSDP */ ACPI_MEMSET (&LocalRSDP, 0, sizeof (ACPI_TABLE_RSDP)); - ACPI_MEMCPY (LocalRSDP.Signature, ACPI_SIG_RSDP, 8); + ACPI_MAKE_RSDP_SIG (LocalRSDP.Signature); ACPI_MEMCPY (LocalRSDP.OemId, "I_TEST", 6); LocalRSDP.Revision = 2; LocalRSDP.XsdtPhysicalAddress = ACPI_PTR_TO_PHYSADDR (LocalXSDT); diff --git a/source/tools/acpihelp/ahmain.c b/source/tools/acpihelp/ahmain.c index 07e162c199b4..036ab7577aec 100644 --- a/source/tools/acpihelp/ahmain.c +++ b/source/tools/acpihelp/ahmain.c @@ -50,6 +50,9 @@ static void AhDisplayUsage ( void); +#define AH_UTILITY_NAME "ACPI Help Utility" +#define AH_SUPPORTED_OPTIONS "ehikmopsv" + /****************************************************************************** * @@ -66,6 +69,7 @@ AhDisplayUsage ( ACPI_USAGE_HEADER ("acpihelp <options> [NamePrefix | HexValue]"); ACPI_OPTION ("-h", "Display help"); + ACPI_OPTION ("-v", "Display version information"); printf ("\nACPI Names and Symbols:\n"); ACPI_OPTION ("-k [NamePrefix]", "Find/Display ASL non-operator keyword(s)"); @@ -104,7 +108,7 @@ main ( ACPI_DEBUG_INITIALIZE (); /* For debug version only */ - printf (ACPI_COMMON_SIGNON ("ACPI Help Utility")); + printf (ACPI_COMMON_SIGNON (AH_UTILITY_NAME)); DecodeType = AH_DECODE_DEFAULT; if (argc < 2) @@ -115,7 +119,7 @@ main ( /* Command line options */ - while ((j = AcpiGetopt (argc, argv, "ehikmops")) != EOF) switch (j) + while ((j = AcpiGetopt (argc, argv, AH_SUPPORTED_OPTIONS)) != EOF) switch (j) { case 'e': @@ -152,6 +156,10 @@ main ( DecodeType = AH_DECODE_ASL; break; + case 'v': /* -v: (Version): signon already emitted, just exit */ + + return (0); + case 'h': default: diff --git a/source/tools/acpinames/anmain.c b/source/tools/acpinames/anmain.c index 2bc4c6ec941c..c30ae7ae2b50 100644 --- a/source/tools/acpinames/anmain.c +++ b/source/tools/acpinames/anmain.c @@ -53,7 +53,8 @@ FILE *AcpiGbl_DebugFile; static AE_TABLE_DESC *AeTableListHead = NULL; -#define AE_SUPPORTED_OPTIONS "?h" +#define AN_UTILITY_NAME "ACPI Namespace Dump Utility" +#define AN_SUPPORTED_OPTIONS "?hv" /****************************************************************************** @@ -75,6 +76,7 @@ usage ( ACPI_USAGE_HEADER ("AcpiNames [options] AMLfile"); ACPI_OPTION ("-?", "Display this message"); + ACPI_OPTION ("-v", "Display version information"); } @@ -240,7 +242,7 @@ main ( ACPI_DEBUG_INITIALIZE (); /* For debug version only */ - printf (ACPI_COMMON_SIGNON ("ACPI Namespace Dump Utility")); + printf (ACPI_COMMON_SIGNON (AN_UTILITY_NAME)); if (argc < 2) { @@ -258,8 +260,12 @@ main ( /* Get the command line options */ - while ((j = AcpiGetopt (argc, argv, AE_SUPPORTED_OPTIONS)) != EOF) switch(j) + while ((j = AcpiGetopt (argc, argv, AN_SUPPORTED_OPTIONS)) != EOF) switch(j) { + case 'v': /* -v: (Version): signon already emitted, just exit */ + + return (0); + case '?': case 'h': default: diff --git a/source/tools/acpinames/antables.c b/source/tools/acpinames/antables.c index dcf2fa910048..6473e6b4daa0 100644 --- a/source/tools/acpinames/antables.c +++ b/source/tools/acpinames/antables.c @@ -178,7 +178,7 @@ AeBuildLocalTables ( /* Build an RSDP */ ACPI_MEMSET (&LocalRSDP, 0, sizeof (ACPI_TABLE_RSDP)); - ACPI_MEMCPY (LocalRSDP.Signature, ACPI_SIG_RSDP, 8); + ACPI_MAKE_RSDP_SIG (LocalRSDP.Signature); ACPI_MEMCPY (LocalRSDP.OemId, "I_TEST", 6); LocalRSDP.Revision = 2; LocalRSDP.XsdtPhysicalAddress = ACPI_PTR_TO_PHYSADDR (LocalXSDT); diff --git a/source/tools/acpisrc/asmain.c b/source/tools/acpisrc/asmain.c index dc6918951e81..e34eff034bbc 100644 --- a/source/tools/acpisrc/asmain.c +++ b/source/tools/acpisrc/asmain.c @@ -98,6 +98,9 @@ BOOLEAN Gbl_IgnoreLoneLineFeeds = FALSE; BOOLEAN Gbl_HasLoneLineFeeds = FALSE; BOOLEAN Gbl_Cleanup = FALSE; +#define AS_UTILITY_NAME "ACPI Source Code Conversion Utility" +#define AS_SUPPORTED_OPTIONS "cdhlqsuv^y" + /****************************************************************************** * @@ -295,7 +298,8 @@ AsDisplayUsage ( printf ("\n"); ACPI_OPTION ("-d", "Leave debug statements in code"); ACPI_OPTION ("-s", "Generate source statistics only"); - ACPI_OPTION ("-v", "Verbose mode"); + ACPI_OPTION ("-v", "Display version information"); + ACPI_OPTION ("-vb", "Verbose mode"); ACPI_OPTION ("-y", "Suppress file overwrite prompts"); } @@ -321,7 +325,7 @@ main ( ACPI_DEBUG_INITIALIZE (); /* For debug version only */ - printf (ACPI_COMMON_SIGNON ("ACPI Source Code Conversion Utility")); + printf (ACPI_COMMON_SIGNON (AS_UTILITY_NAME)); if (argc < 2) { @@ -331,7 +335,7 @@ main ( /* Command line options */ - while ((j = AcpiGetopt (argc, argv, "cdhlqsuvy")) != EOF) switch(j) + while ((j = AcpiGetopt (argc, argv, AS_SUPPORTED_OPTIONS)) != EOF) switch(j) { case 'l': @@ -376,9 +380,25 @@ main ( case 'v': - /* Verbose mode */ + switch (AcpiGbl_Optarg[0]) + { + case '^': /* -v: (Version): signon already emitted, just exit */ + + exit (0); + + case 'b': + + /* Verbose mode */ + + Gbl_VerboseMode = TRUE; + break; + + default: + + printf ("Unknown option: -v%s\n", AcpiGbl_Optarg); + return (-1); + } - Gbl_VerboseMode = TRUE; break; case 'y': diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c index 18317ffe3665..d38252301ec7 100644 --- a/source/tools/acpisrc/astable.c +++ b/source/tools/acpisrc/astable.c @@ -383,6 +383,8 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_RSDUMP_INFO", SRC_TYPE_STRUCT}, {"ACPI_RW_LOCK", SRC_TYPE_STRUCT}, {"ACPI_S3PT_HEADER", SRC_TYPE_STRUCT}, + {"ACPI_SCI_HANDLER", SRC_TYPE_SIMPLE}, + {"ACPI_SCI_HANDLER_INFO", SRC_TYPE_STRUCT}, {"ACPI_SCOPE_STATE", SRC_TYPE_STRUCT}, {"ACPI_SEMAPHORE", SRC_TYPE_SIMPLE}, {"ACPI_SIGNAL_FATAL_INFO", SRC_TYPE_STRUCT}, diff --git a/source/tools/acpixtract/axmain.c b/source/tools/acpixtract/axmain.c index b0cadfc78e78..bfc27bb5a622 100644 --- a/source/tools/acpixtract/axmain.c +++ b/source/tools/acpixtract/axmain.c @@ -74,6 +74,9 @@ static int AxAction = AX_EXTRACT_AML_TABLES; /* DSDT & SSDTs */ #define AX_OPTIONAL_TABLES 0 #define AX_REQUIRED_TABLE 1 +#define AX_UTILITY_NAME "ACPI Binary Table Extraction Utility" +#define AX_SUPPORTED_OPTIONS "ahls:v" + /****************************************************************************** * @@ -93,6 +96,7 @@ DisplayUsage ( ACPI_OPTION ("-a", "Extract all tables, not just DSDT/SSDT"); ACPI_OPTION ("-l", "List table summaries, do not extract"); ACPI_OPTION ("-s <signature>", "Extract all tables with <signature>"); + ACPI_OPTION ("-v", "Display version information"); printf ("\nExtract binary ACPI tables from text acpidump output\n"); printf ("Default invocation extracts the DSDT and all SSDTs\n"); @@ -118,7 +122,7 @@ main ( ACPI_DEBUG_INITIALIZE (); /* For debug version only */ - printf (ACPI_COMMON_SIGNON ("ACPI Binary Table Extraction Utility")); + printf (ACPI_COMMON_SIGNON (AX_UTILITY_NAME)); if (argc < 2) { @@ -128,7 +132,7 @@ main ( /* Command line options */ - while ((j = AcpiGetopt (argc, argv, "ahls:")) != EOF) switch (j) + while ((j = AcpiGetopt (argc, argv, AX_SUPPORTED_OPTIONS)) != EOF) switch (j) { case 'a': @@ -145,6 +149,10 @@ main ( AxAction = AX_EXTRACT_SIGNATURE; /* Extract only tables with this sig */ break; + case 'v': /* -v: (Version): signon already emitted, just exit */ + + return (0); + case 'h': default: |
