9,7 → 9,7 |
* |
* 1. Copyright Notice |
* |
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
* All rights reserved. |
* |
* 2. License |
119,6 → 119,7 |
|
#include "aslcompiler.h" |
#include "acapps.h" |
#include "acdisasm.h" |
|
#ifdef _DEBUG |
#include <crtdbg.h> |
167,7 → 168,7 |
|
|
#define ASL_TOKEN_SEPARATORS " \t\n" |
#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^no:p:r:s:t:v:w:x:yz" |
#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^no:p:r:s:t:T:v:w:x:z" |
|
|
/******************************************************************************* |
213,13 → 214,18 |
printf (" -cr Disable Resource Descriptor error checking\n"); |
printf (" -r<Revision> Override table header Revision (1-255)\n"); |
|
printf ("\nListings:\n"); |
printf ("\nASL Listing Files:\n"); |
printf (" -l Create mixed listing file (ASL source and AML) (*.lst)\n"); |
printf (" -ln Create namespace file (*.nsp)\n"); |
printf (" -ls Create combined source file (expanded includes) (*.src)\n"); |
|
printf ("\nACPI Data Tables:\n"); |
printf (" -T <Sig>|ALL|* Create table template file(s) for <Sig>\n"); |
printf (" -vt Create verbose templates (full disassembly)\n"); |
|
printf ("\nAML Disassembler:\n"); |
printf (" -d [file] Disassemble or decode binary ACPI table to file (*.dsl)\n"); |
printf (" -da [f1,f2] Disassemble multiple tables from single namespace\n"); |
printf (" -dc [file] Disassemble AML and immediately compile it\n"); |
printf (" (Obtain DSDT from current system if no input file)\n"); |
printf (" -e [f1,f2] Include ACPI table(s) for external symbol resolution\n"); |
230,6 → 236,7 |
printf (" -h Additional help and compiler debug options\n"); |
printf (" -hc Display operators allowed in constant expressions\n"); |
printf (" -hr Display ACPI reserved method names\n"); |
printf (" -ht Display currently supported ACPI table names\n"); |
} |
|
|
268,7 → 275,6 |
printf (" -n Parse only, no output generation\n"); |
printf (" -ot Display compile times\n"); |
printf (" -x<level> Set debug level for trace output\n"); |
printf (" -y Temporary: Enable data table compiler\n"); |
printf (" -z Do not insert new compiler ID for DataTables\n"); |
} |
|
290,7 → 296,8 |
void) |
{ |
|
printf ("Usage: %s [Options] [Files]\n\n", CompilerName); |
printf ("%s\n", ASL_COMPLIANCE); |
printf ("Usage: %s [Options] [Files]\n\n", ASL_INVOCATION_NAME); |
Options (); |
} |
|
456,6 → 463,7 |
BOOLEAN IsResponseFile) |
{ |
int j; |
ACPI_STATUS Status; |
|
|
/* Get the command line options */ |
489,10 → 497,12 |
{ |
case 'b': |
AslCompilerdebug = 1; /* same as yydebug */ |
DtParserdebug = 1; |
break; |
|
case 'p': |
AslCompilerdebug = 1; /* same as yydebug */ |
DtParserdebug = 1; |
break; |
|
case 't': |
530,6 → 540,11 |
Gbl_DoCompile = FALSE; |
break; |
|
case 'a': |
Gbl_DoCompile = FALSE; |
Gbl_DisassembleAll = TRUE; |
break; |
|
case 'c': |
break; |
|
543,7 → 558,12 |
|
|
case 'e': |
Gbl_ExternalFilename = AcpiGbl_Optarg; |
Status = AcpiDmAddToExternalFileList (AcpiGbl_Optarg); |
if (ACPI_FAILURE (Status)) |
{ |
printf ("Could not add %s to external list\n", AcpiGbl_Optarg); |
return (-1); |
} |
break; |
|
|
582,11 → 602,14 |
ApDisplayReservedNames (); |
exit (0); |
|
case 't': |
UtDisplaySupportedTables (); |
exit (0); |
|
default: |
printf ("Unknown option: -h%s\n", AcpiGbl_Optarg); |
return (-1); |
} |
break; |
|
|
case 'I': /* Add an include file search directory */ |
769,6 → 792,12 |
break; |
|
|
case 'T': |
Gbl_DoTemplates = TRUE; |
Gbl_TemplateSignature = AcpiGbl_Optarg; |
break; |
|
|
case 'v': |
|
switch (AcpiGbl_Optarg[0]) |
797,6 → 826,10 |
Gbl_DoSignon = FALSE; |
break; |
|
case 't': |
Gbl_VerboseTemplates = TRUE; |
break; |
|
default: |
printf ("Unknown option: -v%s\n", AcpiGbl_Optarg); |
return (-1); |
833,12 → 866,6 |
break; |
|
|
case 'y': |
|
Gbl_DataTableCompilerAvailable = TRUE; |
break; |
|
|
case 'z': |
|
Gbl_UseOriginalCompilerId = TRUE; |
872,6 → 899,7 |
char **argv) |
{ |
int BadCommandLine = 0; |
ACPI_STATUS Status; |
|
|
/* Minimum command line contains at least the command and an input file */ |
878,7 → 906,7 |
|
if (argc < 2) |
{ |
AslCompilerSignon (ASL_FILE_STDOUT); |
printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME)); |
Usage (); |
exit (1); |
} |
887,6 → 915,16 |
|
BadCommandLine = AslDoOptions (argc, argv, FALSE); |
|
if (Gbl_DoTemplates) |
{ |
Status = DtCreateTemplates (Gbl_TemplateSignature); |
if (ACPI_FAILURE (Status)) |
{ |
exit (-1); |
} |
exit (1); |
} |
|
/* Next parameter must be the input filename */ |
|
if (!argv[AcpiGbl_Optind] && |
899,7 → 937,7 |
|
if (Gbl_DoSignon) |
{ |
AslCompilerSignon (ASL_FILE_STDOUT); |
printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME)); |
} |
|
/* Abort if anything went wrong on the command line */ |
934,9 → 972,12 |
char **argv) |
{ |
ACPI_STATUS Status; |
int Index; |
int Index1; |
int Index2; |
|
|
AcpiGbl_ExternalFileList = NULL; |
|
#ifdef _DEBUG |
_CrtSetDbgFlag (_CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_LEAK_CHECK_DF | |
_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)); |
945,7 → 986,7 |
/* Init and command line */ |
|
AslInitialize (); |
Index = AslCommandLine (argc, argv); |
Index1 = Index2 = AslCommandLine (argc, argv); |
|
/* Options that have no additional parameters or pathnames */ |
|
959,19 → 1000,38 |
return (0); |
} |
|
if (Gbl_DisassembleAll) |
{ |
while (argv[Index1]) |
{ |
Status = AslDoOnePathname (argv[Index1], AcpiDmAddToExternalFileList); |
if (ACPI_FAILURE (Status)) |
{ |
return (-1); |
} |
|
Index1++; |
} |
} |
|
/* Process each pathname/filename in the list, with possible wildcards */ |
|
while (argv[Index]) |
while (argv[Index2]) |
{ |
Status = AslDoOnePathname (argv[Index]); |
Status = AslDoOnePathname (argv[Index2], AslDoOneFile); |
if (ACPI_FAILURE (Status)) |
{ |
return (-1); |
} |
|
Index++; |
Index2++; |
} |
|
if (AcpiGbl_ExternalFileList) |
{ |
AcpiDmClearExternalFileList(); |
} |
|
return (0); |
} |
|