diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/Makefile | 4 | ||||
-rw-r--r-- | compiler/aslanalyze.c | 5 | ||||
-rw-r--r-- | compiler/aslcompile.c | 8 | ||||
-rw-r--r-- | compiler/aslcompiler.h | 4 | ||||
-rw-r--r-- | compiler/aslerror.c | 4 | ||||
-rw-r--r-- | compiler/aslfiles.c | 4 | ||||
-rw-r--r-- | compiler/asllisting.c | 4 | ||||
-rw-r--r-- | compiler/asllookup.c | 8 | ||||
-rw-r--r-- | compiler/aslmain.c | 18 | ||||
-rw-r--r-- | compiler/aslopcodes.c | 6 | ||||
-rw-r--r-- | compiler/aslpredef.c | 2 | ||||
-rw-r--r-- | compiler/aslrestype1.c | 2 | ||||
-rw-r--r-- | compiler/aslrestype2d.c | 24 | ||||
-rw-r--r-- | compiler/aslrestype2e.c | 1 | ||||
-rw-r--r-- | compiler/aslrestype2w.c | 24 | ||||
-rw-r--r-- | compiler/aslstartup.c | 30 | ||||
-rw-r--r-- | compiler/dtcompile.c | 29 | ||||
-rw-r--r-- | compiler/dtio.c | 2 |
18 files changed, 103 insertions, 76 deletions
diff --git a/compiler/Makefile b/compiler/Makefile index f1f175c50362f..3d7028200b362 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -151,6 +151,7 @@ OBJS = \ utobject.o \ utresrc.o \ utstate.o \ + utxferror.o \ utxface.o INTERMEDIATES = \ @@ -565,6 +566,9 @@ utresrc.o : $(ACPICA_CORE)/utilities/utresrc.c utstate.o : $(ACPICA_CORE)/utilities/utstate.c $(COMPILE) +utxferror.o : $(ACPICA_CORE)/utilities/utxferror.c + $(COMPILE) + utxface.o : $(ACPICA_CORE)/utilities/utxface.c $(COMPILE) diff --git a/compiler/aslanalyze.c b/compiler/aslanalyze.c index 9679d904c8cfa..4846c6b7d07b8 100644 --- a/compiler/aslanalyze.c +++ b/compiler/aslanalyze.c @@ -166,7 +166,7 @@ static UINT32 AnGetInternalMethodReturnType ( ACPI_PARSE_OBJECT *Op); -BOOLEAN +static BOOLEAN AnIsResultUsed ( ACPI_PARSE_OBJECT *Op); @@ -1754,7 +1754,7 @@ AnOperandTypecheckWalkEnd ( * ******************************************************************************/ -BOOLEAN +static BOOLEAN AnIsResultUsed ( ACPI_PARSE_OBJECT *Op) { @@ -1862,6 +1862,7 @@ AnOtherSemanticAnalysisWalkBegin ( if (Op->Asl.AmlOpcode == AML_DIVIDE_OP) { if ((ArgNode->Asl.ParseOpcode == PARSEOP_ZERO) && + (PrevArgNode) && (PrevArgNode->Asl.ParseOpcode == PARSEOP_ZERO)) { AslError (ASL_WARNING, ASL_MSG_RESULT_NOT_USED, Op, Op->Asl.ExternalName); diff --git a/compiler/aslcompile.c b/compiler/aslcompile.c index 5b664ff5e3c53..f199c5b9b8162 100644 --- a/compiler/aslcompile.c +++ b/compiler/aslcompile.c @@ -127,12 +127,12 @@ static void CmFlushSourceCode ( void); -void +static void FlConsumeAnsiComment ( ASL_FILE_INFO *FileInfo, ASL_FILE_STATUS *Status); -void +static void FlConsumeNewComment ( ASL_FILE_INFO *FileInfo, ASL_FILE_STATUS *Status); @@ -345,7 +345,7 @@ CmFlushSourceCode ( * ******************************************************************************/ -void +static void FlConsumeAnsiComment ( ASL_FILE_INFO *FileInfo, ASL_FILE_STATUS *Status) @@ -389,7 +389,7 @@ FlConsumeAnsiComment ( } -void +static void FlConsumeNewComment ( ASL_FILE_INFO *FileInfo, ASL_FILE_STATUS *Status) diff --git a/compiler/aslcompiler.h b/compiler/aslcompiler.h index c097feee63749..4e97677b56e8e 100644 --- a/compiler/aslcompiler.h +++ b/compiler/aslcompiler.h @@ -686,6 +686,10 @@ ACPI_STATUS LsDisplayNamespace ( void); +void +LsSetupNsList ( + void *Handle); + /* * aslutils - common compiler utilites diff --git a/compiler/aslerror.c b/compiler/aslerror.c index ff24e62b7aa96..59d3d20b6fb77 100644 --- a/compiler/aslerror.c +++ b/compiler/aslerror.c @@ -304,7 +304,7 @@ AePrintException ( if (Enode->LineNumber) { - fprintf (OutputFile, "%6u: ", Enode->LineNumber); + fprintf (OutputFile, " %6u: ", Enode->LineNumber); /* * Seek to the offset in the combined source file, read the source @@ -358,7 +358,7 @@ AePrintException ( { /* Decode the message ID */ - fprintf (OutputFile, "%s %4.4d -", + fprintf (OutputFile, "%s %4.4d - ", AslErrorLevel[Enode->Level], Enode->MessageId + ((Enode->Level+1) * 1000)); diff --git a/compiler/aslfiles.c b/compiler/aslfiles.c index 6ba32ca9f7486..281b779b0a0c7 100644 --- a/compiler/aslfiles.c +++ b/compiler/aslfiles.c @@ -122,7 +122,7 @@ /* Local prototypes */ -FILE * +static FILE * FlOpenIncludeWithPrefix ( char *PrefixDir, char *Filename); @@ -546,7 +546,7 @@ FlAddIncludeDirectory ( * ******************************************************************************/ -FILE * +static FILE * FlOpenIncludeWithPrefix ( char *PrefixDir, char *Filename) diff --git a/compiler/asllisting.c b/compiler/asllisting.c index 93f83ad84279d..2ad87d42dcd5c 100644 --- a/compiler/asllisting.c +++ b/compiler/asllisting.c @@ -202,7 +202,7 @@ static void LsDoHexOutputAsl ( void); -ACPI_STATUS +static ACPI_STATUS LsTreeWriteWalk ( ACPI_PARSE_OBJECT *Op, UINT32 Level, @@ -222,7 +222,7 @@ LsTreeWriteWalk ( * ******************************************************************************/ -ACPI_STATUS +static ACPI_STATUS LsTreeWriteWalk ( ACPI_PARSE_OBJECT *Op, UINT32 Level, diff --git a/compiler/asllookup.c b/compiler/asllookup.c index 7cc7232406030..db909fa1c0fa0 100644 --- a/compiler/asllookup.c +++ b/compiler/asllookup.c @@ -180,11 +180,7 @@ LsDoOnePathname ( void *Context, void **ReturnValue); -void -LsSetupNsList ( - void *Handle); - -ACPI_PARSE_OBJECT * +static ACPI_PARSE_OBJECT * LkGetNameOp ( ACPI_PARSE_OBJECT *Op); @@ -623,7 +619,7 @@ LkObjectExists ( * ******************************************************************************/ -ACPI_PARSE_OBJECT * +static ACPI_PARSE_OBJECT * LkGetNameOp ( ACPI_PARSE_OBJECT *Op) { diff --git a/compiler/aslmain.c b/compiler/aslmain.c index 39ea7aa399b36..90faff739f8ca 100644 --- a/compiler/aslmain.c +++ b/compiler/aslmain.c @@ -214,7 +214,7 @@ Options ( 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"); @@ -462,6 +462,7 @@ AslDoOptions ( BOOLEAN IsResponseFile) { int j; + ACPI_STATUS Status; /* Get the command line options */ @@ -554,7 +555,12 @@ AslDoOptions ( case 'e': - AcpiDmAddToExternalFileList (AcpiGbl_Optarg); + Status = AcpiDmAddToExternalFileList (AcpiGbl_Optarg); + if (ACPI_FAILURE (Status)) + { + printf ("Could not add %s to external list\n", AcpiGbl_Optarg); + return (-1); + } break; @@ -601,7 +607,6 @@ AslDoOptions ( printf ("Unknown option: -h%s\n", AcpiGbl_Optarg); return (-1); } - break; case 'I': /* Add an include file search directory */ @@ -891,6 +896,7 @@ AslCommandLine ( char **argv) { int BadCommandLine = 0; + ACPI_STATUS Status; /* Minimum command line contains at least the command and an input file */ @@ -908,7 +914,11 @@ AslCommandLine ( if (Gbl_DoTemplates) { - DtCreateTemplates (Gbl_TemplateSignature); + Status = DtCreateTemplates (Gbl_TemplateSignature); + if (ACPI_FAILURE (Status)) + { + exit (-1); + } exit (1); } diff --git a/compiler/aslopcodes.c b/compiler/aslopcodes.c index 1c6eef7248047..48aaa50c0fe59 100644 --- a/compiler/aslopcodes.c +++ b/compiler/aslopcodes.c @@ -592,9 +592,9 @@ OpcDoEisaId ( /* Create ID big-endian first (bits are contiguous) */ BigEndianId = - (UINT32) (InString[0] - 0x40) << 26 | - (UINT32) (InString[1] - 0x40) << 21 | - (UINT32) (InString[2] - 0x40) << 16 | + (UINT32) ((UINT8) (InString[0] - 0x40)) << 26 | + (UINT32) ((UINT8) (InString[1] - 0x40)) << 21 | + (UINT32) ((UINT8) (InString[2] - 0x40)) << 16 | (UtHexCharToValue (InString[3])) << 12 | (UtHexCharToValue (InString[4])) << 8 | diff --git a/compiler/aslpredef.c b/compiler/aslpredef.c index 49056edd180e1..f2c3f5919af82 100644 --- a/compiler/aslpredef.c +++ b/compiler/aslpredef.c @@ -117,8 +117,6 @@ #include "aslcompiler.h" #include "aslcompiler.y.h" -#include "amlcode.h" -#include "acparser.h" #include "acpredef.h" diff --git a/compiler/aslrestype1.c b/compiler/aslrestype1.c index 381fb53cc25b7..5c1bd0ed1ac23 100644 --- a/compiler/aslrestype1.c +++ b/compiler/aslrestype1.c @@ -224,7 +224,6 @@ RsDoMemory24Descriptor ( ACPI_PARSE_OBJECT *MinOp = NULL; ACPI_PARSE_OBJECT *MaxOp = NULL; ACPI_PARSE_OBJECT *LengthOp = NULL; - ACPI_PARSE_OBJECT *AlignOp = NULL; ASL_RESOURCE_NODE *Rnode; UINT32 i; @@ -270,7 +269,6 @@ RsDoMemory24Descriptor ( Descriptor->Memory24.Alignment = (UINT16) InitializerOp->Asl.Value.Integer; RsCreateByteField (InitializerOp, ACPI_RESTAG_ALIGNMENT, CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Alignment)); - AlignOp = InitializerOp; break; case 4: /* Length */ diff --git a/compiler/aslrestype2d.c b/compiler/aslrestype2d.c index 7725bf9a8da7f..17ce2703981c1 100644 --- a/compiler/aslrestype2d.c +++ b/compiler/aslrestype2d.c @@ -347,10 +347,10 @@ RsDoDwordIoDescriptor ( /* Validate the Min/Max/Len/Gran values */ RsLargeAddressCheck ( - Descriptor->Address32.Minimum, - Descriptor->Address32.Maximum, - Descriptor->Address32.AddressLength, - Descriptor->Address32.Granularity, + (UINT64) Descriptor->Address32.Minimum, + (UINT64) Descriptor->Address32.Maximum, + (UINT64) Descriptor->Address32.AddressLength, + (UINT64) Descriptor->Address32.Granularity, Descriptor->Address32.Flags, MinOp, MaxOp, LengthOp, GranOp); @@ -583,10 +583,10 @@ RsDoDwordMemoryDescriptor ( /* Validate the Min/Max/Len/Gran values */ RsLargeAddressCheck ( - Descriptor->Address32.Minimum, - Descriptor->Address32.Maximum, - Descriptor->Address32.AddressLength, - Descriptor->Address32.Granularity, + (UINT64) Descriptor->Address32.Minimum, + (UINT64) Descriptor->Address32.Maximum, + (UINT64) Descriptor->Address32.AddressLength, + (UINT64) Descriptor->Address32.Granularity, Descriptor->Address32.Flags, MinOp, MaxOp, LengthOp, GranOp); @@ -801,10 +801,10 @@ RsDoDwordSpaceDescriptor ( /* Validate the Min/Max/Len/Gran values */ RsLargeAddressCheck ( - Descriptor->Address32.Minimum, - Descriptor->Address32.Maximum, - Descriptor->Address32.AddressLength, - Descriptor->Address32.Granularity, + (UINT64) Descriptor->Address32.Minimum, + (UINT64) Descriptor->Address32.Maximum, + (UINT64) Descriptor->Address32.AddressLength, + (UINT64) Descriptor->Address32.Granularity, Descriptor->Address32.Flags, MinOp, MaxOp, LengthOp, GranOp); diff --git a/compiler/aslrestype2e.c b/compiler/aslrestype2e.c index 46f56cec13601..e5b2bd9054b53 100644 --- a/compiler/aslrestype2e.c +++ b/compiler/aslrestype2e.c @@ -116,7 +116,6 @@ #include "aslcompiler.h" -#include "aslcompiler.y.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslrestype2e") diff --git a/compiler/aslrestype2w.c b/compiler/aslrestype2w.c index 45f1858fccfb3..a6e6774c028e6 100644 --- a/compiler/aslrestype2w.c +++ b/compiler/aslrestype2w.c @@ -338,10 +338,10 @@ RsDoWordIoDescriptor ( /* Validate the Min/Max/Len/Gran values */ RsLargeAddressCheck ( - Descriptor->Address16.Minimum, - Descriptor->Address16.Maximum, - Descriptor->Address16.AddressLength, - Descriptor->Address16.Granularity, + (UINT64) Descriptor->Address16.Minimum, + (UINT64) Descriptor->Address16.Maximum, + (UINT64) Descriptor->Address16.AddressLength, + (UINT64) Descriptor->Address16.Granularity, Descriptor->Address16.Flags, MinOp, MaxOp, LengthOp, GranOp); @@ -544,10 +544,10 @@ RsDoWordBusNumberDescriptor ( /* Validate the Min/Max/Len/Gran values */ RsLargeAddressCheck ( - Descriptor->Address16.Minimum, - Descriptor->Address16.Maximum, - Descriptor->Address16.AddressLength, - Descriptor->Address16.Granularity, + (UINT64) Descriptor->Address16.Minimum, + (UINT64) Descriptor->Address16.Maximum, + (UINT64) Descriptor->Address16.AddressLength, + (UINT64) Descriptor->Address16.Granularity, Descriptor->Address16.Flags, MinOp, MaxOp, LengthOp, GranOp); @@ -761,10 +761,10 @@ RsDoWordSpaceDescriptor ( /* Validate the Min/Max/Len/Gran values */ RsLargeAddressCheck ( - Descriptor->Address16.Minimum, - Descriptor->Address16.Maximum, - Descriptor->Address16.AddressLength, - Descriptor->Address16.Granularity, + (UINT64) Descriptor->Address16.Minimum, + (UINT64) Descriptor->Address16.Maximum, + (UINT64) Descriptor->Address16.AddressLength, + (UINT64) Descriptor->Address16.Granularity, Descriptor->Address16.Flags, MinOp, MaxOp, LengthOp, GranOp); diff --git a/compiler/aslstartup.c b/compiler/aslstartup.c index 11c4004930643..0d101430da562 100644 --- a/compiler/aslstartup.c +++ b/compiler/aslstartup.c @@ -124,9 +124,8 @@ #define ASL_MAX_FILES 256 -char *FileList[ASL_MAX_FILES]; -int FileCount; -BOOLEAN AslToFile = TRUE; +static char *FileList[ASL_MAX_FILES]; +static BOOLEAN AslToFile = TRUE; /* Local prototypes */ @@ -136,7 +135,7 @@ AsDoWildcard ( char *DirectoryPathname, char *FileSpecifier); -UINT8 +static UINT8 AslDetectSourceFileType ( ASL_FILE_INFO *Info); @@ -210,6 +209,7 @@ AsDoWildcard ( #ifdef WIN32 void *DirInfo; char *Filename; + int FileCount; FileCount = 0; @@ -277,7 +277,7 @@ AsDoWildcard ( * ******************************************************************************/ -UINT8 +static UINT8 AslDetectSourceFileType ( ASL_FILE_INFO *Info) { @@ -397,7 +397,7 @@ AslDoOneFile ( /* Shutdown compiler and ACPICA subsystem */ AeClearErrorLog (); - AcpiTerminate (); + (void) AcpiTerminate (); /* * Gbl_Files[ASL_FILE_INPUT].Filename was replaced with the @@ -487,7 +487,7 @@ AslDoOneFile ( } Status = CmDoCompile (); - AcpiTerminate (); + (void) AcpiTerminate (); /* * Return non-zero exit code if there have been errors, unless the @@ -533,7 +533,7 @@ AslDoOnePathname ( ASL_PATHNAME_CALLBACK PathCallback) { ACPI_STATUS Status = AE_OK; - char **FileList; + char **WildcardList; char *Filename; char *FullPathname; @@ -548,16 +548,16 @@ AslDoOnePathname ( /* Expand possible wildcard into a file list (Windows/DOS only) */ - FileList = AsDoWildcard (Gbl_DirectoryPath, Filename); - while (*FileList) + WildcardList = AsDoWildcard (Gbl_DirectoryPath, Filename); + while (*WildcardList) { FullPathname = ACPI_ALLOCATE ( - strlen (Gbl_DirectoryPath) + strlen (*FileList) + 1); + strlen (Gbl_DirectoryPath) + strlen (*WildcardList) + 1); /* Construct a full path to the file */ strcpy (FullPathname, Gbl_DirectoryPath); - strcat (FullPathname, *FileList); + strcat (FullPathname, *WildcardList); /* * If -p not specified, we will use the input filename as the @@ -573,9 +573,9 @@ AslDoOnePathname ( Status |= (*PathCallback) (FullPathname); ACPI_FREE (FullPathname); - ACPI_FREE (*FileList); - *FileList = NULL; - FileList++; + ACPI_FREE (*WildcardList); + *WildcardList = NULL; + WildcardList++; } ACPI_FREE (Gbl_DirectoryPath); diff --git a/compiler/dtcompile.c b/compiler/dtcompile.c index 651bdfa192e06..c287c5b7af32d 100644 --- a/compiler/dtcompile.c +++ b/compiler/dtcompile.c @@ -127,7 +127,7 @@ static char VersionString[9]; /* Local prototypes */ -static void +static ACPI_STATUS DtInitialize ( void); @@ -166,7 +166,12 @@ DtDoCompile ( /* Initialize globals */ - DtInitialize (); + Status = DtInitialize (); + if (ACPI_FAILURE (Status)) + { + printf ("Error during compiler initialization, 0x%X\n", Status); + return (Status); + } /* * Scan the input file (file is already open) and @@ -236,26 +241,38 @@ CleanupAndExit: * * PARAMETERS: None * - * RETURN: None + * RETURN: Status * * DESCRIPTION: Initialize data table compiler globals. Enables multiple * compiles per invocation. * *****************************************************************************/ -static void +static ACPI_STATUS DtInitialize ( void) { + ACPI_STATUS Status; - AcpiOsInitialize (); - AcpiUtInitGlobals (); + + Status = AcpiOsInitialize (); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + Status = AcpiUtInitGlobals (); + if (ACPI_FAILURE (Status)) + { + return (Status); + } Gbl_FieldList = NULL; Gbl_RootTable = NULL; Gbl_SubtableStack = NULL; sprintf (VersionString, "%X", (UINT32) ACPI_CA_VERSION); + return (AE_OK); } diff --git a/compiler/dtio.c b/compiler/dtio.c index 4c19ad0b0c8c5..a18ab5f7747d6 100644 --- a/compiler/dtio.c +++ b/compiler/dtio.c @@ -158,7 +158,7 @@ DtWriteBinary ( #define DT_SLASH_SLASH_COMMENT 4 #define DT_END_COMMENT 5 -UINT32 Gbl_NextLineOffset; +static UINT32 Gbl_NextLineOffset; /****************************************************************************** |