diff options
author | Robert Moore <Robert.Moore@intel.com> | 2015-10-14 08:11:47 -0700 |
---|---|---|
committer | Robert Moore <Robert.Moore@intel.com> | 2015-10-14 08:11:47 -0700 |
commit | 68bb6b18de2f304076dc64b9d36da99713bc6bd0 (patch) | |
tree | 30755494d0023faecb887fd709ce52f6c0d67773 /source/compiler | |
parent | 1d86c91aa0f0214026fa870a17a8329f657ec906 (diff) | |
download | acpica-68bb6b18de2f304076dc64b9d36da99713bc6bd0.tar.gz |
iASL: Update for code formatting, no functional changes
Mostly indentation inconsistencies across the code. Split
some long lines, etc.
Diffstat (limited to 'source/compiler')
37 files changed, 415 insertions, 340 deletions
diff --git a/source/compiler/aslanalyze.c b/source/compiler/aslanalyze.c index dde91ba0e..3e76d26c5 100644 --- a/source/compiler/aslanalyze.c +++ b/source/compiler/aslanalyze.c @@ -211,8 +211,7 @@ AnCheckId ( Length = strlen (Op->Asl.Value.String); if (!Length) { - AslError (ASL_ERROR, ASL_MSG_NULL_STRING, - Op, NULL); + AslError (ASL_ERROR, ASL_MSG_NULL_STRING, Op, NULL); return; } @@ -263,7 +262,7 @@ AnCheckId ( return; } - /* _HID Length is valid (7 or 8), now check the prefix (first 3 or 4 chars) */ + /* _HID Length is valid (7 or 8), now check prefix (first 3 or 4 chars) */ if (Length == 7) { @@ -303,8 +302,8 @@ AnCheckId ( { if (!isxdigit ((int) Op->Asl.Value.String[i])) { - AslError (ASL_ERROR, ASL_MSG_HID_SUFFIX, - Op, &Op->Asl.Value.String[i]); + AslError (ASL_ERROR, ASL_MSG_HID_SUFFIX, + Op, &Op->Asl.Value.String[i]); break; } } @@ -395,7 +394,8 @@ AnCheckMethodReturnValue ( { /* Method SOMETIMES returns a value, SOMETIMES not */ - AslError (ASL_WARNING, ASL_MSG_SOME_NO_RETVAL, Op, Op->Asl.ExternalName); + AslError (ASL_WARNING, ASL_MSG_SOME_NO_RETVAL, + Op, Op->Asl.ExternalName); } else if (!(ThisNodeBtype & RequiredBtypes)) { @@ -472,6 +472,7 @@ AnIsResultUsed ( { return (TRUE); } + return (FALSE); /* Not used if one of these is the parent */ diff --git a/source/compiler/aslbtypes.c b/source/compiler/aslbtypes.c index 96f234ab9..7328ad5ee 100644 --- a/source/compiler/aslbtypes.c +++ b/source/compiler/aslbtypes.c @@ -150,7 +150,6 @@ AnMapArgTypeToBtype ( switch (ArgType) { - /* Simple types */ case ARGI_ANYTYPE: @@ -293,7 +292,6 @@ AnMapEtypeToBtype ( UINT32 Etype) { - if (Etype == ACPI_TYPE_ANY) { return (ACPI_BTYPE_OBJECTS_AND_REFS); @@ -400,7 +398,6 @@ AnFormatBtype ( *Buffer = 0; - if (Btype == 0) { strcat (Buffer, "NoReturnValue"); @@ -415,6 +412,7 @@ AnFormatBtype ( { strcat (Buffer, "|"); } + First = FALSE; strcat (Buffer, AcpiUtGetTypeName (Type)); } @@ -427,6 +425,7 @@ AnFormatBtype ( { strcat (Buffer, "|"); } + First = FALSE; strcat (Buffer, "Reference"); } @@ -438,6 +437,7 @@ AnFormatBtype ( { strcat (Buffer, "|"); } + First = FALSE; strcat (Buffer, "Resource"); } @@ -481,7 +481,8 @@ AnGetBtype ( if (!Node) { DbgPrint (ASL_DEBUG_OUTPUT, - "No attached Nsnode: [%s] at line %u name [%s], ignoring typecheck\n", + "No attached Nsnode: [%s] at line %u name [%s], " + "ignoring typecheck\n", Op->Asl.ParseOpName, Op->Asl.LineNumber, Op->Asl.ExternalName); return (ACPI_UINT32_MAX); @@ -529,6 +530,7 @@ AnGetBtype ( return (ThisNodeBtype); } + /******************************************************************************* * * FUNCTION: AnMapObjTypeToBtype diff --git a/source/compiler/aslcodegen.c b/source/compiler/aslcodegen.c index 1508231b6..2e42e7947 100644 --- a/source/compiler/aslcodegen.c +++ b/source/compiler/aslcodegen.c @@ -240,28 +240,28 @@ CgAmlWriteWalk ( } DbgPrint (ASL_TREE_OUTPUT, - "%08X %04X %04X %01X %04X %04X %04X %04X " - "%08X %08X %08X %08X %08X %08X %04X %02d %02d %02d %02d %02d\n", - /* 1 */ (UINT32) Op->Asl.Value.Integer, - /* 2 */ Op->Asl.ParseOpcode, - /* 3 */ Op->Asl.AmlOpcode, - /* 4 */ Op->Asl.AmlOpcodeLength, - /* 5 */ Op->Asl.AmlPkgLenBytes, - /* 6 */ Op->Asl.AmlLength, - /* 7 */ Op->Asl.AmlSubtreeLength, - /* 8 */ Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0, - /* 9 */ Op, - /* 10 */ Op->Asl.Parent, - /* 11 */ Op->Asl.Child, - /* 12 */ Op->Asl.Next, - /* 13 */ Op->Asl.CompileFlags, - /* 14 */ Op->Asl.AcpiBtype, - /* 15 */ Op->Asl.FinalAmlLength, - /* 16 */ Op->Asl.Column, - /* 17 */ Op->Asl.LineNumber, - /* 18 */ Op->Asl.EndLine, - /* 19 */ Op->Asl.LogicalLineNumber, - /* 20 */ Op->Asl.EndLogicalLine); + "%08X %04X %04X %01X %04X %04X %04X %04X " + "%08X %08X %08X %08X %08X %08X %04X %02d %02d %02d %02d %02d\n", + /* 1 */ (UINT32) Op->Asl.Value.Integer, + /* 2 */ Op->Asl.ParseOpcode, + /* 3 */ Op->Asl.AmlOpcode, + /* 4 */ Op->Asl.AmlOpcodeLength, + /* 5 */ Op->Asl.AmlPkgLenBytes, + /* 6 */ Op->Asl.AmlLength, + /* 7 */ Op->Asl.AmlSubtreeLength, + /* 8 */ Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0, + /* 9 */ Op, + /* 10 */ Op->Asl.Parent, + /* 11 */ Op->Asl.Child, + /* 12 */ Op->Asl.Next, + /* 13 */ Op->Asl.CompileFlags, + /* 14 */ Op->Asl.AcpiBtype, + /* 15 */ Op->Asl.FinalAmlLength, + /* 16 */ Op->Asl.Column, + /* 17 */ Op->Asl.LineNumber, + /* 18 */ Op->Asl.EndLine, + /* 19 */ Op->Asl.LogicalLineNumber, + /* 20 */ Op->Asl.EndLogicalLine); /* Generate the AML for this node */ @@ -346,7 +346,8 @@ CgWriteAmlOpcode ( /* These opcodes should not get here */ printf ("Found a node with an unassigned AML opcode\n"); - FlPrintFile (ASL_FILE_STDERR, "Found a node with an unassigned AML opcode\n"); + FlPrintFile (ASL_FILE_STDERR, + "Found a node with an unassigned AML opcode\n"); return; case AML_INT_RESERVEDFIELD_OP: @@ -429,8 +430,10 @@ CgWriteAmlOpcode ( */ PkgLen.Len >>= 4; - /* Now we can write the remaining bytes - either 1, 2, or 3 bytes */ - + /* + * Now we can write the remaining bytes - + * either 1, 2, or 3 bytes + */ for (i = 0; i < (UINT32) (Op->Asl.AmlPkgLenBytes - 1); i++) { CgLocalWriteAmlData (Op, &PkgLen.LenBytes[i], 1); @@ -539,7 +542,7 @@ CgWriteTableHeader ( /* Table length. Checksum zero for now, will rewrite later */ - TableHeader.Length = Gbl_TableLength; + TableHeader.Length = Gbl_TableLength; TableHeader.Checksum = 0; CgLocalWriteAmlData (Op, &TableHeader, sizeof (ACPI_TABLE_HEADER)); diff --git a/source/compiler/aslcompile.c b/source/compiler/aslcompile.c index c76178c9f..491bac0c7 100644 --- a/source/compiler/aslcompile.c +++ b/source/compiler/aslcompile.c @@ -202,7 +202,8 @@ CmDoCompile ( if (Gbl_SyntaxError) { - fprintf (stderr, "Compiler aborting due to parser-detected syntax error(s)\n"); + fprintf (stderr, + "Compiler aborting due to parser-detected syntax error(s)\n"); LsDumpParseTree (); goto ErrorExit; } @@ -258,8 +259,8 @@ CmDoCompile ( /* * Now that the input is parsed, we can open the AML output file. - * Note: by default, the name of this file comes from the table descriptor - * within the input file. + * Note: by default, the name of this file comes from the table + * descriptor within the input file. */ Event = UtBeginEvent ("Open AML output file"); Status = FlOpenAmlOutputFile (Gbl_OutputFilenamePrefix); @@ -335,7 +336,8 @@ CmDoCompile ( /* Namespace cross-reference */ - AslGbl_NamespaceEvent = UtBeginEvent ("Cross reference parse tree and Namespace"); + AslGbl_NamespaceEvent = UtBeginEvent ( + "Cross reference parse tree and Namespace"); Status = XfCrossReferenceNamespace (); if (ACPI_FAILURE (Status)) { @@ -373,7 +375,8 @@ CmDoCompile ( /* Semantic error checking part three - operand type checking */ Event = UtBeginEvent ("Analyze AML operand types"); - DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Operand type checking\n\n"); + DbgPrint (ASL_DEBUG_OUTPUT, + "\nSemantic analysis - Operand type checking\n\n"); if (Gbl_DoTypechecking) { TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, @@ -662,8 +665,8 @@ CmDumpAllEvents ( { ASL_EVENT_INFO *Event; UINT32 Delta; - UINT32 USec; - UINT32 MSec; + UINT32 MicroSeconds; + UINT32 MilliSeconds; UINT32 i; @@ -683,23 +686,23 @@ CmDumpAllEvents ( Delta = (UINT32) (Event->EndTime - Event->StartTime); - USec = Delta / ACPI_100NSEC_PER_USEC; - MSec = Delta / ACPI_100NSEC_PER_MSEC; + MicroSeconds = Delta / ACPI_100NSEC_PER_USEC; + MilliSeconds = Delta / ACPI_100NSEC_PER_MSEC; /* Round milliseconds up */ - if ((USec - (MSec * ACPI_USEC_PER_MSEC)) >= 500) + if ((MicroSeconds - (MilliSeconds * ACPI_USEC_PER_MSEC)) >= 500) { - MSec++; + MilliSeconds++; } DbgPrint (ASL_DEBUG_OUTPUT, "%8u usec %8u msec - %s\n", - USec, MSec, Event->EventName); + MicroSeconds, MilliSeconds, Event->EventName); if (Gbl_CompileTimesFlag) { printf ("%8u usec %8u msec - %s\n", - USec, MSec, Event->EventName); + MicroSeconds, MilliSeconds, Event->EventName); } } diff --git a/source/compiler/aslerror.c b/source/compiler/aslerror.c index c9df5d884..0b2631d15 100644 --- a/source/compiler/aslerror.c +++ b/source/compiler/aslerror.c @@ -339,8 +339,10 @@ AePrintException ( if (!Enode->SourceLine) { - /* Use the merged header/source file if present, otherwise use input file */ - + /* + * Use the merged header/source file if present, otherwise + * use input file + */ SourceFile = Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle; if (!SourceFile) { @@ -386,18 +388,18 @@ AePrintException ( fprintf (OutputFile, " %6u: ", Enode->LineNumber); /* - * If not at EOF, get the corresponding source code line and - * display it. Don't attempt this if we have a premature EOF - * condition. + * If not at EOF, get the corresponding source code line + * and display it. Don't attempt this if we have a + * premature EOF condition. */ if (!PrematureEOF) { /* - * Seek to the offset in the combined source file, read - * the source line, and write it to the output. + * Seek to the offset in the combined source file, + * read the source line, and write it to the output. */ - Actual = fseek (SourceFile, (long) Enode->LogicalByteOffset, - (int) SEEK_SET); + Actual = fseek (SourceFile, + (long) Enode->LogicalByteOffset, (int) SEEK_SET); if (Actual) { fprintf (OutputFile, @@ -952,16 +954,17 @@ AslCoreSubsystemError ( if (Op) { - AslCommonError (ASL_ERROR, ASL_MSG_CORE_EXCEPTION, Op->Asl.LineNumber, - Op->Asl.LogicalLineNumber, - Op->Asl.LogicalByteOffset, - Op->Asl.Column, - Op->Asl.Filename, MsgBuffer); + AslCommonError (ASL_ERROR, ASL_MSG_CORE_EXCEPTION, + Op->Asl.LineNumber, + Op->Asl.LogicalLineNumber, + Op->Asl.LogicalByteOffset, + Op->Asl.Column, + Op->Asl.Filename, MsgBuffer); } else { - AslCommonError (ASL_ERROR, ASL_MSG_CORE_EXCEPTION, 0, - 0, 0, 0, NULL, MsgBuffer); + AslCommonError (ASL_ERROR, ASL_MSG_CORE_EXCEPTION, + 0, 0, 0, 0, NULL, MsgBuffer); } if (Abort) diff --git a/source/compiler/aslfileio.c b/source/compiler/aslfileio.c index 9588528ec..787239681 100644 --- a/source/compiler/aslfileio.c +++ b/source/compiler/aslfileio.c @@ -142,6 +142,7 @@ FlFileError ( sprintf (MsgBuffer, "\"%s\" (%s) - %s", Gbl_Files[FileId].Filename, Gbl_Files[FileId].Description, strerror (errno)); + AslCommonError (ASL_ERROR, ErrorId, 0, 0, 0, 0, NULL, MsgBuffer); } @@ -341,7 +342,8 @@ FlPrintFile ( AslAbort (); } - if ((FileId == ASL_FILE_PREPROCESSOR) && Gbl_PreprocessorOutputFlag) + if ((FileId == ASL_FILE_PREPROCESSOR) && + Gbl_PreprocessorOutputFlag) { /* * Duplicate the output to the user preprocessor (.i) file, @@ -363,7 +365,6 @@ FlPrintFile ( AslAbort (); } } - } diff --git a/source/compiler/aslfiles.c b/source/compiler/aslfiles.c index 234e9b43b..1c1b1d8ad 100644 --- a/source/compiler/aslfiles.c +++ b/source/compiler/aslfiles.c @@ -128,7 +128,6 @@ FlOpenIncludeWithPrefix ( ACPI_PARSE_OBJECT *Op, char *Filename); - #ifdef ACPI_OBSOLETE_FUNCTIONS ACPI_STATUS FlParseInputPathname ( @@ -334,7 +333,8 @@ FlMergePathnames ( /* Build the final merged pathname */ ConcatenatePaths: - Pathname = UtStringCacheCalloc (strlen (CommonPath) + strlen (FilePathname) + 2); + Pathname = UtStringCacheCalloc ( + strlen (CommonPath) + strlen (FilePathname) + 2); if (LastElement && *CommonPath) { strcpy (Pathname, CommonPath); @@ -494,7 +494,8 @@ FlOpenIncludeFile ( * * Construct the file pathname from the global directory name. */ - IncludeFile = FlOpenIncludeWithPrefix (Gbl_DirectoryPath, Op, Op->Asl.Value.String); + IncludeFile = FlOpenIncludeWithPrefix ( + Gbl_DirectoryPath, Op, Op->Asl.Value.String); if (IncludeFile) { return; @@ -507,7 +508,8 @@ FlOpenIncludeFile ( NextDir = Gbl_IncludeDirList; while (NextDir) { - IncludeFile = FlOpenIncludeWithPrefix (NextDir->Dir, Op, Op->Asl.Value.String); + IncludeFile = FlOpenIncludeWithPrefix ( + NextDir->Dir, Op, Op->Asl.Value.String); if (IncludeFile) { return; diff --git a/source/compiler/aslhex.c b/source/compiler/aslhex.c index 39825c8ab..c7d53a9da 100644 --- a/source/compiler/aslhex.c +++ b/source/compiler/aslhex.c @@ -122,7 +122,6 @@ * This module emits ASCII hex output files in either C, ASM, or ASL format */ - /* Local prototypes */ static void @@ -295,6 +294,7 @@ HxDoHexOutputC ( FlPrintFile (ASL_FILE_HEX_OUTPUT, " /* %8.8X", Offset); LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s*/\n", HEX_TABLE_LINE_SIZE - LineLength + 1, " "); @@ -382,6 +382,7 @@ HxDoHexOutputAsl ( FlPrintFile (ASL_FILE_HEX_OUTPUT, " /* %8.8X", Offset); LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "%*s*/\n", HEX_TABLE_LINE_SIZE - LineLength + 1, " "); @@ -465,6 +466,7 @@ HxDoHexOutputAsm ( FlPrintFile (ASL_FILE_HEX_OUTPUT, " ; %8.8X", Offset); LsDumpAsciiInComment (ASL_FILE_HEX_OUTPUT, LineLength, FileData); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n"); Offset += LineLength; diff --git a/source/compiler/asllength.c b/source/compiler/asllength.c index 3fbf8967d..6dd5fe247 100644 --- a/source/compiler/asllength.c +++ b/source/compiler/asllength.c @@ -204,10 +204,11 @@ LnPackageLengthWalk ( if ((Op->Asl.Parent) && (Op->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)) { - Op->Asl.Parent->Asl.AmlSubtreeLength += (Op->Asl.AmlLength + - Op->Asl.AmlOpcodeLength + - Op->Asl.AmlPkgLenBytes + - Op->Asl.AmlSubtreeLength); + Op->Asl.Parent->Asl.AmlSubtreeLength += ( + Op->Asl.AmlLength + + Op->Asl.AmlOpcodeLength + + Op->Asl.AmlPkgLenBytes + + Op->Asl.AmlSubtreeLength); } return (AE_OK); } @@ -301,7 +302,7 @@ CgGenerateAmlOpcodeLength ( if (Op->Asl.CompileFlags & NODE_AML_PACKAGE) { Op->Asl.AmlPkgLenBytes = CgGetPackageLenByteCount ( - Op, Op->Asl.AmlSubtreeLength); + Op, Op->Asl.AmlSubtreeLength); } /* Data opcode lengths are easy */ @@ -406,8 +407,7 @@ CgGenerateAmlLengths ( { case PARSEOP_DEFINITIONBLOCK: - Gbl_TableLength = sizeof (ACPI_TABLE_HEADER) + - Op->Asl.AmlSubtreeLength; + Gbl_TableLength = sizeof (ACPI_TABLE_HEADER) + Op->Asl.AmlSubtreeLength; break; case PARSEOP_NAMESEG: @@ -437,7 +437,6 @@ CgGenerateAmlLengths ( Op->Asl.ExternalName = Op->Asl.Value.String; Op->Asl.Value.String = Buffer; Op->Asl.CompileFlags |= NODE_NAME_INTERNALIZED; - Op->Asl.AmlLength = strlen (Buffer); /* @@ -463,7 +462,7 @@ CgGenerateAmlLengths ( Op->Asl.AmlOpcodeLength = 0; Op->Asl.AmlPkgLenBytes = CgGetPackageLenByteCount (Op, - (UINT32) Op->Asl.Value.Integer); + (UINT32) Op->Asl.Value.Integer); break; case PARSEOP_RAW_DATA: diff --git a/source/compiler/asllisting.c b/source/compiler/asllisting.c index 8131cf4b1..8fa85b31f 100644 --- a/source/compiler/asllisting.c +++ b/source/compiler/asllisting.c @@ -293,6 +293,7 @@ LsAmlListingWalk ( FlFileError (ASL_FILE_AML_OUTPUT, ASL_MSG_READ); AslAbort (); } + LsWriteListingHexBytes (&FileByte, 1, FileId); } diff --git a/source/compiler/asllistsup.c b/source/compiler/asllistsup.c index c71ace0e8..815a2047e 100644 --- a/source/compiler/asllistsup.c +++ b/source/compiler/asllistsup.c @@ -160,6 +160,7 @@ LsDumpAscii ( FlPrintFile (FileId, "."); } } + FlPrintFile (FileId, "\""); } @@ -257,7 +258,6 @@ LsCheckException ( (LineNumber >= Gbl_NextError->LogicalLineNumber)) { AePrintException (FileId, Gbl_NextError, "\n[****iasl****]\n"); - Gbl_NextError = Gbl_NextError->Next; } @@ -648,6 +648,7 @@ LsFlushListingBuffer ( { FlPrintFile (FileId, ","); } + FlPrintFile (FileId, "0%2.2Xh", Gbl_AmlBuffer[i]); } diff --git a/source/compiler/aslload.c b/source/compiler/aslload.c index e6c1f8534..11dd23842 100644 --- a/source/compiler/aslload.c +++ b/source/compiler/aslload.c @@ -268,12 +268,11 @@ LdLoadFieldElements ( default: Status = AcpiNsLookup (WalkState->ScopeInfo, - Child->Asl.Value.String, - ACPI_TYPE_LOCAL_REGION_FIELD, - ACPI_IMODE_LOAD_PASS1, - ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | - ACPI_NS_ERROR_IF_FOUND, - NULL, &Node); + Child->Asl.Value.String, + ACPI_TYPE_LOCAL_REGION_FIELD, + ACPI_IMODE_LOAD_PASS1, + ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | + ACPI_NS_ERROR_IF_FOUND, NULL, &Node); if (ACPI_FAILURE (Status)) { if (Status != AE_ALREADY_EXISTS) @@ -338,9 +337,9 @@ LdLoadResourceElements ( * This opens a scope, so later field names are guaranteed to be new/unique. */ Status = AcpiNsLookup (WalkState->ScopeInfo, Op->Asl.Namepath, - ACPI_TYPE_LOCAL_RESOURCE, ACPI_IMODE_LOAD_PASS1, - ACPI_NS_NO_UPSEARCH | ACPI_NS_ERROR_IF_FOUND, - WalkState, &Node); + ACPI_TYPE_LOCAL_RESOURCE, ACPI_IMODE_LOAD_PASS1, + ACPI_NS_NO_UPSEARCH | ACPI_NS_ERROR_IF_FOUND, + WalkState, &Node); if (ACPI_FAILURE (Status)) { if (Status == AE_ALREADY_EXISTS) @@ -368,11 +367,11 @@ LdLoadResourceElements ( if (InitializerOp->Asl.ExternalName) { Status = AcpiNsLookup (WalkState->ScopeInfo, - InitializerOp->Asl.ExternalName, - ACPI_TYPE_LOCAL_RESOURCE_FIELD, - ACPI_IMODE_LOAD_PASS1, - ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, - NULL, &Node); + InitializerOp->Asl.ExternalName, + ACPI_TYPE_LOCAL_RESOURCE_FIELD, + ACPI_IMODE_LOAD_PASS1, + ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, + NULL, &Node); if (ACPI_FAILURE (Status)) { return (Status); @@ -572,8 +571,8 @@ LdNamespace1Begin ( * handle this case. Perhaps someday this case can go away. */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY, - ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, - WalkState, &(Node)); + ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, + WalkState, &(Node)); if (ACPI_FAILURE (Status)) { if (Status == AE_NOT_FOUND) @@ -581,9 +580,9 @@ LdNamespace1Begin ( /* The name was not found, go ahead and create it */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, - ACPI_TYPE_LOCAL_SCOPE, - ACPI_IMODE_LOAD_PASS1, Flags, - WalkState, &(Node)); + ACPI_TYPE_LOCAL_SCOPE, + ACPI_IMODE_LOAD_PASS1, Flags, + WalkState, &(Node)); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -641,7 +640,7 @@ LdNamespace1Begin ( Node->Type = ACPI_TYPE_LOCAL_SCOPE; Status = AcpiDsScopeStackPush (Node, ACPI_TYPE_LOCAL_SCOPE, - WalkState); + WalkState); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -663,7 +662,7 @@ LdNamespace1Begin ( */ Node->Type = ACPI_TYPE_LOCAL_SCOPE; Status = AcpiDsScopeStackPush (Node, ACPI_TYPE_LOCAL_SCOPE, - WalkState); + WalkState); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -683,7 +682,7 @@ LdNamespace1Begin ( ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Loading name: %s, (%s)\n", - Op->Asl.ExternalName, AcpiUtGetTypeName (ObjectType))); + Op->Asl.ExternalName, AcpiUtGetTypeName (ObjectType))); /* The name must not already exist */ @@ -696,7 +695,7 @@ LdNamespace1Begin ( * parse tree later. */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType, - ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node); + ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node); if (ACPI_FAILURE (Status)) { if (Status == AE_ALREADY_EXISTS) @@ -890,8 +889,8 @@ LdNamespace2Begin ( /* Get the NS node associated with the target. It must exist. */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY, - ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, - WalkState, &TargetNode); + ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, + WalkState, &TargetNode); if (ACPI_FAILURE (Status)) { if (Status == AE_NOT_FOUND) @@ -904,9 +903,9 @@ LdNamespace2Begin ( * This prevents more errors later. */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, - ACPI_TYPE_ANY, - ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH, - WalkState, &(Node)); + ACPI_TYPE_ANY, + ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH, + WalkState, &(Node)); return (AE_OK); } diff --git a/source/compiler/aslmapenter.c b/source/compiler/aslmapenter.c index 8a36d2a7d..9d810aef3 100644 --- a/source/compiler/aslmapenter.c +++ b/source/compiler/aslmapenter.c @@ -311,7 +311,7 @@ MpCreateGpioInfo ( /* Sort on source DeviceName first */ while (NextGpio && - (strcmp (DeviceName, NextGpio->DeviceName) > 0)) + (strcmp (DeviceName, NextGpio->DeviceName) > 0)) { PrevGpio = NextGpio; NextGpio = NextGpio->Next; @@ -320,8 +320,8 @@ MpCreateGpioInfo ( /* Now sort on the PinNumber */ while (NextGpio && - (NextGpio->PinNumber < PinNumber) && - !strcmp (DeviceName, NextGpio->DeviceName)) + (NextGpio->PinNumber < PinNumber) && + !strcmp (DeviceName, NextGpio->DeviceName)) { PrevGpio = NextGpio; NextGpio = NextGpio->Next; diff --git a/source/compiler/aslmapoutput.c b/source/compiler/aslmapoutput.c index ef85594e1..d6234ab6c 100644 --- a/source/compiler/aslmapoutput.c +++ b/source/compiler/aslmapoutput.c @@ -525,7 +525,7 @@ MpEmitDeviceTree ( /* Walk the namespace from the root */ (void) AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, FALSE, MpEmitOneDevice, NULL, NULL, NULL); + ACPI_UINT32_MAX, FALSE, MpEmitOneDevice, NULL, NULL, NULL); } diff --git a/source/compiler/aslmethod.c b/source/compiler/aslmethod.c index 8ffb83789..193c24494 100644 --- a/source/compiler/aslmethod.c +++ b/source/compiler/aslmethod.c @@ -173,7 +173,7 @@ MtMethodAnalysisWalkBegin ( /* Create and init method info */ - MethodInfo = UtLocalCalloc (sizeof (ASL_METHOD_INFO)); + MethodInfo = UtLocalCalloc (sizeof (ASL_METHOD_INFO)); MethodInfo->Next = WalkInfo->MethodStack; MethodInfo->Op = Op; @@ -258,7 +258,9 @@ MtMethodAnalysisWalkBegin ( NextParamType = NextType->Asl.Child; while (NextParamType) { - MethodInfo->ValidArgTypes[ActualArgs] |= AnMapObjTypeToBtype (NextParamType); + MethodInfo->ValidArgTypes[ActualArgs] |= + AnMapObjTypeToBtype (NextParamType); + NextParamType->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; NextParamType = NextParamType->Asl.Next; } @@ -267,6 +269,7 @@ MtMethodAnalysisWalkBegin ( { MethodInfo->ValidArgTypes[ActualArgs] = AnMapObjTypeToBtype (NextType); + NextType->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; ActualArgs++; } @@ -323,7 +326,8 @@ MtMethodAnalysisWalkBegin ( * Local was used outside a control method, or there was an error * in the method declaration. */ - AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD, Op, Op->Asl.ExternalName); + AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD, + Op, Op->Asl.ExternalName); return (AE_ERROR); } @@ -366,7 +370,8 @@ MtMethodAnalysisWalkBegin ( * Arg was used outside a control method, or there was an error * in the method declaration. */ - AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD, Op, Op->Asl.ExternalName); + AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD, + Op, Op->Asl.ExternalName); return (AE_ERROR); } @@ -389,7 +394,7 @@ MtMethodAnalysisWalkBegin ( * The only operator that accepts an uninitialized value is ObjectType() */ else if ((!MethodInfo->ArgInitialized[RegisterNumber]) && - (Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_OBJECTTYPE)) + (Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_OBJECTTYPE)) { AslError (ASL_ERROR, ASL_MSG_ARG_INIT, Op, ArgName); } @@ -490,7 +495,8 @@ MtMethodAnalysisWalkBegin ( i = ApCheckForPredefinedName (Op, Op->Asl.NameSeg); if (i < ACPI_VALID_RESERVED_NAME_MAX) { - AslError (ASL_ERROR, ASL_MSG_RESERVED_USE, Op, Op->Asl.ExternalName); + AslError (ASL_ERROR, ASL_MSG_RESERVED_USE, + Op, Op->Asl.ExternalName); } break; @@ -749,7 +755,8 @@ MtMethodAnalysisWalkEnd ( */ if (Op->Asl.Next) { - AslError (ASL_WARNING, ASL_MSG_UNREACHABLE_CODE, Op->Asl.Next, NULL); + AslError (ASL_WARNING, ASL_MSG_UNREACHABLE_CODE, + Op->Asl.Next, NULL); } break; diff --git a/source/compiler/aslnamesp.c b/source/compiler/aslnamesp.c index c5a6fbd4f..cdec53b63 100644 --- a/source/compiler/aslnamesp.c +++ b/source/compiler/aslnamesp.c @@ -196,16 +196,16 @@ NsDisplayNamespace ( /* Walk entire namespace from the root */ Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, FALSE, NsDoOneNamespaceObject, NULL, - NULL, NULL); + ACPI_UINT32_MAX, FALSE, NsDoOneNamespaceObject, NULL, + NULL, NULL); /* Print the full pathname for each namespace node */ FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\nNamespace pathnames\n\n"); Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, FALSE, NsDoOnePathname, NULL, - NULL, NULL); + ACPI_UINT32_MAX, FALSE, NsDoOnePathname, NULL, + NULL, NULL); return (Status); } @@ -240,8 +240,7 @@ NsDoOneNamespaceObject ( FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%5u [%u] %*s %4.4s - %s", Gbl_NumNamespaceObjects, Level, (Level * 3), " ", - &Node->Name, - AcpiUtGetTypeName (Node->Type)); + &Node->Name, AcpiUtGetTypeName (Node->Type)); Op = Node->Op; ObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node->Object); @@ -290,11 +289,13 @@ NsDoOneNamespaceObject ( { Op = Op->Asl.Child; } + if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) || (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING)) { Op = Op->Asl.Next; } + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, " [Initial Value 0x%8.8X%8.8X]", ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer)); @@ -306,11 +307,13 @@ NsDoOneNamespaceObject ( { Op = Op->Asl.Child; } + if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) || (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING)) { Op = Op->Asl.Next; } + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, " [Initial Value \"%s\"]", Op->Asl.Value.String); @@ -323,6 +326,7 @@ NsDoOneNamespaceObject ( { Op = Op->Asl.Child; } + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, " [Offset 0x%04X Length 0x%04X bits]", Op->Asl.Parent->Asl.ExtraValue, (UINT32) Op->Asl.Value.Integer); @@ -375,11 +379,13 @@ NsDoOneNamespaceObject ( { Op = Op->Asl.Child; } + if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) || (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING)) { Op = Op->Asl.Next; } + Op = Op->Asl.Child; if ((Op->Asl.ParseOpcode == PARSEOP_BYTECONST) || @@ -397,11 +403,13 @@ NsDoOneNamespaceObject ( { Op = Op->Asl.Child; } + if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) || (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING)) { Op = Op->Asl.Next; } + Op = Op->Asl.Child; if (Op && (Op->Asl.ParseOpcode == PARSEOP_INTEGER)) @@ -489,6 +497,5 @@ NsDoOnePathname ( FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%s\n", TargetPath.Pointer); ACPI_FREE (TargetPath.Pointer); - return (AE_OK); } diff --git a/source/compiler/aslopcodes.c b/source/compiler/aslopcodes.c index 4a00b7480..e56c3abea 100644 --- a/source/compiler/aslopcodes.c +++ b/source/compiler/aslopcodes.c @@ -402,11 +402,13 @@ OpcSetOptimalIntegerSize ( Op->Asl.AmlOpcode = AML_BYTE_OP; return (1); } + if (Op->Asl.Value.Integer <= ACPI_UINT16_MAX) { Op->Asl.AmlOpcode = AML_WORD_OP; return (2); } + if (Op->Asl.Value.Integer <= ACPI_UINT32_MAX) { Op->Asl.AmlOpcode = AML_DWORD_OP; @@ -470,6 +472,7 @@ OpcDoAccessAs ( { AttribOp->Asl.Value.Integer = 0; } + AttribOp->Asl.AmlOpcode = AML_RAW_DATA_BYTE; AttribOp->Asl.ParseOpcode = PARSEOP_RAW_DATA; @@ -558,21 +561,21 @@ OpcDoConnection ( * First Child -> BufferLength * Second Child -> Descriptor Buffer (raw byte data) */ - BufferOp->Asl.ParseOpcode = PARSEOP_BUFFER; - BufferOp->Asl.AmlOpcode = AML_BUFFER_OP; - BufferOp->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC; + BufferOp->Asl.ParseOpcode = PARSEOP_BUFFER; + BufferOp->Asl.AmlOpcode = AML_BUFFER_OP; + BufferOp->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC; UtSetParseOpName (BufferOp); - BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER; + BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER; BufferLengthOp->Asl.Value.Integer = Rnode->BufferLength; (void) OpcSetOptimalIntegerSize (BufferLengthOp); UtSetParseOpName (BufferLengthOp); - BufferDataOp->Asl.ParseOpcode = PARSEOP_RAW_DATA; - BufferDataOp->Asl.AmlOpcode = AML_RAW_DATA_CHAIN; - BufferDataOp->Asl.AmlOpcodeLength = 0; - BufferDataOp->Asl.AmlLength = Rnode->BufferLength; - BufferDataOp->Asl.Value.Buffer = (UINT8 *) Rnode; + BufferDataOp->Asl.ParseOpcode = PARSEOP_RAW_DATA; + BufferDataOp->Asl.AmlOpcode = AML_RAW_DATA_CHAIN; + BufferDataOp->Asl.AmlOpcodeLength = 0; + BufferDataOp->Asl.AmlLength = Rnode->BufferLength; + BufferDataOp->Asl.Value.Buffer = (UINT8 *) Rnode; UtSetParseOpName (BufferDataOp); } @@ -636,8 +639,8 @@ OpcDoUnicode ( * Just set the buffer size node to be the buffer length, regardless * of whether it was previously an integer or a default_arg placeholder */ - BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER; - BufferLengthOp->Asl.AmlOpcode = AML_DWORD_OP; + BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER; + BufferLengthOp->Asl.AmlOpcode = AML_DWORD_OP; BufferLengthOp->Asl.Value.Integer = Length; UtSetParseOpName (BufferLengthOp); @@ -645,11 +648,11 @@ OpcDoUnicode ( /* The Unicode string is a raw data buffer */ - InitializerOp->Asl.Value.Buffer = (UINT8 *) UnicodeString; - InitializerOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; - InitializerOp->Asl.AmlLength = Length; - InitializerOp->Asl.ParseOpcode = PARSEOP_RAW_DATA; - InitializerOp->Asl.Child = NULL; + InitializerOp->Asl.Value.Buffer = (UINT8 *) UnicodeString; + InitializerOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; + InitializerOp->Asl.AmlLength = Length; + InitializerOp->Asl.ParseOpcode = PARSEOP_RAW_DATA; + InitializerOp->Asl.Child = NULL; UtSetParseOpName (InitializerOp); } @@ -1402,9 +1405,9 @@ OpcDoPld ( NewOp = TrAllocateNode (PARSEOP_INTEGER); - NewOp->Asl.AmlOpcode = AML_BYTE_OP; + NewOp->Asl.AmlOpcode = AML_BYTE_OP; NewOp->Asl.Value.Integer = 20; - NewOp->Asl.Parent = Op; + NewOp->Asl.Parent = Op; Op->Asl.Child = NewOp; Op = NewOp; @@ -1412,10 +1415,10 @@ OpcDoPld ( /* Peer to the child is the raw buffer data */ NewOp = TrAllocateNode (PARSEOP_RAW_DATA); - NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; - NewOp->Asl.AmlLength = 20; - NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer); - NewOp->Asl.Parent = Op->Asl.Parent; + NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; + NewOp->Asl.AmlLength = 20; + NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer); + NewOp->Asl.Parent = Op->Asl.Parent; Op->Asl.Next = NewOp; } @@ -1470,9 +1473,9 @@ OpcDoUuId ( NewOp = TrAllocateNode (PARSEOP_INTEGER); - NewOp->Asl.AmlOpcode = AML_BYTE_OP; + NewOp->Asl.AmlOpcode = AML_BYTE_OP; NewOp->Asl.Value.Integer = 16; - NewOp->Asl.Parent = Op; + NewOp->Asl.Parent = Op; Op->Asl.Child = NewOp; Op = NewOp; @@ -1480,10 +1483,10 @@ OpcDoUuId ( /* Peer to the child is the raw buffer data */ NewOp = TrAllocateNode (PARSEOP_RAW_DATA); - NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; - NewOp->Asl.AmlLength = 16; - NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer); - NewOp->Asl.Parent = Op->Asl.Parent; + NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; + NewOp->Asl.AmlLength = 16; + NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer); + NewOp->Asl.Parent = Op->Asl.Parent; Op->Asl.Next = NewOp; } diff --git a/source/compiler/asloperands.c b/source/compiler/asloperands.c index 8a7382aa7..ad64ecc42 100644 --- a/source/compiler/asloperands.c +++ b/source/compiler/asloperands.c @@ -260,14 +260,16 @@ OpnDoMethod ( { AslError (ASL_ERROR, ASL_MSG_SYNC_LEVEL, Next, NULL); } + Concurrency = (UINT8) Next->Asl.Value.Integer; } /* Put the bits in their proper places */ - MethodFlags = (UINT8) ((NumArgs & 0x7) | - ((Serialized & 0x1) << 3) | - ((Concurrency & 0xF) << 4)); + MethodFlags = (UINT8) + ((NumArgs & 0x7) | + ((Serialized & 0x1) << 3) | + ((Concurrency & 0xF) << 4)); /* Use the last node for the combined flags byte */ @@ -344,9 +346,9 @@ OpnDoFieldCommon ( /* Set the node to RAW_DATA */ Next->Asl.Value.Integer = FieldFlags; - Next->Asl.AmlOpcode = AML_RAW_DATA_BYTE; - Next->Asl.AmlLength = 1; - Next->Asl.ParseOpcode = PARSEOP_RAW_DATA; + Next->Asl.AmlOpcode = AML_RAW_DATA_BYTE; + Next->Asl.AmlLength = 1; + Next->Asl.ParseOpcode = PARSEOP_RAW_DATA; /* Process the FieldUnitList */ @@ -417,8 +419,8 @@ OpnDoFieldCommon ( /* Named or reserved field entry */ - PkgLengthNode = Next->Asl.Child; - NewBitOffset = (UINT32) PkgLengthNode->Asl.Value.Integer; + PkgLengthNode = Next->Asl.Child; + NewBitOffset = (UINT32) PkgLengthNode->Asl.Value.Integer; CurrentBitOffset += NewBitOffset; /* Save the current AccessAs value for error checking later */ @@ -673,9 +675,9 @@ OpnDoBuffer ( { /* For buffers, this is a list of raw bytes */ - InitializerOp->Asl.AmlOpcode = AML_RAW_DATA_BYTE; - InitializerOp->Asl.AmlLength = 1; - InitializerOp->Asl.ParseOpcode = PARSEOP_RAW_DATA; + InitializerOp->Asl.AmlOpcode = AML_RAW_DATA_BYTE; + InitializerOp->Asl.AmlLength = 1; + InitializerOp->Asl.ParseOpcode = PARSEOP_RAW_DATA; BufferLength++; InitializerOp = ASL_GET_PEER_NODE (InitializerOp); @@ -690,9 +692,9 @@ OpnDoBuffer ( */ BufferLength = strlen (InitializerOp->Asl.Value.String) + 1; - InitializerOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; - InitializerOp->Asl.AmlLength = BufferLength; - InitializerOp->Asl.ParseOpcode = PARSEOP_RAW_DATA; + InitializerOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; + InitializerOp->Asl.AmlLength = BufferLength; + InitializerOp->Asl.ParseOpcode = PARSEOP_RAW_DATA; break; case PARSEOP_RAW_DATA: @@ -708,7 +710,7 @@ OpnDoBuffer ( AslError (ASL_ERROR, ASL_MSG_INVALID_OPERAND, InitializerOp, "Unknown buffer initializer opcode"); printf ("Unknown buffer initializer opcode [%s]\n", - UtGetOpName (InitializerOp->Asl.ParseOpcode)); + UtGetOpName (InitializerOp->Asl.ParseOpcode)); return; } @@ -732,8 +734,8 @@ OpnDoBuffer ( * Just set the buffer size node to be the buffer length, regardless * of whether it was previously an integer or a default_arg placeholder */ - BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER; - BufferLengthOp->Asl.AmlOpcode = AML_DWORD_OP; + BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER; + BufferLengthOp->Asl.AmlOpcode = AML_DWORD_OP; BufferLengthOp->Asl.Value.Integer = BufferLength; (void) OpcSetOptimalIntegerSize (BufferLengthOp); @@ -911,9 +913,9 @@ OpnDoLoadTable ( Next = Next->Asl.Next; if (Next->Asl.ParseOpcode == PARSEOP_ZERO) { - Next->Asl.ParseOpcode = PARSEOP_STRING_LITERAL; - Next->Asl.Value.String = "\\"; - Next->Asl.AmlLength = 2; + Next->Asl.ParseOpcode = PARSEOP_STRING_LITERAL; + Next->Asl.Value.String = "\\"; + Next->Asl.AmlLength = 2; OpcGenerateAmlOpcode (Next); } @@ -995,6 +997,7 @@ OpnDoDefinitionBlock ( Gbl_OutputFilenamePrefix = Filename; UtConvertBackslashes (Gbl_OutputFilenamePrefix); } + Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; /* Signature */ diff --git a/source/compiler/aslopt.c b/source/compiler/aslopt.c index ae8cbb35b..c68c3b5ca 100644 --- a/source/compiler/aslopt.c +++ b/source/compiler/aslopt.c @@ -125,7 +125,7 @@ ACPI_MODULE_NAME ("aslopt") -static UINT32 OptTotal = 0; +static UINT32 OptTotal = 0; /* Local prototypes */ @@ -204,15 +204,15 @@ OptSearchToRoot ( * name in the search path before the one we want, the nodes will * not match, and we cannot use this optimization. */ - Path = &(((char *) TargetPath->Pointer)[TargetPath->Length - - ACPI_NAME_SIZE]), + Path = &(((char *) TargetPath->Pointer)[ + TargetPath->Length - ACPI_NAME_SIZE]), ScopeInfo.Scope.Node = CurrentNode; /* Lookup the NameSeg using SEARCH_PARENT (search-to-root) */ Status = AcpiNsLookup (&ScopeInfo, Path, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, - ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, - WalkState, &(Node)); + ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, + WalkState, &(Node)); if (ACPI_FAILURE (Status)) { return (Status); @@ -244,8 +244,8 @@ OptSearchToRoot ( if (strncmp (*NewPath, "_T_", 3)) { - AslError (ASL_OPTIMIZATION, ASL_MSG_SINGLE_NAME_OPTIMIZATION, Op, - *NewPath); + AslError (ASL_OPTIMIZATION, ASL_MSG_SINGLE_NAME_OPTIMIZATION, + Op, *NewPath); } return (AE_OK); @@ -364,7 +364,7 @@ OptBuildShortestPath ( /* Determine how many prefix Carats are required */ NumCarats = (CurrentPath->Length / ACPI_PATH_SEGMENT_LENGTH) - - NumCommonSegments; + NumCommonSegments; /* * Construct a new target string @@ -445,8 +445,8 @@ OptBuildShortestPath ( * path that has been created. */ Status = AcpiNsLookup (&ScopeInfo, NewPath, - ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, - ACPI_NS_DONT_OPEN_SCOPE, WalkState, &(Node)); + ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, + ACPI_NS_DONT_OPEN_SCOPE, WalkState, &(Node)); if (ACPI_SUCCESS (Status)) { /* Found the namepath, but make sure the node is correct */ @@ -530,7 +530,7 @@ OptOptimizeNameDeclaration ( /* Debug output */ Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, *NewPath, - NULL, &NewPathExternal); + NULL, &NewPathExternal); if (ACPI_FAILURE (Status)) { AslCoreSubsystemError (Op, Status, "Externalizing NamePath", @@ -546,8 +546,8 @@ OptOptimizeNameDeclaration ( * We know that we are at the root, so NULL is used for the scope. */ Status = AcpiNsLookup (NULL, *NewPath, - ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, - ACPI_NS_DONT_OPEN_SCOPE, WalkState, &(Node)); + ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, + ACPI_NS_DONT_OPEN_SCOPE, WalkState, &(Node)); if (ACPI_SUCCESS (Status)) { /* Found the namepath, but make sure the node is correct */ @@ -705,6 +705,7 @@ OptOptimizeNamePath ( { NextOp = NextOp->Asl.Parent; } + if (NextOp && NextOp->Asl.Node) { CurrentNode = NextOp->Asl.Node; @@ -734,6 +735,7 @@ OptOptimizeNamePath ( ASL_NO_ABORT); return_VOID; } + TargetPath.Length--; /* Subtract one for null terminator */ /* CurrentPath is the path to this scope (where we are in the namespace) */ @@ -746,12 +748,13 @@ OptOptimizeNamePath ( ASL_NO_ABORT); return_VOID; } + CurrentPath.Length--; /* Subtract one for null terminator */ /* Debug output only */ Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, AmlNameString, - NULL, &ExternalNameString); + NULL, &ExternalNameString); if (ACPI_FAILURE (Status)) { AslCoreSubsystemError (Op, Status, "Externalizing NamePath", @@ -777,7 +780,7 @@ OptOptimizeNamePath ( * a reference. */ Status = OptOptimizeNameDeclaration (Op, WalkState, CurrentNode, - TargetNode, AmlNameString, &NewPath); + TargetNode, AmlNameString, &NewPath); if (ACPI_FAILURE (Status)) { /* @@ -785,8 +788,8 @@ OptOptimizeNamePath ( * optimize the namestring with carats (up-arrow) */ Status = OptBuildShortestPath (Op, WalkState, CurrentNode, - TargetNode, &CurrentPath, &TargetPath, - AmlNameStringLength, 1, &NewPath); + TargetNode, &CurrentPath, &TargetPath, + AmlNameStringLength, 1, &NewPath); } } else @@ -798,7 +801,7 @@ OptOptimizeNamePath ( * NameSeg of the NamePath */ Status = OptSearchToRoot (Op, WalkState, CurrentNode, - TargetNode, &TargetPath, &NewPath); + TargetNode, &TargetPath, &NewPath); if (ACPI_FAILURE (Status)) { /* @@ -806,8 +809,8 @@ OptOptimizeNamePath ( * optimize the namestring with carats (up-arrow) */ Status = OptBuildShortestPath (Op, WalkState, CurrentNode, - TargetNode, &CurrentPath, &TargetPath, - AmlNameStringLength, 0, &NewPath); + TargetNode, &CurrentPath, &TargetPath, + AmlNameStringLength, 0, &NewPath); } } diff --git a/source/compiler/asloptions.c b/source/compiler/asloptions.c index e7cee07db..f6e9d00ff 100644 --- a/source/compiler/asloptions.c +++ b/source/compiler/asloptions.c @@ -403,7 +403,8 @@ AslDoOptions ( Status = AcpiDmAddToExternalFileList (argv[AcpiGbl_Optind]); if (ACPI_FAILURE (Status)) { - printf ("Could not add %s to external list\n", argv[AcpiGbl_Optind]); + printf ("Could not add %s to external list\n", + argv[AcpiGbl_Optind]); return (-1); } diff --git a/source/compiler/aslpredef.c b/source/compiler/aslpredef.c index c39483b0a..680cb62c8 100644 --- a/source/compiler/aslpredef.c +++ b/source/compiler/aslpredef.c @@ -331,7 +331,7 @@ ApCheckPredefinedReturnValue ( */ Gbl_AllExceptionsDisabled = TRUE; Index = ApCheckForPredefinedName (MethodInfo->Op, - MethodInfo->Op->Asl.NameSeg); + MethodInfo->Op->Asl.NameSeg); Gbl_AllExceptionsDisabled = FALSE; switch (Index) @@ -643,7 +643,8 @@ ApCheckForSpecialName ( * warning and force the user to manually change the names. So, we * will issue a remark instead. */ - AslError (ASL_REMARK, ASL_MSG_COMPILER_RESERVED, Op, Op->Asl.ExternalName); + AslError (ASL_REMARK, ASL_MSG_COMPILER_RESERVED, + Op, Op->Asl.ExternalName); return (ACPI_COMPILER_RESERVED_NAME); } @@ -652,8 +653,8 @@ ApCheckForSpecialName ( * warning, since the entire namespace starting with an underscore is * reserved by the ACPI spec. */ - AslError (ASL_WARNING, ASL_MSG_UNKNOWN_RESERVED_NAME, Op, - Op->Asl.ExternalName); + AslError (ASL_WARNING, ASL_MSG_UNKNOWN_RESERVED_NAME, + Op, Op->Asl.ExternalName); return (ACPI_NOT_RESERVED_NAME); } diff --git a/source/compiler/aslprepkg.c b/source/compiler/aslprepkg.c index 6a74e884e..4f6163f6b 100644 --- a/source/compiler/aslprepkg.c +++ b/source/compiler/aslprepkg.c @@ -310,6 +310,7 @@ ApCheckPackage ( ApCheckObjectType (Predefined->Info.Name, Op, Package->RetInfo3.TailObjectType, i); } + Op = Op->Asl.Next; } break; diff --git a/source/compiler/aslprune.c b/source/compiler/aslprune.c index 44221bbff..7f0074f10 100644 --- a/source/compiler/aslprune.c +++ b/source/compiler/aslprune.c @@ -135,6 +135,8 @@ PrPrintObjectAtLevel ( const char *ObjectName); +/* Structure used for the pruning parse tree walk */ + typedef struct acpi_prune_info { UINT32 PruneLevel; diff --git a/source/compiler/aslresource.c b/source/compiler/aslresource.c index 2abc7dd78..4ae38b322 100644 --- a/source/compiler/aslresource.c +++ b/source/compiler/aslresource.c @@ -468,6 +468,7 @@ RsGetStringDataLength ( { return ((UINT16) (strlen (InitializerOp->Asl.Value.String) + 1)); } + InitializerOp = ASL_GET_PEER_NODE (InitializerOp); } @@ -503,7 +504,6 @@ RsAllocateResourceNode ( Rnode->Buffer = UtLocalCalloc (Size); Rnode->BufferLength = Size; - return (Rnode); } @@ -539,7 +539,6 @@ RsCreateResourceField ( Op->Asl.ExternalName = Name; Op->Asl.CompileFlags |= NODE_IS_RESOURCE_FIELD; - Op->Asl.Value.Tag.BitOffset = (ByteOffset * 8) + BitOffset; Op->Asl.Value.Tag.BitLength = BitLength; } @@ -960,7 +959,7 @@ RsDoOneResourceDescriptor ( default: printf ("Unknown resource descriptor type [%s]\n", - Info->DescriptorTypeOp->Asl.ParseOpName); + Info->DescriptorTypeOp->Asl.ParseOpName); break; } @@ -976,7 +975,8 @@ RsDoOneResourceDescriptor ( if (Rnode) { Info->DescriptorTypeOp->Asl.FinalAmlLength = Rnode->BufferLength; - Info->DescriptorTypeOp->Asl.Extra = ((AML_RESOURCE *) Rnode->Buffer)->DescriptorType; + Info->DescriptorTypeOp->Asl.Extra = + ((AML_RESOURCE *) Rnode->Buffer)->DescriptorType; } return (Rnode); diff --git a/source/compiler/aslrestype1.c b/source/compiler/aslrestype1.c index 945f1bf98..a00b4e979 100644 --- a/source/compiler/aslrestype1.c +++ b/source/compiler/aslrestype1.c @@ -158,7 +158,6 @@ RsDoEndTagDescriptor ( Descriptor->EndTag.DescriptorType = ACPI_RESOURCE_NAME_END_TAG | ASL_RDESC_END_TAG_SIZE; Descriptor->EndTag.Checksum = 0; - return (Rnode); } @@ -186,8 +185,8 @@ RsDoEndDependentDescriptor ( Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_END_DEPENDENT)); Descriptor = Rnode->Buffer; - Descriptor->EndDpf.DescriptorType = ACPI_RESOURCE_NAME_END_DEPENDENT | - ASL_RDESC_END_DEPEND_SIZE; + Descriptor->EndDpf.DescriptorType = + ACPI_RESOURCE_NAME_END_DEPENDENT | ASL_RDESC_END_DEPEND_SIZE; return (Rnode); } @@ -223,7 +222,7 @@ RsDoMemory24Descriptor ( Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY24)); Descriptor = Rnode->Buffer; - Descriptor->Memory24.DescriptorType = ACPI_RESOURCE_NAME_MEMORY24; + Descriptor->Memory24.DescriptorType = ACPI_RESOURCE_NAME_MEMORY24; Descriptor->Memory24.ResourceLength = 9; /* Process all child initialization nodes */ @@ -329,7 +328,7 @@ RsDoMemory32Descriptor ( Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY32)); Descriptor = Rnode->Buffer; - Descriptor->Memory32.DescriptorType = ACPI_RESOURCE_NAME_MEMORY32; + Descriptor->Memory32.DescriptorType = ACPI_RESOURCE_NAME_MEMORY32; Descriptor->Memory32.ResourceLength = 17; /* Process all child initialization nodes */ @@ -432,7 +431,7 @@ RsDoMemory32FixedDescriptor ( Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_MEMORY32)); Descriptor = Rnode->Buffer; - Descriptor->FixedMemory32.DescriptorType = ACPI_RESOURCE_NAME_FIXED_MEMORY32; + Descriptor->FixedMemory32.DescriptorType = ACPI_RESOURCE_NAME_FIXED_MEMORY32; Descriptor->FixedMemory32.ResourceLength = 9; /* Process all child initialization nodes */ @@ -520,8 +519,8 @@ RsDoStartDependentDescriptor ( /* Descriptor has priority byte */ - Descriptor->StartDpf.DescriptorType = ACPI_RESOURCE_NAME_START_DEPENDENT | - (ASL_RDESC_ST_DEPEND_SIZE + 0x01); + Descriptor->StartDpf.DescriptorType = + ACPI_RESOURCE_NAME_START_DEPENDENT | (ASL_RDESC_ST_DEPEND_SIZE + 0x01); /* Process all child initialization nodes */ @@ -565,8 +564,8 @@ RsDoStartDependentDescriptor ( * must keep track of the offset of not only each descriptor, but each * element (field) within each descriptor as well. */ - CurrentByteOffset += RsLinkDescriptorChain (&PreviousRnode, - NextRnode); + CurrentByteOffset += RsLinkDescriptorChain ( + &PreviousRnode, NextRnode); break; } @@ -608,8 +607,8 @@ RsDoStartDependentNoPriDescriptor ( Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO)); Descriptor = Rnode->Buffer; - Descriptor->StartDpf.DescriptorType = ACPI_RESOURCE_NAME_START_DEPENDENT | - ASL_RDESC_ST_DEPEND_SIZE; + Descriptor->StartDpf.DescriptorType = + ACPI_RESOURCE_NAME_START_DEPENDENT | ASL_RDESC_ST_DEPEND_SIZE; PreviousRnode = Rnode; /* Increment offset past StartDependentNoPri descriptor */ @@ -671,7 +670,7 @@ RsDoVendorSmallDescriptor ( Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_VENDOR_SMALL) + 7); Descriptor = Rnode->Buffer; - Descriptor->VendorSmall.DescriptorType = ACPI_RESOURCE_NAME_VENDOR_SMALL; + Descriptor->VendorSmall.DescriptorType = ACPI_RESOURCE_NAME_VENDOR_SMALL; VendorData = ((UINT8 *) Descriptor) + sizeof (AML_RESOURCE_SMALL_HEADER); /* Process all child initialization nodes */ diff --git a/source/compiler/aslrestype1i.c b/source/compiler/aslrestype1i.c index 13945805e..a974aa67c 100644 --- a/source/compiler/aslrestype1i.c +++ b/source/compiler/aslrestype1i.c @@ -160,8 +160,8 @@ RsDoDmaDescriptor ( Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_DMA)); Descriptor = Rnode->Buffer; - Descriptor->Dma.DescriptorType = ACPI_RESOURCE_NAME_DMA | - ASL_RDESC_DMA_SIZE; + Descriptor->Dma.DescriptorType = + ACPI_RESOURCE_NAME_DMA | ASL_RDESC_DMA_SIZE; /* Process all child initialization nodes */ @@ -354,8 +354,8 @@ RsDoFixedIoDescriptor ( Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_IO)); Descriptor = Rnode->Buffer; - Descriptor->Io.DescriptorType = ACPI_RESOURCE_NAME_FIXED_IO | - ASL_RDESC_FIXED_IO_SIZE; + Descriptor->Io.DescriptorType = + ACPI_RESOURCE_NAME_FIXED_IO | ASL_RDESC_FIXED_IO_SIZE; /* Process all child initialization nodes */ @@ -437,8 +437,8 @@ RsDoIoDescriptor ( Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IO)); Descriptor = Rnode->Buffer; - Descriptor->Io.DescriptorType = ACPI_RESOURCE_NAME_IO | - ASL_RDESC_IO_SIZE; + Descriptor->Io.DescriptorType = + ACPI_RESOURCE_NAME_IO | ASL_RDESC_IO_SIZE; /* Process all child initialization nodes */ @@ -548,8 +548,8 @@ RsDoIrqDescriptor ( /* Length = 3 (with flag byte) */ Descriptor = Rnode->Buffer; - Descriptor->Irq.DescriptorType = ACPI_RESOURCE_NAME_IRQ | - (ASL_RDESC_IRQ_SIZE + 0x01); + Descriptor->Irq.DescriptorType = + ACPI_RESOURCE_NAME_IRQ | (ASL_RDESC_IRQ_SIZE + 0x01); /* Process all child initialization nodes */ @@ -668,8 +668,8 @@ RsDoIrqNoFlagsDescriptor ( Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IRQ_NOFLAGS)); Descriptor = Rnode->Buffer; - Descriptor->Irq.DescriptorType = ACPI_RESOURCE_NAME_IRQ | - ASL_RDESC_IRQ_SIZE; + Descriptor->Irq.DescriptorType = + ACPI_RESOURCE_NAME_IRQ | ASL_RDESC_IRQ_SIZE; /* Process all child initialization nodes */ diff --git a/source/compiler/aslrestype2.c b/source/compiler/aslrestype2.c index 1cbca1002..7e62a765d 100644 --- a/source/compiler/aslrestype2.c +++ b/source/compiler/aslrestype2.c @@ -219,6 +219,7 @@ RsDoGeneralRegisterDescriptor ( InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); } + return (Rnode); } @@ -285,7 +286,7 @@ RsDoInterruptDescriptor ( 1 + OptionIndex + StringLength); Descriptor = Rnode->Buffer; - Descriptor->ExtendedIrq.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_IRQ; + Descriptor->ExtendedIrq.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_IRQ; /* * Initial descriptor length -- may be enlarged if there are @@ -295,7 +296,7 @@ RsDoInterruptDescriptor ( Descriptor->ExtendedIrq.InterruptCount = 0; Rover = ACPI_CAST_PTR (AML_RESOURCE, - (&(Descriptor->ExtendedIrq.Interrupts[0]))); + (&(Descriptor->ExtendedIrq.Interrupts[0]))); /* Process all child initialization nodes */ @@ -454,9 +455,10 @@ RsDoInterruptDescriptor ( (Descriptor->ExtendedIrq.ResourceLength + StringLength); } - Rnode->BufferLength = (ASL_RESDESC_OFFSET (ExtendedIrq.Interrupts[0]) - - ASL_RESDESC_OFFSET (ExtendedIrq.DescriptorType)) - + OptionIndex + StringLength; + Rnode->BufferLength = + (ASL_RESDESC_OFFSET (ExtendedIrq.Interrupts[0]) - + ASL_RESDESC_OFFSET (ExtendedIrq.DescriptorType)) + + OptionIndex + StringLength; return (Rnode); } @@ -503,7 +505,7 @@ RsDoVendorLargeDescriptor ( Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_VENDOR_LARGE) + i); Descriptor = Rnode->Buffer; - Descriptor->VendorLarge.DescriptorType = ACPI_RESOURCE_NAME_VENDOR_LARGE; + Descriptor->VendorLarge.DescriptorType = ACPI_RESOURCE_NAME_VENDOR_LARGE; Descriptor->VendorLarge.ResourceLength = (UINT16) i; /* Point to end-of-descriptor for vendor data */ diff --git a/source/compiler/aslrestype2d.c b/source/compiler/aslrestype2d.c index 083751fc0..c1fc0039c 100644 --- a/source/compiler/aslrestype2d.c +++ b/source/compiler/aslrestype2d.c @@ -163,11 +163,11 @@ RsDoDwordIoDescriptor ( CurrentByteOffset = Info->CurrentByteOffset; Rnode = RsAllocateResourceNode ( - sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength); + sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength); Descriptor = Rnode->Buffer; Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32; - Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE; + Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE; /* * Initial descriptor length -- may be enlarged if there are @@ -397,7 +397,7 @@ RsDoDwordMemoryDescriptor ( Descriptor = Rnode->Buffer; Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32; - Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE; + Descriptor->Address32.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE; /* * Initial descriptor length -- may be enlarged if there are @@ -628,7 +628,7 @@ RsDoDwordSpaceDescriptor ( CurrentByteOffset = Info->CurrentByteOffset; Rnode = RsAllocateResourceNode ( - sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength); + sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength); Descriptor = Rnode->Buffer; Descriptor->Address32.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS32; diff --git a/source/compiler/aslrestype2e.c b/source/compiler/aslrestype2e.c index 2a2458949..1f2cc9539 100644 --- a/source/compiler/aslrestype2e.c +++ b/source/compiler/aslrestype2e.c @@ -159,14 +159,14 @@ RsDoExtendedIoDescriptor ( CurrentByteOffset = Info->CurrentByteOffset; Rnode = RsAllocateResourceNode ( - sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength); + sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength); Descriptor = Rnode->Buffer; - Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64; - Descriptor->ExtAddress64.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE; - Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION; + Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64; + Descriptor->ExtAddress64.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE; + Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION; - Descriptor->ExtAddress64.ResourceLength = (UINT16) + Descriptor->ExtAddress64.ResourceLength = (UINT16) (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) - sizeof (AML_RESOURCE_LARGE_HEADER)); @@ -335,11 +335,11 @@ RsDoExtendedMemoryDescriptor ( sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength); Descriptor = Rnode->Buffer; - Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64; - Descriptor->ExtAddress64.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE; - Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION; + Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64; + Descriptor->ExtAddress64.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE; + Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION; - Descriptor->ExtAddress64.ResourceLength = (UINT16) + Descriptor->ExtAddress64.ResourceLength = (UINT16) (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) - sizeof (AML_RESOURCE_LARGE_HEADER)); @@ -513,13 +513,13 @@ RsDoExtendedSpaceDescriptor ( CurrentByteOffset = Info->CurrentByteOffset; Rnode = RsAllocateResourceNode ( - sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength); + sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength); Descriptor = Rnode->Buffer; - Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64; - Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION; + Descriptor->ExtAddress64.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64; + Descriptor->ExtAddress64.RevisionID = AML_RESOURCE_EXTENDED_ADDRESS_REVISION; - Descriptor->ExtAddress64.ResourceLength = (UINT16) + Descriptor->ExtAddress64.ResourceLength = (UINT16) (sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) - sizeof (AML_RESOURCE_LARGE_HEADER)); diff --git a/source/compiler/aslrestype2q.c b/source/compiler/aslrestype2q.c index cfb0405b4..a24d55418 100644 --- a/source/compiler/aslrestype2q.c +++ b/source/compiler/aslrestype2q.c @@ -163,11 +163,11 @@ RsDoQwordIoDescriptor ( CurrentByteOffset = Info->CurrentByteOffset; Rnode = RsAllocateResourceNode ( - sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength); + sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength); Descriptor = Rnode->Buffer; - Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64; - Descriptor->Address64.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE; + Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64; + Descriptor->Address64.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE; /* * Initial descriptor length -- may be enlarged if there are @@ -384,11 +384,11 @@ RsDoQwordMemoryDescriptor ( CurrentByteOffset = Info->CurrentByteOffset; Rnode = RsAllocateResourceNode ( - sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength); + sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength); Descriptor = Rnode->Buffer; - Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64; - Descriptor->Address64.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE; + Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64; + Descriptor->Address64.ResourceType = ACPI_ADDRESS_TYPE_MEMORY_RANGE; /* * Initial descriptor length -- may be enlarged if there are @@ -613,7 +613,7 @@ RsDoQwordSpaceDescriptor ( CurrentByteOffset = Info->CurrentByteOffset; Rnode = RsAllocateResourceNode ( - sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength); + sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength); Descriptor = Rnode->Buffer; Descriptor->Address64.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS64; diff --git a/source/compiler/aslrestype2s.c b/source/compiler/aslrestype2s.c index 779edd07f..469f06e8b 100644 --- a/source/compiler/aslrestype2s.c +++ b/source/compiler/aslrestype2s.c @@ -385,17 +385,19 @@ RsDoGpioIntDescriptor ( /* Allocate the local resource node and initialize */ - Rnode = RsAllocateResourceNode (DescriptorSize + sizeof (AML_RESOURCE_LARGE_HEADER)); + Rnode = RsAllocateResourceNode (DescriptorSize + + sizeof (AML_RESOURCE_LARGE_HEADER)); Descriptor = Rnode->Buffer; - Descriptor->Gpio.ResourceLength = DescriptorSize; - Descriptor->Gpio.DescriptorType = ACPI_RESOURCE_NAME_GPIO; - Descriptor->Gpio.RevisionId = AML_RESOURCE_GPIO_REVISION; - Descriptor->Gpio.ConnectionType = AML_RESOURCE_GPIO_TYPE_INT; + Descriptor->Gpio.ResourceLength = DescriptorSize; + Descriptor->Gpio.DescriptorType = ACPI_RESOURCE_NAME_GPIO; + Descriptor->Gpio.RevisionId = AML_RESOURCE_GPIO_REVISION; + Descriptor->Gpio.ConnectionType = AML_RESOURCE_GPIO_TYPE_INT; /* Build pointers to optional areas */ - InterruptList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_GPIO)); + InterruptList = ACPI_ADD_PTR (UINT16, Descriptor, + sizeof (AML_RESOURCE_GPIO)); PinList = InterruptList; ResourceSource = ACPI_ADD_PTR (char, InterruptList, InterruptLength); VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength); @@ -409,8 +411,10 @@ RsDoGpioIntDescriptor ( ACPI_PTR_DIFF (ResourceSource, Descriptor); DbgPrint (ASL_DEBUG_OUTPUT, - "%16s - Actual: %.2X, Base: %.2X, ResLen: %.2X, VendLen: %.2X, IntLen: %.2X\n", - "GpioInt", Descriptor->Gpio.ResourceLength, (UINT16) sizeof (AML_RESOURCE_GPIO), + "%16s - Actual: %.2X, Base: %.2X, ResLen: " + "%.2X, VendLen: %.2X, IntLen: %.2X\n", + "GpioInt", Descriptor->Gpio.ResourceLength, + (UINT16) sizeof (AML_RESOURCE_GPIO), ResSourceLength, VendorLength, InterruptLength); /* Process all child initialization nodes */ @@ -469,7 +473,8 @@ RsDoGpioIntDescriptor ( if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) { - Descriptor->Gpio.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer; + Descriptor->Gpio.ResSourceIndex = + (UINT8) InitializerOp->Asl.Value.Integer; } break; @@ -494,7 +499,7 @@ RsDoGpioIntDescriptor ( ACPI_PTR_DIFF (VendorData, Descriptor); if (RsGetVendorData (InitializerOp, VendorData, - (CurrentByteOffset + Descriptor->Gpio.VendorOffset))) + (CurrentByteOffset + Descriptor->Gpio.VendorOffset))) { Descriptor->Gpio.VendorLength = VendorLength; } @@ -540,7 +545,8 @@ RsDoGpioIntDescriptor ( InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); } - MpSaveGpioInfo (Info->MappingOp, Descriptor, PinCount, PinList, ResourceSource); + MpSaveGpioInfo (Info->MappingOp, Descriptor, + PinCount, PinList, ResourceSource); return (Rnode); } @@ -596,13 +602,14 @@ RsDoGpioIoDescriptor ( /* Allocate the local resource node and initialize */ - Rnode = RsAllocateResourceNode (DescriptorSize + sizeof (AML_RESOURCE_LARGE_HEADER)); + Rnode = RsAllocateResourceNode (DescriptorSize + + sizeof (AML_RESOURCE_LARGE_HEADER)); Descriptor = Rnode->Buffer; - Descriptor->Gpio.ResourceLength = DescriptorSize; - Descriptor->Gpio.DescriptorType = ACPI_RESOURCE_NAME_GPIO; - Descriptor->Gpio.RevisionId = AML_RESOURCE_GPIO_REVISION; - Descriptor->Gpio.ConnectionType = AML_RESOURCE_GPIO_TYPE_IO; + Descriptor->Gpio.ResourceLength = DescriptorSize; + Descriptor->Gpio.DescriptorType = ACPI_RESOURCE_NAME_GPIO; + Descriptor->Gpio.RevisionId = AML_RESOURCE_GPIO_REVISION; + Descriptor->Gpio.ConnectionType = AML_RESOURCE_GPIO_TYPE_IO; /* Build pointers to optional areas */ @@ -620,8 +627,10 @@ RsDoGpioIoDescriptor ( ACPI_PTR_DIFF (ResourceSource, Descriptor); DbgPrint (ASL_DEBUG_OUTPUT, - "%16s - Actual: %.2X, Base: %.2X, ResLen: %.2X, VendLen: %.2X, IntLen: %.2X\n", - "GpioIo", Descriptor->Gpio.ResourceLength, (UINT16) sizeof (AML_RESOURCE_GPIO), + "%16s - Actual: %.2X, Base: %.2X, ResLen: " + "%.2X, VendLen: %.2X, IntLen: %.2X\n", + "GpioIo", Descriptor->Gpio.ResourceLength, + (UINT16) sizeof (AML_RESOURCE_GPIO), ResSourceLength, VendorLength, InterruptLength); /* Process all child initialization nodes */ @@ -704,7 +713,7 @@ RsDoGpioIoDescriptor ( ACPI_PTR_DIFF (VendorData, Descriptor); if (RsGetVendorData (InitializerOp, VendorData, - (CurrentByteOffset + Descriptor->Gpio.VendorOffset))) + (CurrentByteOffset + Descriptor->Gpio.VendorOffset))) { Descriptor->Gpio.VendorLength = VendorLength; } @@ -750,7 +759,8 @@ RsDoGpioIoDescriptor ( InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); } - MpSaveGpioInfo (Info->MappingOp, Descriptor, PinCount, PinList, ResourceSource); + MpSaveGpioInfo (Info->MappingOp, Descriptor, + PinCount, PinList, ResourceSource); return (Rnode); } @@ -799,14 +809,15 @@ RsDoI2cSerialBusDescriptor ( /* Allocate the local resource node and initialize */ - Rnode = RsAllocateResourceNode (DescriptorSize + sizeof (AML_RESOURCE_LARGE_HEADER)); + Rnode = RsAllocateResourceNode (DescriptorSize + + sizeof (AML_RESOURCE_LARGE_HEADER)); Descriptor = Rnode->Buffer; Descriptor->I2cSerialBus.ResourceLength = DescriptorSize; Descriptor->I2cSerialBus.DescriptorType = ACPI_RESOURCE_NAME_SERIAL_BUS; - Descriptor->I2cSerialBus.RevisionId = AML_RESOURCE_I2C_REVISION; + Descriptor->I2cSerialBus.RevisionId = AML_RESOURCE_I2C_REVISION; Descriptor->I2cSerialBus.TypeRevisionId = AML_RESOURCE_I2C_TYPE_REVISION; - Descriptor->I2cSerialBus.Type = AML_RESOURCE_I2C_SERIALBUSTYPE; + Descriptor->I2cSerialBus.Type = AML_RESOURCE_I2C_SERIALBUSTYPE; Descriptor->I2cSerialBus.TypeDataLength = AML_RESOURCE_I2C_MIN_DATA_LEN + VendorLength; /* Build pointers to optional areas */ @@ -815,7 +826,8 @@ RsDoI2cSerialBusDescriptor ( ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength); DbgPrint (ASL_DEBUG_OUTPUT, - "%16s - Actual: %.2X, Base: %.2X, ResLen: %.2X, VendLen: %.2X, TypLen: %.2X\n", + "%16s - Actual: %.2X, Base: %.2X, ResLen: " + "%.2X, VendLen: %.2X, TypLen: %.2X\n", "I2cSerialBus", Descriptor->I2cSerialBus.ResourceLength, (UINT16) sizeof (AML_RESOURCE_I2C_SERIALBUS), ResSourceLength, VendorLength, Descriptor->I2cSerialBus.TypeDataLength); @@ -869,7 +881,8 @@ RsDoI2cSerialBusDescriptor ( if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) { - Descriptor->I2cSerialBus.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer; + Descriptor->I2cSerialBus.ResSourceIndex = + (UINT8) InitializerOp->Asl.Value.Integer; } break; @@ -946,23 +959,26 @@ RsDoSpiSerialBusDescriptor ( /* Allocate the local resource node and initialize */ - Rnode = RsAllocateResourceNode (DescriptorSize + sizeof (AML_RESOURCE_LARGE_HEADER)); + Rnode = RsAllocateResourceNode (DescriptorSize + + sizeof (AML_RESOURCE_LARGE_HEADER)); Descriptor = Rnode->Buffer; Descriptor->SpiSerialBus.ResourceLength = DescriptorSize; Descriptor->SpiSerialBus.DescriptorType = ACPI_RESOURCE_NAME_SERIAL_BUS; - Descriptor->SpiSerialBus.RevisionId = AML_RESOURCE_SPI_REVISION; + Descriptor->SpiSerialBus.RevisionId = AML_RESOURCE_SPI_REVISION; Descriptor->SpiSerialBus.TypeRevisionId = AML_RESOURCE_SPI_TYPE_REVISION; - Descriptor->SpiSerialBus.Type = AML_RESOURCE_SPI_SERIALBUSTYPE; + Descriptor->SpiSerialBus.Type = AML_RESOURCE_SPI_SERIALBUSTYPE; Descriptor->SpiSerialBus.TypeDataLength = AML_RESOURCE_SPI_MIN_DATA_LEN + VendorLength; /* Build pointers to optional areas */ - VendorData = ACPI_ADD_PTR (UINT8, Descriptor, sizeof (AML_RESOURCE_SPI_SERIALBUS)); + VendorData = ACPI_ADD_PTR (UINT8, Descriptor, + sizeof (AML_RESOURCE_SPI_SERIALBUS)); ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength); DbgPrint (ASL_DEBUG_OUTPUT, - "%16s - Actual: %.2X, Base: %.2X, ResLen: %.2X, VendLen: %.2X, TypLen: %.2X\n", + "%16s - Actual: %.2X, Base: %.2X, ResLen: " + "%.2X, VendLen: %.2X, TypLen: %.2X\n", "SpiSerialBus", Descriptor->SpiSerialBus.ResourceLength, (UINT16) sizeof (AML_RESOURCE_SPI_SERIALBUS), ResSourceLength, VendorLength, Descriptor->SpiSerialBus.TypeDataLength); @@ -1044,7 +1060,8 @@ RsDoSpiSerialBusDescriptor ( if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) { - Descriptor->SpiSerialBus.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer; + Descriptor->SpiSerialBus.ResSourceIndex = + (UINT8) InitializerOp->Asl.Value.Integer; } break; @@ -1121,14 +1138,15 @@ RsDoUartSerialBusDescriptor ( /* Allocate the local resource node and initialize */ - Rnode = RsAllocateResourceNode (DescriptorSize + sizeof (AML_RESOURCE_LARGE_HEADER)); + Rnode = RsAllocateResourceNode (DescriptorSize + + sizeof (AML_RESOURCE_LARGE_HEADER)); Descriptor = Rnode->Buffer; Descriptor->UartSerialBus.ResourceLength = DescriptorSize; Descriptor->UartSerialBus.DescriptorType = ACPI_RESOURCE_NAME_SERIAL_BUS; - Descriptor->UartSerialBus.RevisionId = AML_RESOURCE_UART_REVISION; + Descriptor->UartSerialBus.RevisionId = AML_RESOURCE_UART_REVISION; Descriptor->UartSerialBus.TypeRevisionId = AML_RESOURCE_UART_TYPE_REVISION; - Descriptor->UartSerialBus.Type = AML_RESOURCE_UART_SERIALBUSTYPE; + Descriptor->UartSerialBus.Type = AML_RESOURCE_UART_SERIALBUSTYPE; Descriptor->UartSerialBus.TypeDataLength = AML_RESOURCE_UART_MIN_DATA_LEN + VendorLength; /* Build pointers to optional areas */ @@ -1137,7 +1155,8 @@ RsDoUartSerialBusDescriptor ( ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength); DbgPrint (ASL_DEBUG_OUTPUT, - "%16s - Actual: %.2X, Base: %.2X, ResLen: %.2X, VendLen: %.2X, TypLen: %.2X\n", + "%16s - Actual: %.2X, Base: %.2X, ResLen: " + "%.2X, VendLen: %.2X, TypLen: %.2X\n", "UartSerialBus", Descriptor->UartSerialBus.ResourceLength, (UINT16) sizeof (AML_RESOURCE_UART_SERIALBUS), ResSourceLength, VendorLength, Descriptor->UartSerialBus.TypeDataLength); @@ -1226,7 +1245,8 @@ RsDoUartSerialBusDescriptor ( if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) { - Descriptor->UartSerialBus.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer; + Descriptor->UartSerialBus.ResSourceIndex = + (UINT8) InitializerOp->Asl.Value.Integer; } break; diff --git a/source/compiler/aslrestype2w.c b/source/compiler/aslrestype2w.c index d00a9796a..1103ac473 100644 --- a/source/compiler/aslrestype2w.c +++ b/source/compiler/aslrestype2w.c @@ -163,11 +163,11 @@ RsDoWordIoDescriptor ( CurrentByteOffset = Info->CurrentByteOffset; Rnode = RsAllocateResourceNode ( - sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength); + sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength); Descriptor = Rnode->Buffer; - Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16; - Descriptor->Address16.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE; + Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16; + Descriptor->Address16.ResourceType = ACPI_ADDRESS_TYPE_IO_RANGE; /* * Initial descriptor length -- may be enlarged if there are @@ -384,11 +384,11 @@ RsDoWordBusNumberDescriptor ( CurrentByteOffset = Info->CurrentByteOffset; Rnode = RsAllocateResourceNode ( - sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength); + sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength); Descriptor = Rnode->Buffer; - Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16; - Descriptor->Address16.ResourceType = ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE; + Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16; + Descriptor->Address16.ResourceType = ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE; /* * Initial descriptor length -- may be enlarged if there are @@ -589,10 +589,10 @@ RsDoWordSpaceDescriptor ( CurrentByteOffset = Info->CurrentByteOffset; Rnode = RsAllocateResourceNode ( - sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength); + sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength); Descriptor = Rnode->Buffer; - Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16; + Descriptor->Address16.DescriptorType = ACPI_RESOURCE_NAME_ADDRESS16; /* * Initial descriptor length -- may be enlarged if there are diff --git a/source/compiler/asltransform.c b/source/compiler/asltransform.c index df5d994bc..e2c9ee10e 100644 --- a/source/compiler/asltransform.c +++ b/source/compiler/asltransform.c @@ -183,7 +183,7 @@ TrAmlGetNextTempName ( char *TempName; - if (*TempCount >= (10+26)) /* 0-35 valid: 0-9 and A-Z for TempName[3] */ + if (*TempCount >= (10 + 26)) /* 0-35 valid: 0-9 and A-Z for TempName[3] */ { /* Too many temps */ @@ -201,6 +201,7 @@ TrAmlGetNextTempName ( { TempName[3] = (char) (*TempCount + ('A' - 10)); } + (*TempCount)++; /* First three characters are always "_T_" */ @@ -289,7 +290,7 @@ TrAmlSetSubtreeParent ( while (Next) { Next->Asl.Parent = Parent; - Next = Next->Asl.Next; + Next = Next->Asl.Next; } } @@ -314,7 +315,7 @@ TrAmlInsertPeer ( { NewPeer->Asl.Next = Op->Asl.Next; - Op->Asl.Next = NewPeer; + Op->Asl.Next = NewPeer; } @@ -520,7 +521,7 @@ TrDoSwitch ( { /* Add an ELSE to complete the previous CASE */ - NewOp = TrCreateLeafNode (PARSEOP_ELSE); + NewOp = TrCreateLeafNode (PARSEOP_ELSE); NewOp->Asl.Parent = Conditional->Asl.Parent; TrAmlInitLineNumbers (NewOp, NewOp->Asl.Parent); @@ -530,9 +531,9 @@ TrDoSwitch ( CurrentParentNode = NewOp; } - CaseOp = Next; + CaseOp = Next; Conditional = CaseOp; - CaseBlock = CaseOp->Asl.Child->Asl.Next; + CaseBlock = CaseOp->Asl.Child->Asl.Next; Conditional->Asl.Child->Asl.Next = NULL; Predicate = CaseOp->Asl.Child; @@ -609,7 +610,7 @@ TrDoSwitch ( * CaseOp->Child->Peer is the beginning of the case block */ NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, - (UINT64) ACPI_TO_INTEGER (PredicateValueName)); + (UINT64) ACPI_TO_INTEGER (PredicateValueName)); NewOp->Asl.Next = Predicate; TrAmlInitLineNumbers (NewOp, Predicate); @@ -672,7 +673,7 @@ TrDoSwitch ( /* Unknown peer opcode */ AcpiOsPrintf ("Unknown parse opcode for switch statement: %s (%u)\n", - Next->Asl.ParseOpName, Next->Asl.ParseOpcode); + Next->Asl.ParseOpName, Next->Asl.ParseOpcode); } } @@ -740,7 +741,8 @@ TrDoSwitch ( */ if (Next->Asl.ParseOpcode != PARSEOP_SERIALIZERULE_SERIAL) { - AslError (ASL_REMARK, ASL_MSG_SERIALIZED, MethodOp, "Due to use of Switch operator"); + AslError (ASL_REMARK, ASL_MSG_SERIALIZED, MethodOp, + "Due to use of Switch operator"); Next->Asl.ParseOpcode = PARSEOP_SERIALIZERULE_SERIAL; } @@ -754,7 +756,7 @@ TrDoSwitch ( /* Create the NameSeg child for the Name node */ NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESEG, - (UINT64) ACPI_TO_INTEGER (PredicateValueName)); + (UINT64) ACPI_TO_INTEGER (PredicateValueName)); TrAmlInitLineNumbers (NewOp2, NewOp); NewOp2->Asl.CompileFlags |= NODE_IS_NAME_DECLARATION; NewOp->Asl.Child = NewOp2; @@ -766,25 +768,25 @@ TrDoSwitch ( case ACPI_BTYPE_INTEGER: NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_ZERO, - (UINT64) 0); + (UINT64) 0); TrAmlInitLineNumbers (NewOp2->Asl.Next, NewOp); break; case ACPI_BTYPE_STRING: NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, - (UINT64) ACPI_TO_INTEGER ("")); + (UINT64) ACPI_TO_INTEGER ("")); TrAmlInitLineNumbers (NewOp2->Asl.Next, NewOp); break; case ACPI_BTYPE_BUFFER: (void) TrLinkPeerNode (NewOp2, TrCreateValuedLeafNode (PARSEOP_BUFFER, - (UINT64) 0)); + (UINT64) 0)); Next = NewOp2->Asl.Next; TrAmlInitLineNumbers (Next, NewOp2); (void) TrLinkChildren (Next, 1, TrCreateValuedLeafNode (PARSEOP_ZERO, - (UINT64) 1)); + (UINT64) 1)); TrAmlInitLineNumbers (Next->Asl.Child, Next); BufferOp = TrCreateValuedLeafNode (PARSEOP_DEFAULT_ARG, (UINT64) 0); @@ -827,7 +829,7 @@ TrDoSwitch ( Predicate->Asl.Parent = StoreOp; NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG, - (UINT64) ACPI_TO_INTEGER (PredicateValueName)); + (UINT64) ACPI_TO_INTEGER (PredicateValueName)); TrAmlInitLineNumbers (NewOp, StoreOp); NewOp->Asl.Parent = StoreOp; Predicate->Asl.Next = NewOp; diff --git a/source/compiler/asltree.c b/source/compiler/asltree.c index 51cc24bf2..23e21479a 100644 --- a/source/compiler/asltree.c +++ b/source/compiler/asltree.c @@ -566,7 +566,7 @@ TrSetEndLineNumber ( return; } - Op->Asl.EndLine = Gbl_CurrentLineNumber; + Op->Asl.EndLine = Gbl_CurrentLineNumber; Op->Asl.EndLogicalLine = Gbl_LogicalLineNumber; } @@ -830,7 +830,8 @@ TrCreateConstantLeafNode ( } DbgPrint (ASL_PARSE_OUTPUT, - "\nCreateConstantLeafNode Ln/Col %u/%u NewNode %p Op %s Value %8.8X%8.8X \n", + "\nCreateConstantLeafNode Ln/Col %u/%u NewNode %p " + "Op %s Value %8.8X%8.8X \n", Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode), ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer)); return (Op); @@ -937,7 +938,8 @@ TrCreateValuedLeafNode ( Op = TrAllocateNode (ParseOpcode); DbgPrint (ASL_PARSE_OUTPUT, - "\nCreateValuedLeafNode Ln/Col %u/%u NewNode %p Op %s Value %8.8X%8.8X ", + "\nCreateValuedLeafNode Ln/Col %u/%u NewNode %p " + "Op %s Value %8.8X%8.8X ", Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode), ACPI_FORMAT_UINT64 (Value)); Op->Asl.Value.Integer = Value; @@ -1023,7 +1025,8 @@ TrCreateNode ( DbgPrint (ASL_PARSE_OUTPUT, "\nCreateNode Ln/Col %u/%u NewParent %p Child %u Op %s ", - Op->Asl.LineNumber, Op->Asl.Column, Op, NumChildren, UtGetOpName(ParseOpcode)); + Op->Asl.LineNumber, Op->Asl.Column, Op, + NumChildren, UtGetOpName(ParseOpcode)); /* Some extra debug output based on the parse opcode */ @@ -1232,6 +1235,7 @@ TrLinkChildren ( Child = Child->Asl.Next; Child->Asl.Parent = Op; } + PrevChild = Child; } diff --git a/source/compiler/aslutils.c b/source/compiler/aslutils.c index 6c0e75796..374fe5067 100644 --- a/source/compiler/aslutils.c +++ b/source/compiler/aslutils.c @@ -271,7 +271,6 @@ UtBeginEvent ( AslGbl_Events[AslGbl_NextEvent].StartTime = AcpiOsGetTimer (); AslGbl_Events[AslGbl_NextEvent].EventName = Name; AslGbl_Events[AslGbl_NextEvent].Valid = TRUE; - return (AslGbl_NextEvent++); } @@ -878,6 +877,7 @@ UtPadNameWithUnderscores ( { *PaddedNameSeg = '_'; } + PaddedNameSeg++; } } @@ -1162,7 +1162,7 @@ stroul64 ( /* Check to see if value is out of range: */ if (ReturnValue > ((ACPI_UINT64_MAX - (UINT64) Index) / - (UINT64) Base)) + (UINT64) Base)) { goto ErrorExit; } diff --git a/source/compiler/asluuid.c b/source/compiler/asluuid.c index b9854b909..f1c47fef8 100644 --- a/source/compiler/asluuid.c +++ b/source/compiler/asluuid.c @@ -119,7 +119,7 @@ ACPI_MODULE_NAME ("asluuid") -extern UINT8 AcpiGbl_MapToUuidOffset[UUID_BUFFER_LENGTH]; +extern UINT8 AcpiGbl_MapToUuidOffset[UUID_BUFFER_LENGTH]; /******************************************************************************* @@ -162,11 +162,10 @@ AuValidateUuid ( return (AE_BAD_PARAMETER); } } - - /* All other positions must contain hex digits */ - else { + /* All other positions must contain hex digits */ + if (!isxdigit ((int) InString[i])) { return (AE_BAD_PARAMETER); diff --git a/source/compiler/aslxref.c b/source/compiler/aslxref.c index 200abf3a4..82e053bde 100644 --- a/source/compiler/aslxref.c +++ b/source/compiler/aslxref.c @@ -220,7 +220,7 @@ XfCrossReferenceNamespace ( /* Walk the entire parse tree */ TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, XfNamespaceLocateBegin, - XfNamespaceLocateEnd, WalkState); + XfNamespaceLocateEnd, WalkState); ACPI_FREE (WalkState); return (AE_OK); @@ -249,8 +249,8 @@ XfObjectExists ( /* Walk entire namespace from the supplied root */ Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, FALSE, XfCompareOneNamespaceObject, NULL, - Name, NULL); + ACPI_UINT32_MAX, FALSE, XfCompareOneNamespaceObject, NULL, + Name, NULL); if (Status == AE_CTRL_TRUE) { /* At least one instance of the name was found */ @@ -647,6 +647,7 @@ XfNamespaceLocateBegin ( { NextOp = NextOp->Asl.Next; } + Path = NextOp->Asl.Value.String; } else @@ -668,7 +669,7 @@ XfNamespaceLocateBegin ( Gbl_NsLookupCount++; Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType, - ACPI_IMODE_EXECUTE, Flags, WalkState, &(Node)); + ACPI_IMODE_EXECUTE, Flags, WalkState, &(Node)); if (ACPI_FAILURE (Status)) { if (Status == AE_NOT_FOUND) @@ -850,7 +851,8 @@ XfNamespaceLocateBegin ( if (Message) { - sprintf (MsgBuffer, "Size mismatch, Tag: %u bit%s, Field: %u bit%s", + sprintf (MsgBuffer, + "Size mismatch, Tag: %u bit%s, Field: %u bit%s", TagBitLength, (TagBitLength > 1) ? "s" : "", FieldBitLength, (FieldBitLength > 1) ? "s" : ""); @@ -919,7 +921,7 @@ XfNamespaceLocateBegin ( if (Node->Type != ACPI_TYPE_METHOD) { sprintf (MsgBuffer, "%s is a %s", - Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type)); + Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type)); AslError (ASL_ERROR, ASL_MSG_NOT_METHOD, Op, MsgBuffer); return_ACPI_STATUS (AE_OK); @@ -942,7 +944,7 @@ XfNamespaceLocateBegin ( UtSetParseOpName (Op); PassedArgs = 0; - NextOp = Op->Asl.Child; + NextOp = Op->Asl.Child; while (NextOp) { @@ -1048,7 +1050,8 @@ XfNamespaceLocateBegin ( case ACPI_ADR_SPACE_CMOS: case ACPI_ADR_SPACE_GPIO: - if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != AML_FIELD_ACCESS_BYTE) + if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != + AML_FIELD_ACCESS_BYTE) { AslError (ASL_ERROR, ASL_MSG_REGION_BYTE_ACCESS, Op, NULL); } @@ -1058,7 +1061,8 @@ XfNamespaceLocateBegin ( case ACPI_ADR_SPACE_IPMI: case ACPI_ADR_SPACE_GSBUS: - if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != AML_FIELD_ACCESS_BUFFER) + if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != + AML_FIELD_ACCESS_BUFFER) { AslError (ASL_ERROR, ASL_MSG_REGION_BUFFER_ACCESS, Op, NULL); } @@ -1086,10 +1090,10 @@ XfNamespaceLocateBegin ( if (Op->Asl.Parent->Asl.ExtraValue && Op->Asl.Child) { XfCheckFieldRange (Op, - Op->Asl.Parent->Asl.ExtraValue, - Op->Asl.ExtraValue, - (UINT32) Op->Asl.Child->Asl.Value.Integer, - Op->Asl.Child->Asl.ExtraValue); + Op->Asl.Parent->Asl.ExtraValue, + Op->Asl.ExtraValue, + (UINT32) Op->Asl.Child->Asl.Value.Integer, + Op->Asl.Child->Asl.ExtraValue); } } } |