mirror of
https://github.com/acpica/acpica/
synced 2025-02-23 17:04:21 +03:00
Merge pull request #494 from SchmErik/dt-asl-compile
multiple data table and ASL file compilation
This commit is contained in:
commit
512cae4b39
@ -147,6 +147,14 @@ ACPICA_HEADERS = \
|
||||
#
|
||||
OPT_CFLAGS ?= $(CWARNINGFLAGS)
|
||||
|
||||
#
|
||||
# Debug flags
|
||||
#
|
||||
ifeq ($(DEBUG),TRUE)
|
||||
CFLAGS +=-g
|
||||
LDFLAGS +=-g
|
||||
endif
|
||||
|
||||
#
|
||||
# Common compiler flags
|
||||
# The _GNU_SOURCE symbol is required for many hosts.
|
||||
|
@ -289,9 +289,10 @@ main (
|
||||
|
||||
/*
|
||||
* At this point, compilation of a data table or disassembly is complete.
|
||||
* However, if there is a parse tree, perform compiler analysis and
|
||||
* generate AML.
|
||||
*/
|
||||
if (AslGbl_PreprocessOnly || AcpiGbl_DisasmFlag ||
|
||||
AslGbl_FileType == ASL_INPUT_TYPE_ASCII_DATA)
|
||||
if (AslGbl_PreprocessOnly || AcpiGbl_DisasmFlag || !AslGbl_ParseTreeRoot)
|
||||
{
|
||||
goto CleanupAndExit;
|
||||
}
|
||||
|
@ -467,6 +467,7 @@ AslDoOneFile (
|
||||
/* Determine input file type */
|
||||
|
||||
AslGbl_FileType = AslDetectSourceFileType (&AslGbl_Files[ASL_FILE_INPUT]);
|
||||
FileNode->FileType = AslGbl_FileType;
|
||||
if (AslGbl_FileType == ASL_INPUT_TYPE_BINARY)
|
||||
{
|
||||
return (AE_ERROR);
|
||||
|
@ -510,6 +510,7 @@ typedef struct asl_files_node
|
||||
UINT32 TotalNamedObjects;
|
||||
UINT32 TotalExecutableOpcodes;
|
||||
BOOLEAN ParserErrorDetected;
|
||||
UINT8 FileType;
|
||||
|
||||
} ASL_GLOBAL_FILE_NODE;
|
||||
|
||||
|
@ -579,20 +579,21 @@ UtDisplayOneSummary (
|
||||
"%-14s %s - Compilation aborted due to parser-detected syntax error(s)\n",
|
||||
"Input file:", AslGbl_Files[ASL_FILE_INPUT].Filename);
|
||||
}
|
||||
else if (AslGbl_FileType == ASL_INPUT_TYPE_ASCII_DATA)
|
||||
else if (FileNode->FileType == ASL_INPUT_TYPE_ASCII_DATA)
|
||||
{
|
||||
FlPrintFile (FileId,
|
||||
"%-14s %s - %u lines, %u bytes, %u fields\n",
|
||||
"%-14s %s - %7u bytes %6u fields %8u source lines\n",
|
||||
"Table Input:",
|
||||
AslGbl_Files[ASL_FILE_INPUT].Filename, FileNode->TotalLineCount,
|
||||
FileNode->OriginalInputFileSize, FileNode->TotalFields);
|
||||
AslGbl_Files[ASL_FILE_INPUT].Filename,
|
||||
FileNode->OriginalInputFileSize, FileNode->TotalFields,
|
||||
FileNode->TotalLineCount);
|
||||
|
||||
FlPrintFile (FileId,
|
||||
"%-14s %s - %u bytes\n",
|
||||
"%-14s %s - %7u bytes\n",
|
||||
"Binary Output:",
|
||||
AslGbl_Files[ASL_FILE_AML_OUTPUT].Filename, FileNode->OutputByteLength);
|
||||
}
|
||||
else if (AslGbl_FileType == ASL_INPUT_TYPE_ASCII_ASL)
|
||||
else if (FileNode->FileType == ASL_INPUT_TYPE_ASCII_ASL)
|
||||
{
|
||||
FlPrintFile (FileId,
|
||||
"%-14s %s - %7u bytes %6u keywords %6u source lines\n",
|
||||
|
@ -161,7 +161,7 @@ static char VersionString[9];
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
void
|
||||
DtInitialize (
|
||||
void);
|
||||
|
||||
@ -201,12 +201,7 @@ DtDoCompile (
|
||||
|
||||
/* Initialize globals */
|
||||
|
||||
Status = DtInitialize ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
printf ("Error during compiler initialization, 0x%X\n", Status);
|
||||
return (Status);
|
||||
}
|
||||
DtInitialize ();
|
||||
|
||||
/* Preprocessor */
|
||||
|
||||
@ -331,25 +326,12 @@ DtDoCompile (
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
void
|
||||
DtInitialize (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
Status = AcpiOsInitialize ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = AcpiUtInitGlobals ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
AcpiUtSetIntegerWidth (2); /* Set width to 64 bits */
|
||||
|
||||
AslGbl_FieldList = NULL;
|
||||
@ -357,7 +339,7 @@ DtInitialize (
|
||||
AslGbl_SubtableStack = NULL;
|
||||
|
||||
sprintf (VersionString, "%X", (UINT32) ACPI_CA_VERSION);
|
||||
return (AE_OK);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user