diff options
author | jkim <jkim@FreeBSD.org> | 2010-08-06 23:11:19 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2010-08-06 23:11:19 +0000 |
commit | 68285361e2b84f72f44b4146a32b9766dd28f986 (patch) | |
tree | f23a6c8653185991db3060ec1e51cb28fba3d4c0 /sys/contrib/dev/acpica/compiler | |
parent | 94aa0856b20dcf5a4113d4857128a63927c65c49 (diff) | |
parent | 7246513d8afc4166ea14544296293fcb8df78649 (diff) | |
download | FreeBSD-src-68285361e2b84f72f44b4146a32b9766dd28f986.zip FreeBSD-src-68285361e2b84f72f44b4146a32b9766dd28f986.tar.gz |
Merge ACPICA 20100806.
Diffstat (limited to 'sys/contrib/dev/acpica/compiler')
-rw-r--r-- | sys/contrib/dev/acpica/compiler/aslcompiler.h | 7 | ||||
-rw-r--r-- | sys/contrib/dev/acpica/compiler/aslglobal.h | 2 | ||||
-rw-r--r-- | sys/contrib/dev/acpica/compiler/aslmain.c | 41 | ||||
-rw-r--r-- | sys/contrib/dev/acpica/compiler/aslstartup.c | 5 |
4 files changed, 45 insertions, 10 deletions
diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.h b/sys/contrib/dev/acpica/compiler/aslcompiler.h index 1d0667a..91ea273 100644 --- a/sys/contrib/dev/acpica/compiler/aslcompiler.h +++ b/sys/contrib/dev/acpica/compiler/aslcompiler.h @@ -195,9 +195,14 @@ void AslInitializeGlobals ( void); +typedef +ACPI_STATUS (*ASL_PATHNAME_CALLBACK) ( + char *); + ACPI_STATUS AslDoOnePathname ( - char *Pathname); + char *Pathname, + ASL_PATHNAME_CALLBACK Callback); ACPI_STATUS AslDoOneFile ( diff --git a/sys/contrib/dev/acpica/compiler/aslglobal.h b/sys/contrib/dev/acpica/compiler/aslglobal.h index 3f600d8..3c59044 100644 --- a/sys/contrib/dev/acpica/compiler/aslglobal.h +++ b/sys/contrib/dev/acpica/compiler/aslglobal.h @@ -171,6 +171,7 @@ ASL_EXTERN ASL_ERROR_MSG ASL_INIT_GLOBAL (*Gbl_NextError,NULL); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoCompile, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoSignon, TRUE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisassembleAll, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_Acpi2, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, TRUE); @@ -214,7 +215,6 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HexOutputFlag, HEX_OUTP ASL_EXTERN ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES]; ASL_EXTERN char *Gbl_DirectoryPath; -ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_ExternalFilename, NULL); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_IncludeFilename, NULL); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_OutputFilenamePrefix, NULL); ASL_EXTERN ASL_INCLUDE_DIR ASL_INIT_GLOBAL (*Gbl_IncludeDirList, NULL); diff --git a/sys/contrib/dev/acpica/compiler/aslmain.c b/sys/contrib/dev/acpica/compiler/aslmain.c index 4584574..662742f 100644 --- a/sys/contrib/dev/acpica/compiler/aslmain.c +++ b/sys/contrib/dev/acpica/compiler/aslmain.c @@ -119,6 +119,7 @@ #include <contrib/dev/acpica/compiler/aslcompiler.h> #include <contrib/dev/acpica/include/acapps.h> +#include <contrib/dev/acpica/include/acdisasm.h> #ifdef _DEBUG #include <crtdbg.h> @@ -224,6 +225,7 @@ Options ( 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"); @@ -534,6 +536,11 @@ AslDoOptions ( Gbl_DoCompile = FALSE; break; + case 'a': + Gbl_DoCompile = FALSE; + Gbl_DisassembleAll = TRUE; + break; + case 'c': break; @@ -547,7 +554,7 @@ AslDoOptions ( case 'e': - Gbl_ExternalFilename = AcpiGbl_Optarg; + AcpiDmAddToExternalFileList (AcpiGbl_Optarg); break; @@ -952,9 +959,12 @@ main ( 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)); @@ -963,7 +973,7 @@ main ( /* Init and command line */ AslInitialize (); - Index = AslCommandLine (argc, argv); + Index1 = Index2 = AslCommandLine (argc, argv); /* Options that have no additional parameters or pathnames */ @@ -977,17 +987,36 @@ main ( 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); diff --git a/sys/contrib/dev/acpica/compiler/aslstartup.c b/sys/contrib/dev/acpica/compiler/aslstartup.c index 746878c..14b362c 100644 --- a/sys/contrib/dev/acpica/compiler/aslstartup.c +++ b/sys/contrib/dev/acpica/compiler/aslstartup.c @@ -529,7 +529,8 @@ AslDoOneFile ( ACPI_STATUS AslDoOnePathname ( - char *Pathname) + char *Pathname, + ASL_PATHNAME_CALLBACK PathCallback) { ACPI_STATUS Status = AE_OK; char **FileList; @@ -569,7 +570,7 @@ AslDoOnePathname ( /* Save status from all compiles */ - Status |= AslDoOneFile (FullPathname); + Status |= (*PathCallback) (FullPathname); ACPI_FREE (FullPathname); ACPI_FREE (*FileList); |