summaryrefslogtreecommitdiffstats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/Makefile4
-rw-r--r--compiler/aslcompiler.h7
-rw-r--r--compiler/aslglobal.h2
-rw-r--r--compiler/aslmain.c41
-rw-r--r--compiler/aslstartup.c5
5 files changed, 47 insertions, 12 deletions
diff --git a/compiler/Makefile b/compiler/Makefile
index 962ab67..f1f175c 100644
--- a/compiler/Makefile
+++ b/compiler/Makefile
@@ -7,7 +7,7 @@ PROG= iasl
ACPICA_SRC = ..
ASL_COMPILER = $(ACPICA_SRC)/compiler
ACPICA_COMMON = $(ACPICA_SRC)/common
-ACPICA_CORE = $(ACPICA_SRC)/components
+ACPICA_CORE = $(ACPICA_SRC)
ACPICA_TOOLS = $(ACPICA_SRC)/tools
ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
@@ -166,7 +166,7 @@ MISC = \
# Root rule
#
$(PROG) : $(INTERMEDIATES) $(OBJS)
- $(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
+ $(CC) $(OBJS) $(LDFLAGS) -o $(PROG)
$(COPYPROG)
diff --git a/compiler/aslcompiler.h b/compiler/aslcompiler.h
index ee4f5cc..c097fee 100644
--- a/compiler/aslcompiler.h
+++ b/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/compiler/aslglobal.h b/compiler/aslglobal.h
index 3f600d8..3c59044 100644
--- a/compiler/aslglobal.h
+++ b/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/compiler/aslmain.c b/compiler/aslmain.c
index e7f1ca1..39ea7aa 100644
--- a/compiler/aslmain.c
+++ b/compiler/aslmain.c
@@ -119,6 +119,7 @@
#include "aslcompiler.h"
#include "acapps.h"
+#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/compiler/aslstartup.c b/compiler/aslstartup.c
index 32c6ae4..11c4004 100644
--- a/compiler/aslstartup.c
+++ b/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);
OpenPOWER on IntegriCloud