Skip to content

Commit

Permalink
Tools: Deploy -vd option (build date/time) across all tools
Browse files Browse the repository at this point in the history
Common option for all tools.
  • Loading branch information
acpibob committed Sep 8, 2017
1 parent b7a80ea commit 3361316
Show file tree
Hide file tree
Showing 11 changed files with 113 additions and 24 deletions.
1 change: 1 addition & 0 deletions source/compiler/aslhelp.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ void
Usage (
void)
{
printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
printf ("%s\n\n", ASL_COMPLIANCE);
ACPI_USAGE_HEADER ("iasl [Options] [Files]");

Expand Down
9 changes: 2 additions & 7 deletions source/compiler/asloptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ AslDoResponseFile (
#define ASL_TOKEN_SEPARATORS " \t\n"
#define ASL_SUPPORTED_OPTIONS "@:a:b|c|d^D:e:f^gh^i|I:l^m:no|p:P^q^r:s|t|T+G^v^w|x:z"

static char ASL_BUILD_DATE[] = __DATE__;
static char ASL_BUILD_TIME[] = __TIME__;


/*******************************************************************************
*
Expand All @@ -207,7 +204,6 @@ AslCommandLine (

if (argc < 2)
{
printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
Usage ();
exit (1);
}
Expand Down Expand Up @@ -541,7 +537,6 @@ AslDoOptions (
{
case '^':

printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
Usage ();
exit (0);

Expand Down Expand Up @@ -891,8 +886,8 @@ AslDoOptions (

case 'd':

printf ("%s Build date/time: %s %s\n",
ASL_COMPILER_NAME, ASL_BUILD_DATE, ASL_BUILD_TIME);
printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
printf (ACPI_COMMON_BUILD_TIME);
exit (0);

case 'e':
Expand Down
3 changes: 3 additions & 0 deletions source/include/acapps.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@
Prefix, ACPICA_COPYRIGHT, \
Prefix

#define ACPI_COMMON_BUILD_TIME \
"Build date/time: %s %s\n", __DATE__, __TIME__

/* Macros for usage messages */

#define ACPI_USAGE_HEADER(Usage) \
Expand Down
21 changes: 19 additions & 2 deletions source/tools/acpibin/abmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ AbDisplayUsage (


#define AB_UTILITY_NAME "ACPI Binary Table Dump Utility"
#define AB_SUPPORTED_OPTIONS "a:c:d:h:o:s:tv"
#define AB_SUPPORTED_OPTIONS "a:c:d:h:o:s:tv^"


/******************************************************************************
Expand Down Expand Up @@ -192,6 +192,7 @@ AbDisplayUsage (
ACPI_OPTION ("-s <File>", "Update checksum for binary AML file");
ACPI_OPTION ("-t", "Terse mode");
ACPI_OPTION ("-v", "Display version information");
ACPI_OPTION ("-vd", "Display build date and time");
}


Expand Down Expand Up @@ -292,7 +293,23 @@ main (

case 'v': /* -v: (Version): signon already emitted, just exit */

return (0);
switch (AcpiGbl_Optarg[0])
{
case '^': /* -v: (Version): signon already emitted, just exit */

return (1);

case 'd':

printf (ACPI_COMMON_BUILD_TIME);
return (1);

default:

printf ("Unknown option: -v%s\n", AcpiGbl_Optarg);
return (-1);
}
break;

default:

Expand Down
26 changes: 22 additions & 4 deletions source/tools/acpidump/apmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ UINT32 CurrentAction = 0;


#define AP_UTILITY_NAME "ACPI Binary Table Dump Utility"
#define AP_SUPPORTED_OPTIONS "?a:bc:f:hn:o:r:svxz"
#define AP_SUPPORTED_OPTIONS "?a:bc:f:hn:o:r:sv^xz"


/******************************************************************************
Expand All @@ -223,6 +223,7 @@ ApDisplayUsage (
ACPI_OPTION ("-r <Address>", "Dump tables from specified RSDP");
ACPI_OPTION ("-s", "Print table summaries only");
ACPI_OPTION ("-v", "Display version information");
ACPI_OPTION ("-vd", "Display build date and time");
ACPI_OPTION ("-z", "Verbose mode");

ACPI_USAGE_TEXT ("\nTable Options:\n");
Expand Down Expand Up @@ -369,10 +370,27 @@ ApDoOptions (
}
continue;

case 'v': /* Revision/version */
case 'v': /* -v: (Version): signon already emitted, just exit */

AcpiOsPrintf (ACPI_COMMON_SIGNON (AP_UTILITY_NAME));
return (1);
switch (AcpiGbl_Optarg[0])
{
case '^': /* -v: (Version) */

fprintf (stderr, ACPI_COMMON_SIGNON (AP_UTILITY_NAME));
return (1);

case 'd':

fprintf (stderr, ACPI_COMMON_SIGNON (AP_UTILITY_NAME));
printf (ACPI_COMMON_BUILD_TIME);
return (1);

default:

printf ("Unknown option: -v%s\n", AcpiGbl_Optarg);
return (-1);
}
break;

case 'z': /* Verbose mode */

Expand Down
4 changes: 1 addition & 3 deletions source/tools/acpiexec/aemain.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ 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^ghlm^rt^v^:x:"
Expand Down Expand Up @@ -540,7 +538,7 @@ AeDoOptions (

case 'd':

printf ("Build date/time: %s %s\n", AeBuildDate, AeBuildTime);
printf (ACPI_COMMON_BUILD_TIME);
return (1);

case 'i':
Expand Down
21 changes: 19 additions & 2 deletions source/tools/acpihelp/ahmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ AhDisplayUsage (
void);

#define AH_UTILITY_NAME "ACPI Help Utility"
#define AH_SUPPORTED_OPTIONS "adeghikmopstuv"
#define AH_SUPPORTED_OPTIONS "adeghikmopstuv^"


#if defined ACPI_OPTION
Expand All @@ -187,6 +187,7 @@ AhDisplayUsage (
ACPI_USAGE_HEADER ("acpihelp <options> [Name/Prefix | HexValue]");
ACPI_OPTION ("-h", "Display help");
ACPI_OPTION ("-v", "Display version information");
ACPI_OPTION ("-vd", "Display build date and time");

ACPI_USAGE_TEXT ("\nAML Names and Encodings (ACPI Machine Language):\n");
ACPI_OPTION ("-a [Name/Prefix | *]", "Display both ASL operator and AML opcode name(s)");
Expand Down Expand Up @@ -310,7 +311,23 @@ main (

case 'v': /* -v: (Version): signon already emitted, just exit */

return (0);
switch (AcpiGbl_Optarg[0])
{
case '^': /* -v: (Version) */

return (1);

case 'd':

printf (ACPI_COMMON_BUILD_TIME);
return (1);

default:

printf ("Unknown option: -v%s\n", AcpiGbl_Optarg);
return (-1);
}
break;

case 'h':
default:
Expand Down
23 changes: 20 additions & 3 deletions source/tools/acpinames/anmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ BOOLEAN AcpiGbl_NsLoadOnly = FALSE;


#define AN_UTILITY_NAME "ACPI Namespace Dump Utility"
#define AN_SUPPORTED_OPTIONS "?hlvx:"
#define AN_SUPPORTED_OPTIONS "?hlv^x:"


/******************************************************************************
Expand All @@ -203,6 +203,7 @@ usage (
ACPI_OPTION ("-?", "Display this message");
ACPI_OPTION ("-l", "Load namespace only, no display");
ACPI_OPTION ("-v", "Display version information");
ACPI_OPTION ("-vd", "Display build date and time");
ACPI_OPTION ("-x <DebugLevel>", "Debug output level");
}

Expand Down Expand Up @@ -259,9 +260,25 @@ main (
AcpiGbl_NsLoadOnly = TRUE;
break;

case 'v': /* -v: (Version): signon already emitted, just exit */
case 'v':

return (0);
switch (AcpiGbl_Optarg[0])
{
case '^': /* -v: (Version): signon already emitted, just exit */

exit (0);

case 'd':

printf (ACPI_COMMON_BUILD_TIME);
return (0);

default:

printf ("Unknown option: -v%s\n", AcpiGbl_Optarg);
return (-1);
}
break;

case 'x':

Expand Down
6 changes: 6 additions & 0 deletions source/tools/acpisrc/asmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ AsDisplayUsage (
ACPI_OPTION ("-s", "Generate source statistics only");
ACPI_OPTION ("-v", "Display version information");
ACPI_OPTION ("-vb", "Verbose mode");
ACPI_OPTION ("-vd", "Display build date and time");
ACPI_OPTION ("-y", "Suppress file overwrite prompts");
}

Expand Down Expand Up @@ -478,6 +479,11 @@ main (
Gbl_VerboseMode = TRUE;
break;

case 'd':

printf (ACPI_COMMON_BUILD_TIME);
return (0);

default:

printf ("Unknown option: -v%s\n", AcpiGbl_Optarg);
Expand Down
2 changes: 1 addition & 1 deletion source/tools/acpixtract/acpixtract.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
#define AX_REQUIRED_TABLE 1

#define AX_UTILITY_NAME "ACPI Binary Table Extraction Utility"
#define AX_SUPPORTED_OPTIONS "ahlms:v"
#define AX_SUPPORTED_OPTIONS "ahlms:v^"
#define AX_MULTI_TABLE_FILENAME "amltables.dat"
#define AX_TABLE_INFO_FORMAT "Acpi table [%4.4s] - %7u bytes written to %s\n"

Expand Down
21 changes: 19 additions & 2 deletions source/tools/acpixtract/axmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ DisplayUsage (
ACPI_OPTION ("-m", "Extract multiple DSDT/SSDTs to a single file");
ACPI_OPTION ("-s <signature>", "Extract all tables with <signature>");
ACPI_OPTION ("-v", "Display version information");
ACPI_OPTION ("-vd", "Display build date and time");

ACPI_USAGE_TEXT ("\nExtract binary ACPI tables from text acpidump output\n");
ACPI_USAGE_TEXT ("Default invocation extracts the DSDT and all SSDTs\n");
Expand Down Expand Up @@ -243,9 +244,25 @@ main (
AxAction = AX_EXTRACT_SIGNATURE; /* Extract only tables with this sig */
break;

case 'v': /* -v: (Version): signon already emitted, just exit */
case 'v':

return (0);
switch (AcpiGbl_Optarg[0])
{
case '^': /* -v: (Version): signon already emitted, just exit */

exit (0);

case 'd':

printf (ACPI_COMMON_BUILD_TIME);
return (0);

default:

printf ("Unknown option: -v%s\n", AcpiGbl_Optarg);
return (-1);
}
break;

case 'h':
default:
Expand Down

0 comments on commit 3361316

Please sign in to comment.