Even more option fussing

date	2002.08.14.15.50.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 16:03:45 +00:00
parent be83e3bf3e
commit 2810a90c5c

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: aslmain - compiler main and utilities
* $Revision: 1.63 $
* $Revision: 1.65 $
*
*****************************************************************************/
@ -133,8 +133,6 @@ BOOLEAN AslToFile = TRUE;
BOOLEAN DoCompile = TRUE;
BOOLEAN DoSignon = TRUE;
UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0};
char hex[] = {'0','1','2','3','4','5','6','7',
'8','9','A','B','C','D','E','F'};
@ -157,9 +155,10 @@ Options (
{
printf ("General Output:\n");
printf (" -o<prefix> Specify filename prefix for all output files (including .aml)\n");
printf (" -p <prefix> Specify filename prefix for all output files (including .aml)\n");
printf (" -vi Less verbose errors and warnings for use with IDEs\n");
printf (" -vr Disable generation of remarks\n");
printf (" -vo Enable optimization comments\n");
printf (" -vr Disable remarks\n");
printf (" -vs Disable signon\n");
printf ("\nAML Output:\n");
@ -167,9 +166,10 @@ Options (
printf (" -t<a|c> Create AML in assembler or C hex table (*.hex)\n");
printf ("\nAML Optimization:\n");
printf (" -cf Disable constant folding\n");
printf (" -ci Disable integer optimization to Zero/One/Ones\n");
printf (" -cn Disable named reference string optimization\n");
printf (" -oa Disable all optimizations (compatibility mode)\n");
printf (" -of Disable constant folding\n");
printf (" -oi Disable integer optimization to Zero/One/Ones\n");
printf (" -on Disable named reference string optimization\n");
printf ("\nListings:\n");
printf (" -l Create mixed listing file (ASL source and AML) (*.lst)\n");
@ -177,8 +177,8 @@ Options (
printf (" -ls Create combined source file (expanded includes) (*.src)\n");
printf ("\nAML Disassembler:\n");
printf (" -d <file> Disassemble AML to ASL source code file (*.dsl)\n");
printf (" -dc <file> Disassemble AML (to *.dsl) and compile it\n");
printf (" -d [file] Disassemble AML to ASL source code file (*.dsl)\n");
printf (" -dc [file] Disassemble AML and immediately compile it\n");
printf (" (Obtain AML from current system if no input file)\n");
printf ("\nHelp:\n");
@ -209,7 +209,7 @@ HelpMessage (
printf (" Output filenames are generated by appending an extension to a common\n");
printf (" filename prefix. The filename prefix is obtained via one of the\n");
printf (" following methods (in priority order):\n");
printf (" 1) The -o option specifies the prefix\n");
printf (" 1) The -p option specifies the prefix\n");
printf (" 2) The prefix of the AMLFileName in the ASL Definition Block\n");
printf (" 3) The prefix of the input filename\n");
printf ("\n");
@ -220,8 +220,8 @@ HelpMessage (
printf (" -b<p|t|b> Create compiler debug/trace file (*.txt)\n");
printf (" Types: Parse/Tree/Both\n");
printf (" -i Ignore errors, always create AML output file(s)\n");
printf (" -p Parse only, no output generation\n");
printf (" -ct Display compile times\n");
printf (" -g Parse only, no output generation\n");
printf (" -ot Display compile times\n");
printf (" -x<level> Set debug level for trace output\n");
}
@ -311,13 +311,14 @@ AslCommandLine (
if (argc < 2)
{
AslCompilerSignon (ASL_FILE_STDOUT);
Usage ();
exit (1);
}
/* Get the command line options */
while ((j = AcpiGetopt (argc, argv, "b:c:d^h^il^o:prs:t:v:x:")) != EOF) switch (j)
while ((j = AcpiGetopt (argc, argv, "b:d^gh^il^o:p:rs:t:v:x:")) != EOF) switch (j)
{
case 'b':
@ -346,46 +347,6 @@ AslCommandLine (
break;
case 'c':
switch (AcpiGbl_Optarg[0])
{
case 'f':
/* Disable folding on "normal" expressions */
Gbl_FoldConstants = FALSE;
break;
case 'i':
/* Disable integer optimization to constants */
Gbl_IntegerOptimizationFlag = FALSE;
break;
case 'n':
/* Disable named reference optimization */
Gbl_ReferenceOptimizationFlag = FALSE;
break;
case 't':
/* Display compile time(s) */
Gbl_CompileTimesFlag = TRUE;
break;
default:
printf ("Unknown option: -c%s\n", AcpiGbl_Optarg);
BadCommandLine = TRUE;
break;
}
break;
case 'd':
switch (AcpiGbl_Optarg[0])
{
@ -406,6 +367,14 @@ AslCommandLine (
break;
case 'g':
/* Parse only */
Gbl_ParseOnlyFlag = TRUE;
break;
case 'h':
switch (AcpiGbl_Optarg[0])
@ -472,18 +441,59 @@ AslCommandLine (
case 'o':
/* Override default AML output filename */
switch (AcpiGbl_Optarg[0])
{
case 'a':
Gbl_OutputFilenamePrefix = AcpiGbl_Optarg;
Gbl_UseDefaultAmlFilename = FALSE;
/* Disable all optimizations */
Gbl_FoldConstants = FALSE;
Gbl_IntegerOptimizationFlag = FALSE;
Gbl_ReferenceOptimizationFlag = FALSE;
break;
case 'f':
/* Disable folding on "normal" expressions */
Gbl_FoldConstants = FALSE;
break;
case 'i':
/* Disable integer optimization to constants */
Gbl_IntegerOptimizationFlag = FALSE;
break;
case 'n':
/* Disable named reference optimization */
Gbl_ReferenceOptimizationFlag = FALSE;
break;
case 't':
/* Display compile time(s) */
Gbl_CompileTimesFlag = TRUE;
break;
default:
printf ("Unknown option: -c%s\n", AcpiGbl_Optarg);
BadCommandLine = TRUE;
break;
}
break;
case 'p':
/* Parse only */
/* Override default AML output filename */
Gbl_ParseOnlyFlag = TRUE;
Gbl_OutputFilenamePrefix = AcpiGbl_Optarg;
Gbl_UseDefaultAmlFilename = FALSE;
break;
@ -550,6 +560,10 @@ AslCommandLine (
Gbl_VerboseErrors = FALSE;
break;
case 'o':
Gbl_DisplayOptimizations = TRUE;
break;
case 'r':
Gbl_DisplayRemarks = FALSE;
break;
@ -587,6 +601,11 @@ AslCommandLine (
BadCommandLine = TRUE;
}
if (DoSignon)
{
AslCompilerSignon (ASL_FILE_STDOUT);
}
/* Abort if anything went wrong on the command line */
if (BadCommandLine)
@ -629,13 +648,9 @@ main (
AslInitialize ();
AslCommandLine (argc, argv);
if (DoSignon)
{
AslCompilerSignon (ASL_FILE_STDOUT);
}
/*
* If -o not specified, we will use the input filename as the
* If -p not specified, we will use the input filename as the
* output filename prefix
*/
if (Gbl_UseDefaultAmlFilename)
@ -688,7 +703,7 @@ main (
if (DoCompile)
{
/*
* If -o not specified, we will use the input filename as the
* If -p not specified, we will use the input filename as the
* output filename prefix
*/
if (Gbl_UseDefaultAmlFilename)
@ -696,7 +711,7 @@ main (
Gbl_OutputFilenamePrefix = Gbl_Files[ASL_FILE_INPUT].Filename;
}
/* ACPI CA subsystem initialization (Must be Re-initialized) */
/* ACPI CA subsystem initialization (Must be re-initialized) */
AcpiUtInitGlobals ();
Status = AcpiUtMutexInitialize ();