diff options
author | jkim <jkim@FreeBSD.org> | 2012-10-19 18:47:57 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2012-10-19 18:47:57 +0000 |
commit | d8cd02b5b5893df382c08566087e32fe5b0c3abb (patch) | |
tree | 5e268c18ae0fa3ec73e13e2af60a3be57d8393ec /source | |
parent | da9b951a892d96e0521abeec09d4345ddf04ab8d (diff) | |
download | FreeBSD-src-d8cd02b5b5893df382c08566087e32fe5b0c3abb.zip FreeBSD-src-d8cd02b5b5893df382c08566087e32fe5b0c3abb.tar.gz |
Import ACPICA 20121018.
Diffstat (limited to 'source')
218 files changed, 1479 insertions, 1276 deletions
diff --git a/source/common/adfile.c b/source/common/adfile.c index 2caf599..2c864d4 100644 --- a/source/common/adfile.c +++ b/source/common/adfile.c @@ -100,7 +100,7 @@ AdGenerateFilename ( FilenameBuf[i] = 0; strcat (FilenameBuf, ACPI_TABLE_FILE_SUFFIX); - return FilenameBuf; + return (FilenameBuf); } @@ -183,7 +183,7 @@ AdWriteTable ( * RETURN: New filename containing the original base + the new suffix * * DESCRIPTION: Generate a new filename from the ASL source filename and a new - * extension. Used to create the *.LST, *.TXT, etc. files. + * extension. Used to create the *.LST, *.TXT, etc. files. * ******************************************************************************/ @@ -223,7 +223,7 @@ FlGenerateFilename ( strcat (NewFilename, Suffix); } - return NewFilename; + return (NewFilename); } @@ -332,5 +332,3 @@ FlSplitInputPathname ( *OutFilename = Filename; return (AE_OK); } - - diff --git a/source/common/adisasm.c b/source/common/adisasm.c index fab3617..9ba8916 100644 --- a/source/common/adisasm.c +++ b/source/common/adisasm.c @@ -296,7 +296,7 @@ AdAmlDisassemble ( Status = AcpiDbGetTableFromFile (Filename, &Table); if (ACPI_FAILURE (Status)) { - return Status; + return (Status); } /* @@ -311,14 +311,13 @@ AdAmlDisassemble ( /* Next external file */ ExternalFileList = ExternalFileList->Next; - continue; } Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable); if (ACPI_FAILURE (Status)) { - return Status; + return (Status); } /* Load external table for symbol resolution */ @@ -330,7 +329,7 @@ AdAmlDisassemble ( { AcpiOsPrintf ("Could not parse external ACPI tables, %s\n", AcpiFormatException (Status)); - return Status; + return (Status); } /* @@ -361,12 +360,12 @@ AdAmlDisassemble ( { AcpiOsPrintf ("Could not get ACPI tables, %s\n", AcpiFormatException (Status)); - return Status; + return (Status); } if (!AcpiGbl_DbOpt_disasm) { - return AE_OK; + return (AE_OK); } /* Obtained the local tables, just disassemble the DSDT */ @@ -376,7 +375,7 @@ AdAmlDisassemble ( { AcpiOsPrintf ("Could not get DSDT, %s\n", AcpiFormatException (Status)); - return Status; + return (Status); } AcpiOsPrintf ("\nDisassembly of DSDT\n"); @@ -531,7 +530,14 @@ AdAmlDisassemble ( if (AcpiGbl_DbOpt_disasm) { + /* This is the real disassembly */ + AdDisplayTables (Filename, Table); + + /* Dump hex table if requested (-vt) */ + + AcpiDmDumpDataTable (Table); + fprintf (stderr, "Disassembly completed\n"); fprintf (stderr, "ASL Output: %s - %u bytes\n", DisasmFilename, AdGetFileSize (File)); @@ -720,7 +726,7 @@ AdDisplayTables ( if (!AcpiGbl_ParseOpRoot) { - return AE_NOT_EXIST; + return (AE_NOT_EXIST); } if (!AcpiGbl_DbOpt_verbose) @@ -733,15 +739,15 @@ AdDisplayTables ( if (AcpiGbl_DbOpt_verbose) { AcpiOsPrintf ("\n\nTable Header:\n"); - AcpiUtDumpBuffer ((UINT8 *) Table, sizeof (ACPI_TABLE_HEADER), + AcpiUtDebugDumpBuffer ((UINT8 *) Table, sizeof (ACPI_TABLE_HEADER), DB_BYTE_DISPLAY, ACPI_UINT32_MAX); AcpiOsPrintf ("Table Body (Length 0x%X)\n", Table->Length); - AcpiUtDumpBuffer (((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER)), Table->Length, - DB_BYTE_DISPLAY, ACPI_UINT32_MAX); + AcpiUtDebugDumpBuffer (((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER)), + Table->Length, DB_BYTE_DISPLAY, ACPI_UINT32_MAX); } - return AE_OK; + return (AE_OK); } @@ -808,8 +814,8 @@ AdDeferredParse ( /* * We need to update all of the Aml offsets, since the parser thought - * that the method began at offset zero. In reality, it began somewhere - * within the ACPI table, at the BaseAmlOffset. Walk the entire tree that + * that the method began at offset zero. In reality, it began somewhere + * within the ACPI table, at the BaseAmlOffset. Walk the entire tree that * was just created and update the AmlOffset in each Op */ BaseAmlOffset = (Op->Common.Value.Arg)->Common.AmlOffset + 1; @@ -914,7 +920,7 @@ AdParseDeferredOps ( Status = AdDeferredParse (Op, Op->Named.Data, Op->Named.Length); if (ACPI_FAILURE (Status)) { - return_ACPI_STATUS (Status); + return (Status); } break; @@ -942,7 +948,7 @@ AdParseDeferredOps ( } fprintf (stderr, "\n"); - return Status; + return (Status); } @@ -979,7 +985,7 @@ AdGetLocalTables ( if (!NewTable) { fprintf (stderr, "Could not obtain RSDT\n"); - return AE_NO_ACPI_TABLES; + return (AE_NO_ACPI_TABLES); } else { @@ -999,7 +1005,7 @@ AdGetLocalTables ( /* * Determine the number of tables pointed to by the RSDT/XSDT. * This is defined by the ACPI Specification to be the number of - * pointers contained within the RSDT/XSDT. The size of the pointers + * pointers contained within the RSDT/XSDT. The size of the pointers * is architecture-dependent. */ NumTables = (NewTable->Length - sizeof (ACPI_TABLE_HEADER)) / PointerSize; @@ -1036,13 +1042,13 @@ AdGetLocalTables ( if (ACPI_FAILURE (Status)) { fprintf (stderr, "Could not store DSDT\n"); - return AE_NO_ACPI_TABLES; + return (AE_NO_ACPI_TABLES); } } else { fprintf (stderr, "Could not obtain DSDT\n"); - return AE_NO_ACPI_TABLES; + return (AE_NO_ACPI_TABLES); } #if 0 @@ -1061,7 +1067,7 @@ AdGetLocalTables ( } while (NewTable); #endif - return AE_OK; + return (AE_OK); } @@ -1096,7 +1102,7 @@ AdParseTable ( if (!Table) { - return AE_NOT_EXIST; + return (AE_NOT_EXIST); } /* Pass 1: Parse everything except control method bodies */ @@ -1111,7 +1117,7 @@ AdParseTable ( AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp (); if (!AcpiGbl_ParseOpRoot) { - return AE_NO_MEMORY; + return (AE_NO_MEMORY); } /* Create and initialize a new walk state */ @@ -1136,7 +1142,7 @@ AdParseTable ( Status = AcpiPsParseAml (WalkState); if (ACPI_FAILURE (Status)) { - return Status; + return (Status); } /* If LoadTable is FALSE, we are parsing the last loaded table */ @@ -1151,19 +1157,19 @@ AdParseTable ( Table->Length, ACPI_TABLE_ORIGIN_ALLOCATED, &TableIndex); if (ACPI_FAILURE (Status)) { - return Status; + return (Status); } Status = AcpiTbAllocateOwnerId (TableIndex); if (ACPI_FAILURE (Status)) { - return Status; + return (Status); } if (OwnerId) { Status = AcpiTbGetOwnerId (TableIndex, OwnerId); if (ACPI_FAILURE (Status)) { - return Status; + return (Status); } } } @@ -1180,7 +1186,7 @@ AdParseTable ( if (External) { - return AE_OK; + return (AE_OK); } /* Pass 3: Parse control methods and link their parse trees into the main parse tree */ @@ -1192,7 +1198,5 @@ AdParseTable ( AcpiDmFindResources (AcpiGbl_ParseOpRoot); fprintf (stderr, "Parsing completed\n"); - return AE_OK; + return (AE_OK); } - - diff --git a/source/common/adwalk.c b/source/common/adwalk.c index 5336b61..5843005 100644 --- a/source/common/adwalk.c +++ b/source/common/adwalk.c @@ -654,8 +654,8 @@ AcpiDmLoadDescendingOp ( while (AcpiGbl_PreDefinedNames[PreDefineIndex].Name) { - if (!ACPI_STRNCMP (Node->Name.Ascii, - AcpiGbl_PreDefinedNames[PreDefineIndex].Name, 4)) + if (ACPI_COMPARE_NAME (Node->Name.Ascii, + AcpiGbl_PreDefinedNames[PreDefineIndex].Name)) { PreDefined = TRUE; break; @@ -787,7 +787,7 @@ AcpiDmXrefDescendingOp ( } /* - * Lookup the name in the namespace. Name must exist at this point, or it + * Lookup the name in the namespace. Name must exist at this point, or it * is an invalid reference. * * The namespace is also used as a lookup table for references to resource @@ -1018,5 +1018,3 @@ AcpiDmInspectPossibleArgs ( return (Last); } - - diff --git a/source/common/dmextern.c b/source/common/dmextern.c index 1952900..22924dd 100644 --- a/source/common/dmextern.c +++ b/source/common/dmextern.c @@ -687,4 +687,3 @@ AcpiDmEmitExternals ( AcpiOsPrintf ("\n"); } - diff --git a/source/common/dmrestag.c b/source/common/dmrestag.c index 9d18539..8426dff 100644 --- a/source/common/dmrestag.c +++ b/source/common/dmrestag.c @@ -1050,4 +1050,3 @@ AcpiDmAddResourceToNamespace ( Node->Length = Length; return (AE_OK); } - diff --git a/source/common/dmtable.c b/source/common/dmtable.c index cb97b54..6c23783 100644 --- a/source/common/dmtable.c +++ b/source/common/dmtable.c @@ -415,6 +415,18 @@ AcpiDmDumpDataTable ( if (AcpiUtIsAmlTable (Table)) { + if (Gbl_VerboseTemplates) + { + /* Dump the raw table data */ + + Length = Table->Length; + + AcpiOsPrintf ("\n/*\n%s: Length %d (0x%X)\n\n", + ACPI_RAW_TABLE_DATA_HEADER, Length, Length); + AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table), + Length, DB_BYTE_DISPLAY, 0); + AcpiOsPrintf (" */\n"); + } return; } @@ -484,7 +496,8 @@ AcpiDmDumpDataTable ( AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n", ACPI_RAW_TABLE_DATA_HEADER, Length, Length); - AcpiUtDumpBuffer2 (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY); + AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table), + Length, DB_BYTE_DISPLAY, 0); } } diff --git a/source/common/dmtbdump.c b/source/common/dmtbdump.c index 102f1fe..85ae14c 100644 --- a/source/common/dmtbdump.c +++ b/source/common/dmtbdump.c @@ -1611,8 +1611,8 @@ AcpiDmDumpMpst ( ACPI_MPST_DATA_HDR *SubTable1; ACPI_MPST_POWER_DATA *SubTable2; UINT16 SubtableCount; - UINT8 PowerStateCount; - UINT8 ComponentCount; + UINT32 PowerStateCount; + UINT32 ComponentCount; /* Main table */ diff --git a/source/common/dmtbinfo.c b/source/common/dmtbinfo.c index 1cd856a..19d9df3 100644 --- a/source/common/dmtbinfo.c +++ b/source/common/dmtbinfo.c @@ -1518,10 +1518,10 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[] = ACPI_DMTABLE_INFO AcpiDmTableInfoMpst[] = { - {ACPI_DMT_UINT16, ACPI_MPST_OFFSET (Reserved1), "Reserved", 0}, {ACPI_DMT_UINT8, ACPI_MPST_OFFSET (ChannelId), "Channel ID", 0}, - {ACPI_DMT_UINT8, ACPI_MPST_OFFSET (Reserved2), "Reserved", 0}, + {ACPI_DMT_UINT24, ACPI_MPST_OFFSET (Reserved1[0]), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_MPST_OFFSET (PowerNodeCount), "Power Node Count", 0}, + {ACPI_DMT_UINT16, ACPI_MPST_OFFSET (Reserved2), "Reserved", 0}, ACPI_DMT_TERMINATOR }; @@ -1538,12 +1538,11 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0[] = {ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (Reserved1), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_MPST0_OFFSET (NodeId), "Node ID", 0}, - {ACPI_DMT_UINT32, ACPI_MPST0_OFFSET (Length), "Length", DT_LENGTH}, + {ACPI_DMT_UINT32, ACPI_MPST0_OFFSET (Length), "Length", 0}, {ACPI_DMT_UINT64, ACPI_MPST0_OFFSET (RangeAddress), "Range Address", 0}, {ACPI_DMT_UINT64, ACPI_MPST0_OFFSET (RangeLength), "Range Length", 0}, - {ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (NumPowerStates), "Num Power States", 0}, - {ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (NumPhysicalComponents), "Num Physical Components", 0}, - {ACPI_DMT_UINT16, ACPI_MPST0_OFFSET (Reserved2), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_MPST0_OFFSET (NumPowerStates), "Num Power States", 0}, + {ACPI_DMT_UINT32, ACPI_MPST0_OFFSET (NumPhysicalComponents), "Num Physical Components", 0}, ACPI_DMT_TERMINATOR }; @@ -1569,6 +1568,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0B[] = ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[] = { {ACPI_DMT_UINT16, ACPI_MPST1_OFFSET (CharacteristicsCount), "Characteristics Count", 0}, + {ACPI_DMT_UINT16, ACPI_MPST1_OFFSET (Reserved), "Reserved", 0}, ACPI_DMT_TERMINATOR }; @@ -1576,7 +1576,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[] = ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2[] = { - {ACPI_DMT_UINT8, ACPI_MPST2_OFFSET (Revision), "Revision", 0}, + {ACPI_DMT_UINT8, ACPI_MPST2_OFFSET (StructureId), "Structure ID", 0}, {ACPI_DMT_UINT8, ACPI_MPST2_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_MPST2_FLAG_OFFSET (Flags,0), "Memory Preserved", 0}, {ACPI_DMT_FLAG1, ACPI_MPST2_FLAG_OFFSET (Flags,0), "Auto Entry", 0}, diff --git a/source/common/getopt.c b/source/common/getopt.c index 80d8081..6696e3a 100644 --- a/source/common/getopt.c +++ b/source/common/getopt.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: getopt diff --git a/source/compiler/aslcodegen.c b/source/compiler/aslcodegen.c index 98869f5..c7dbaa1 100644 --- a/source/compiler/aslcodegen.c +++ b/source/compiler/aslcodegen.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslcodegen - AML code generation @@ -89,7 +88,7 @@ CgWriteNode ( * * RETURN: None * - * DESCRIPTION: Generate AML code. Currently generates the listing file + * DESCRIPTION: Generate AML code. Currently generates the listing file * simultaneously. * ******************************************************************************/ @@ -446,7 +445,7 @@ CgWriteTableHeader ( /* Compiler ID */ - strncpy (TableHeader.AslCompilerId, ASL_CREATOR_ID, 4); + ACPI_MOVE_NAME (TableHeader.AslCompilerId, ASL_CREATOR_ID); /* Compiler version */ @@ -589,5 +588,3 @@ CgWriteNode ( break; } } - - diff --git a/source/compiler/aslcompile.c b/source/compiler/aslcompile.c index 3ac3c24..f0fd329 100644 --- a/source/compiler/aslcompile.c +++ b/source/compiler/aslcompile.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslcompile - top level compile module @@ -480,7 +479,7 @@ CmDoCompile ( { UtEndEvent (Event); CmCleanupAndExit (); - return 0; + return (0); } } UtEndEvent (Event); @@ -548,7 +547,7 @@ CmDoCompile ( if (ACPI_FAILURE (Status)) { AePrintErrorLog (ASL_FILE_STDERR); - return -1; + return (-1); } /* Interpret and generate all compile-time constants */ @@ -589,7 +588,7 @@ CmDoCompile ( UtDisplaySummary (ASL_FILE_STDOUT); } UtEndEvent (FullCompile); - return 0; + return (0); } /* @@ -621,7 +620,7 @@ CmDoCompile ( UtEndEvent (AslGbl_NamespaceEvent); /* - * Semantic analysis. This can happen only after the + * Semantic analysis. This can happen only after the * namespace has been loaded and cross-referenced. * * part one - check control methods @@ -682,7 +681,7 @@ CmDoCompile ( UtEndEvent (FullCompile); CmCleanupAndExit (); - return 0; + return (0); ErrorExit: UtEndEvent (FullCompile); @@ -905,5 +904,3 @@ CmCleanupAndExit ( FlDeleteFile (ASL_FILE_SOURCE_OUTPUT); } } - - diff --git a/source/compiler/aslcompiler.h b/source/compiler/aslcompiler.h index c68fcb4..98dc27d 100644 --- a/source/compiler/aslcompiler.h +++ b/source/compiler/aslcompiler.h @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslcompiler.h - common include file for iASL @@ -1128,4 +1127,3 @@ DtCreateTemplates ( char *Signature); #endif /* __ASLCOMPILER_H */ - diff --git a/source/compiler/aslcompiler.y b/source/compiler/aslcompiler.y index 92ae940..d1f47da 100644 --- a/source/compiler/aslcompiler.y +++ b/source/compiler/aslcompiler.y @@ -3509,7 +3509,7 @@ OptionalXferSize int AslCompilerwrap(void) { - return 1; + return (1); } /*! [End] no source code translation !*/ diff --git a/source/compiler/asldefine.h b/source/compiler/asldefine.h index a83a021..0ee3c69 100644 --- a/source/compiler/asldefine.h +++ b/source/compiler/asldefine.h @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: asldefine.h - Common defines for the iASL compiler @@ -174,4 +173,3 @@ RsCreateResourceField (Op, Name, ByteOffset, 0, 64); #endif /* ASLDEFINE.H */ - diff --git a/source/compiler/aslerror.c b/source/compiler/aslerror.c index c125dfc..74c220d 100644 --- a/source/compiler/aslerror.c +++ b/source/compiler/aslerror.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslerror - Error handling and statistics @@ -95,7 +94,7 @@ AeClearErrorLog ( * * RETURN: None * - * DESCRIPTION: Add a new error node to the error log. The error log is + * DESCRIPTION: Add a new error node to the error log. The error log is * ordered by the "logical" line number (cumulative line number * including all include files.) * @@ -783,5 +782,5 @@ AslCompilererror ( Gbl_CurrentColumn, Gbl_Files[ASL_FILE_INPUT].Filename, ACPI_CAST_PTR (char, CompilerMessage)); - return 0; + return (0); } diff --git a/source/compiler/aslfiles.c b/source/compiler/aslfiles.c index 7aa426c..3a3de38 100644 --- a/source/compiler/aslfiles.c +++ b/source/compiler/aslfiles.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslfiles - file I/O suppoert @@ -63,7 +62,6 @@ FlParseInputPathname ( #endif - /******************************************************************************* * * FUNCTION: AslAbort @@ -72,7 +70,7 @@ FlParseInputPathname ( * * RETURN: None * - * DESCRIPTION: Dump the error log and abort the compiler. Used for serious + * DESCRIPTION: Dump the error log and abort the compiler. Used for serious * I/O errors * ******************************************************************************/ @@ -199,7 +197,7 @@ FlGetFileSize ( * Buffer - Where to place the data * Length - Amount to read * - * RETURN: Status. AE_ERROR indicates EOF. + * RETURN: Status. AE_ERROR indicates EOF. * * DESCRIPTION: Read data from an open file. * NOTE: Aborts compiler on any error. @@ -347,7 +345,7 @@ FlSeekFile ( * * RETURN: None * - * DESCRIPTION: Close an open file. Aborts compiler on error + * DESCRIPTION: Close an open file. Aborts compiler on error * ******************************************************************************/ @@ -806,7 +804,7 @@ FlOpenInputFile ( * * RETURN: Status * - * DESCRIPTION: Create the output filename (*.AML) and open the file. The file + * DESCRIPTION: Create the output filename (*.AML) and open the file. The file * is created in the same directory as the parent input file. * ******************************************************************************/ @@ -1147,5 +1145,3 @@ FlParseInputPathname ( return (AE_OK); } #endif - - diff --git a/source/compiler/aslfold.c b/source/compiler/aslfold.c index 425a328..e8e6b31 100644 --- a/source/compiler/aslfold.c +++ b/source/compiler/aslfold.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslfold - Constant folding @@ -334,7 +333,7 @@ OpcAmlConstantWalk ( WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL); if (!WalkState) { - return AE_NO_MEMORY; + return (AE_NO_MEMORY); } WalkState->NextOp = NULL; diff --git a/source/compiler/aslglobal.h b/source/compiler/aslglobal.h index 0451fec..987ed1c 100644 --- a/source/compiler/aslglobal.h +++ b/source/compiler/aslglobal.h @@ -1,5 +1,3 @@ - - /****************************************************************************** * * Module Name: aslglobal.h - Global variable definitions @@ -49,7 +47,7 @@ /* - * Global variables. Defined in aslmain.c only, externed in all other files + * Global variables. Defined in aslmain.c only, externed in all other files */ #undef ASL_EXTERN @@ -254,4 +252,3 @@ ASL_EXTERN char StringBuffer2[ASL_MSG_BUFFER_SIZE]; #endif /* __ASLGLOBAL_H */ - diff --git a/source/compiler/asllength.c b/source/compiler/asllength.c index ed88de9..2207f36 100644 --- a/source/compiler/asllength.c +++ b/source/compiler/asllength.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: asllength - Tree walk to determine package and opcode lengths @@ -80,7 +79,7 @@ LnAdjustLengthToRoot ( * RETURN: Status * * DESCRIPTION: Walk callback to initialize (and re-initialize) the node - * subtree length(s) to zero. The Subtree lengths are bubbled + * subtree length(s) to zero. The Subtree lengths are bubbled * up to the root node in order to get a total AML length. * ******************************************************************************/ @@ -112,7 +111,7 @@ LnInitLengthsWalk ( * them all into the parent subtree length. * * Note: The SubtreeLength represents the total AML length of all child nodes - * in all subtrees under a given node. Therefore, once this walk is + * in all subtrees under a given node. Therefore, once this walk is * complete, the Root Node subtree length is the AML length of the entire * tree (and thus, the entire ACPI table) * @@ -426,7 +425,7 @@ CgGenerateAmlLengths ( * RETURN: None. * * DESCRIPTION: Change the Subtree length of the given node, and bubble the - * change all the way up to the root node. This allows for + * change all the way up to the root node. This allows for * last second changes to a package length (for example, if the * package length encoding gets shorter or longer.) * @@ -454,5 +453,3 @@ LnAdjustLengthToRoot ( Gbl_TableLength -= LengthDelta; } #endif - - diff --git a/source/compiler/asllisting.c b/source/compiler/asllisting.c index c865df6..339cc01 100644 --- a/source/compiler/asllisting.c +++ b/source/compiler/asllisting.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: asllisting - Listing file generation @@ -340,7 +339,7 @@ LsAmlListingWalk ( * * RETURN: None * - * DESCRIPTION: Generate a listing file. This can be one of the several types + * DESCRIPTION: Generate a listing file. This can be one of the several types * of "listings" supported. * ******************************************************************************/ @@ -421,7 +420,7 @@ LsDoListings ( * * RETURN: None * - * DESCRIPTION: Push a listing node on the listing/include file stack. This + * DESCRIPTION: Push a listing node on the listing/include file stack. This * stack enables tracking of include files (infinitely nested) * and resumption of the listing of the parent file when the * include file is finished. @@ -479,7 +478,7 @@ LsPopNode ( { AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL, "Could not pop empty listing stack"); - return Gbl_ListingNode; + return (Gbl_ListingNode); } Gbl_ListingNode = Lnode->Next; @@ -501,8 +500,8 @@ LsPopNode ( * RETURN: None * * DESCRIPTION: Check if there is an exception for this line, and if there is, - * put it in the listing immediately. Handles multiple errors - * per line. Gbl_NextError points to the next error in the + * put it in the listing immediately. Handles multiple errors + * per line. Gbl_NextError points to the next error in the * sorted (by line #) list of compile errors/warnings. * ******************************************************************************/ @@ -545,7 +544,7 @@ LsCheckException ( * RETURN: None * * DESCRIPTION: Flush out the current contents of the 16-byte hex AML code - * buffer. Usually called at the termination of a single line + * buffer. Usually called at the termination of a single line * of source code or when the buffer is full. * ******************************************************************************/ @@ -653,7 +652,7 @@ LsFlushListingBuffer ( * RETURN: None * * DESCRIPTION: Write the contents of the AML buffer to the listing file via - * the listing buffer. The listing buffer is flushed every 16 + * the listing buffer. The listing buffer is flushed every 16 * AML bytes. * ******************************************************************************/ @@ -807,7 +806,7 @@ LsWriteOneSourceLine ( * * RETURN: None * - * DESCRIPTION: Cleanup routine for the listing file. Flush the hex AML + * DESCRIPTION: Cleanup routine for the listing file. Flush the hex AML * listing buffer, and flush out any remaining lines in the * source input file. * @@ -868,7 +867,7 @@ LsFinishSourceListing ( * RETURN: None * * DESCRIPTION: Read then write source lines to the listing file until we have - * reached the specified logical (cumulative) line number. This + * reached the specified logical (cumulative) line number. This * automatically echos out comment blocks and other non-AML * generating text until we get to the actual AML-generating line * of ASL code specified by the logical line number. @@ -937,7 +936,7 @@ LsWriteSourceLines ( * * RETURN: None. * - * DESCRIPTION: Write "a node" to the listing file. This means to + * DESCRIPTION: Write "a node" to the listing file. This means to * 1) Write out all of the source text associated with the node * 2) Write out all of the AML bytes associated with the node * 3) Write any compiler exceptions associated with the node @@ -1289,7 +1288,7 @@ LsDoHexOutput ( * * RETURN: None. * - * DESCRIPTION: Create the hex output file. This is the same data as the AML + * DESCRIPTION: Create the hex output file. This is the same data as the AML * output file, but formatted into hex/ascii bytes suitable for * inclusion into a C source file. * @@ -1377,7 +1376,7 @@ LsDoHexOutputC ( * * RETURN: None. * - * DESCRIPTION: Create the hex output file. This is the same data as the AML + * DESCRIPTION: Create the hex output file. This is the same data as the AML * output file, but formatted into hex/ascii bytes suitable for * inclusion into a C source file. * @@ -1465,7 +1464,7 @@ LsDoHexOutputAsl ( * * RETURN: None. * - * DESCRIPTION: Create the hex output file. This is the same data as the AML + * DESCRIPTION: Create the hex output file. This is the same data as the AML * output file, but formatted into hex/ascii bytes suitable for * inclusion into a ASM source file. * @@ -1538,5 +1537,3 @@ LsDoHexOutputAsm ( FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n"); } - - diff --git a/source/compiler/aslload.c b/source/compiler/aslload.c index c3a0d64..7436071 100644 --- a/source/compiler/aslload.c +++ b/source/compiler/aslload.c @@ -113,7 +113,7 @@ LdLoadNamespace ( WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL); if (!WalkState) { - return AE_NO_MEMORY; + return (AE_NO_MEMORY); } /* Walk the entire parse tree, first pass */ @@ -129,7 +129,7 @@ LdLoadNamespace ( /* Dump the namespace if debug is enabled */ AcpiNsDumpTables (ACPI_NS_ALL, ACPI_UINT32_MAX); - return AE_OK; + return (AE_OK); } @@ -894,5 +894,3 @@ LdCommonNamespaceEnd ( return (AE_OK); } - - diff --git a/source/compiler/asllookup.c b/source/compiler/asllookup.c index 6df6436..8bd9355 100644 --- a/source/compiler/asllookup.c +++ b/source/compiler/asllookup.c @@ -423,7 +423,7 @@ LsDoOnePathname ( * RETURN: Status * * DESCRIPTION: Walk the namespace an display information about each node - * in the tree. Information is written to the optional + * in the tree. Information is written to the optional * namespace output file. * ******************************************************************************/ @@ -691,8 +691,8 @@ LkFindUnreferencedObjects ( * RETURN: Status * * DESCRIPTION: Perform a cross reference check of the parse tree against the - * namespace. Every named referenced within the parse tree - * should be get resolved with a namespace lookup. If not, the + * namespace. Every named referenced within the parse tree + * should be get resolved with a namespace lookup. If not, the * original reference in the ASL code is invalid -- i.e., refers * to a non-existent object. * @@ -718,14 +718,14 @@ LkCrossReferenceNamespace ( WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL); if (!WalkState) { - return AE_NO_MEMORY; + return (AE_NO_MEMORY); } /* Walk the entire parse tree */ TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, LkNamespaceLocateBegin, LkNamespaceLocateEnd, WalkState); - return AE_OK; + return (AE_OK); } @@ -759,7 +759,7 @@ LkCheckFieldRange ( /* - * Check each field unit against the region size. The entire + * Check each field unit against the region size. The entire * field unit (start offset plus length) must fit within the * region. */ @@ -775,7 +775,7 @@ LkCheckFieldRange ( /* * Now check that the field plus AccessWidth doesn't go beyond - * the end-of-region. Assumes AccessBitWidth is a power of 2 + * the end-of-region. Assumes AccessBitWidth is a power of 2 */ FieldEndBitOffset = ACPI_ROUND_UP (FieldEndBitOffset, AccessBitWidth); @@ -795,13 +795,13 @@ LkCheckFieldRange ( * * RETURN: Status * - * DESCRIPTION: Descending callback used during cross-reference. For named + * DESCRIPTION: Descending callback used during cross-reference. For named * object references, attempt to locate the name in the * namespace. * * NOTE: ASL references to named fields within resource descriptors are - * resolved to integer values here. Therefore, this step is an - * important part of the code generation. We don't know that the + * resolved to integer values here. Therefore, this step is an + * important part of the code generation. We don't know that the * name refers to a resource descriptor until now. * ******************************************************************************/ @@ -835,7 +835,7 @@ LkNamespaceLocateBegin ( /* * If this node is the actual declaration of a name * [such as the XXXX name in "Method (XXXX)"], - * we are not interested in it here. We only care about names that are + * we are not interested in it here. We only care about names that are * references to other objects within the namespace and the parent objects * of name declarations */ @@ -921,7 +921,7 @@ LkNamespaceLocateBegin ( "Type=%s\n", AcpiUtGetTypeName (ObjectType))); /* - * Lookup the name in the namespace. Name must exist at this point, or it + * Lookup the name in the namespace. Name must exist at this point, or it * is an invalid reference. * * The namespace is also used as a lookup table for references to resource @@ -1226,9 +1226,9 @@ LkNamespaceLocateBegin ( (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_BANKFIELD))) { /* - * Offset checking for fields. If the parent operation region has a + * Offset checking for fields. If the parent operation region has a * constant length (known at compile time), we can check fields - * defined in that region against the region length. This will catch + * defined in that region against the region length. This will catch * fields and field units that cannot possibly fit within the region. * * Note: Index fields do not directly reference an operation region, @@ -1238,7 +1238,7 @@ LkNamespaceLocateBegin ( { /* * This is the first child of the field node, which is - * the name of the region. Get the parse node for the + * the name of the region. Get the parse node for the * region -- which contains the length of the region. */ OwningOp = Node->Op; @@ -1315,7 +1315,7 @@ LkNamespaceLocateBegin ( else { /* - * This is one element of the field list. Check to make sure + * This is one element of the field list. Check to make sure * that it does not go beyond the end of the parent operation region. * * In the code below: @@ -1348,7 +1348,7 @@ LkNamespaceLocateBegin ( * * RETURN: Status * - * DESCRIPTION: Ascending callback used during cross reference. We only + * DESCRIPTION: Ascending callback used during cross reference. We only * need to worry about scope management here. * ******************************************************************************/ @@ -1397,5 +1397,3 @@ LkNamespaceLocateEnd ( return (AE_OK); } - - diff --git a/source/compiler/aslmain.c b/source/compiler/aslmain.c index 75262c7..09eb9fc 100644 --- a/source/compiler/aslmain.c +++ b/source/compiler/aslmain.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslmain - compiler main and utilities @@ -124,6 +123,7 @@ Options ( printf ("\nGlobal:\n"); ACPI_OPTION ("-@ <file>", "Specify command file"); ACPI_OPTION ("-I <dir>", "Specify additional include directory"); + ACPI_OPTION ("-T <sig>|ALL|*", "Create table template file for ACPI <Sig>"); ACPI_OPTION ("-v", "Display compiler version"); printf ("\nPreprocessor:\n"); @@ -142,10 +142,10 @@ Options ( ACPI_OPTION ("-w1 -w2 -w3", "Set warning reporting level"); ACPI_OPTION ("-we", "Report warnings as errors"); - printf ("\nAML Output Files:\n"); - ACPI_OPTION ("-sa -sc", "Create AML in assembler or C source file (*.asm or *.c)"); + printf ("\nAML and Data Output Files:\n"); + ACPI_OPTION ("-sa -sc", "Create assembler or C source file (*.asm or *.c)"); ACPI_OPTION ("-ia -ic", "Create assembler or C include file (*.inc or *.h)"); - ACPI_OPTION ("-ta -tc -ts", "Create AML in assembler, C, or ASL hex table (*.hex)"); + ACPI_OPTION ("-ta -tc -ts", "Create assembler, C, or ASL hex table (*.hex)"); printf ("\nAML Code Generation:\n"); ACPI_OPTION ("-oa", "Disable all optimizations (compatibility mode)"); @@ -162,7 +162,6 @@ Options ( printf ("\nACPI Data Tables:\n"); ACPI_OPTION ("-G", "Compile custom table containing generic operators"); - ACPI_OPTION ("-T <sig>|ALL|*", "Create table template file(s) for <Sig>"); ACPI_OPTION ("-vt", "Create verbose templates (full disassembly)"); printf ("\nAML Disassembler:\n"); @@ -174,6 +173,7 @@ Options ( ACPI_OPTION ("-e [f1,f2]", "Include ACPI table(s) for external symbol resolution"); ACPI_OPTION ("-2", "Emit ACPI 2.0 compatible ASL code"); ACPI_OPTION ("-g", "Get ACPI tables and write to files (*.dat)"); + ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file"); printf ("\nHelp:\n"); ACPI_OPTION ("-h", "This message"); @@ -211,7 +211,7 @@ FilenameHelp ( printf ("\nAML output filename generation:\n"); printf (" Output filenames are generated by appending an extension to a common\n"); - printf (" filename prefix. The filename prefix is obtained via one of the\n"); + printf (" filename prefix. The filename prefix is obtained via one of the\n"); printf (" following methods (in priority order):\n"); printf (" 1) The -p option specifies the prefix\n"); printf (" 2) The prefix of the AMLFileName in the ASL Definition Block\n"); @@ -389,7 +389,7 @@ AslDoResponseFile ( { printf ("Could not open command file %s, %s\n", Filename, strerror (errno)); - return -1; + return (-1); } /* Must save the current GetOpt globals */ @@ -1070,5 +1070,3 @@ main ( return (0); } - - diff --git a/source/compiler/aslmap.c b/source/compiler/aslmap.c index 240175d..b9798a7 100644 --- a/source/compiler/aslmap.c +++ b/source/compiler/aslmap.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslmap - parser to AML opcode mapping table @@ -100,7 +99,7 @@ AslMapNamedOpcodeToDataType ( * * DATA STRUCTURE: AslKeywordMapping * - * DESCRIPTION: Maps the ParseOpcode to the actual AML opcode. The parse + * DESCRIPTION: Maps the ParseOpcode to the actual AML opcode. The parse * opcodes are generated from Bison, and this table must * track any additions to them. * @@ -451,5 +450,3 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /*! [End] no source code translation !*/ }; - - diff --git a/source/compiler/aslmessages.h b/source/compiler/aslmessages.h index f2d86d0..07758ef 100644 --- a/source/compiler/aslmessages.h +++ b/source/compiler/aslmessages.h @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslmessages.h - Compiler error/warning messages diff --git a/source/compiler/aslopcodes.c b/source/compiler/aslopcodes.c index 9f3e15d..bd16cb5 100644 --- a/source/compiler/aslopcodes.c +++ b/source/compiler/aslopcodes.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslopcode - AML opcode generation @@ -188,10 +187,10 @@ OpcGetIntegerWidth ( * * PARAMETERS: Op - A parse tree node * - * RETURN: Integer width, in bytes. Also sets the node AML opcode to the + * RETURN: Integer width, in bytes. Also sets the node AML opcode to the * optimal integer AML prefix opcode. * - * DESCRIPTION: Determine the optimal AML encoding of an integer. All leading + * DESCRIPTION: Determine the optimal AML encoding of an integer. All leading * zeros can be truncated to squeeze the integer into the * minimal number of AML bytes. * @@ -211,7 +210,7 @@ OpcSetOptimalIntegerSize ( Op->Asl.Parent->Asl.Parent && (Op->Asl.Parent->Asl.Parent->Asl.ParseOpcode == PARSEOP_DEFINITIONBLOCK)) { - return 0; + return (0); } #endif @@ -231,14 +230,14 @@ OpcSetOptimalIntegerSize ( Op->Asl.AmlOpcode = AML_ZERO_OP; AslError (ASL_OPTIMIZATION, ASL_MSG_INTEGER_OPTIMIZATION, Op, "Zero"); - return 1; + return (1); case 1: Op->Asl.AmlOpcode = AML_ONE_OP; AslError (ASL_OPTIMIZATION, ASL_MSG_INTEGER_OPTIMIZATION, Op, "One"); - return 1; + return (1); case ACPI_UINT32_MAX: @@ -249,7 +248,7 @@ OpcSetOptimalIntegerSize ( Op->Asl.AmlOpcode = AML_ONES_OP; AslError (ASL_OPTIMIZATION, ASL_MSG_INTEGER_OPTIMIZATION, Op, "Ones"); - return 1; + return (1); } break; @@ -262,7 +261,7 @@ OpcSetOptimalIntegerSize ( Op->Asl.AmlOpcode = AML_ONES_OP; AslError (ASL_OPTIMIZATION, ASL_MSG_INTEGER_OPTIMIZATION, Op, "Ones"); - return 1; + return (1); } break; @@ -276,17 +275,17 @@ OpcSetOptimalIntegerSize ( if (Op->Asl.Value.Integer <= ACPI_UINT8_MAX) { Op->Asl.AmlOpcode = AML_BYTE_OP; - return 1; + return (1); } if (Op->Asl.Value.Integer <= ACPI_UINT16_MAX) { Op->Asl.AmlOpcode = AML_WORD_OP; - return 2; + return (2); } if (Op->Asl.Value.Integer <= ACPI_UINT32_MAX) { Op->Asl.AmlOpcode = AML_DWORD_OP; - return 4; + return (4); } else { @@ -299,12 +298,12 @@ OpcSetOptimalIntegerSize ( { /* Truncate the integer to 32-bit */ Op->Asl.AmlOpcode = AML_DWORD_OP; - return 4; + return (4); } } Op->Asl.AmlOpcode = AML_QWORD_OP; - return 8; + return (8); } } @@ -459,7 +458,7 @@ OpcDoConnection ( * RETURN: None * * DESCRIPTION: Implement the UNICODE ASL "macro". Convert the input string - * to a unicode buffer. There is no Unicode AML opcode. + * to a unicode buffer. There is no Unicode AML opcode. * * Note: The Unicode string is 16 bits per character, no leading signature, * with a 16-bit terminating NULL. @@ -535,19 +534,19 @@ OpcDoUnicode ( * * RETURN: None * - * DESCRIPTION: Convert a string EISA ID to numeric representation. See the - * Pnp BIOS Specification for details. Here is an excerpt: + * DESCRIPTION: Convert a string EISA ID to numeric representation. See the + * Pnp BIOS Specification for details. Here is an excerpt: * * A seven character ASCII representation of the product - * identifier compressed into a 32-bit identifier. The seven + * identifier compressed into a 32-bit identifier. The seven * character ID consists of a three character manufacturer code, * a three character hexadecimal product identifier, and a one - * character hexadecimal revision number. The manufacturer code + * character hexadecimal revision number. The manufacturer code * is a 3 uppercase character code that is compressed into 3 5-bit * values as follows: * 1) Find hex ASCII value for each letter * 2) Subtract 40h from each ASCII value - * 3) Retain 5 least signficant bits for each letter by + * 3) Retain 5 least significant bits for each letter by * discarding upper 3 bits because they are always 0. * 4) Compressed code = concatenate 0 and the 3 5-bit values * @@ -726,7 +725,7 @@ OpcDoUuId ( * RETURN: None * * DESCRIPTION: Generate the AML opcode associated with the node and its - * parse (lex/flex) keyword opcode. Essentially implements + * parse (lex/flex) keyword opcode. Essentially implements * a mapping between the parse opcodes and the actual AML opcodes. * ******************************************************************************/ @@ -810,5 +809,3 @@ OpcGenerateAmlOpcode ( return; } - - diff --git a/source/compiler/asloperands.c b/source/compiler/asloperands.c index 6d4433d..d4d93c8 100644 --- a/source/compiler/asloperands.c +++ b/source/compiler/asloperands.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: asloperands - AML operand processing @@ -263,7 +262,7 @@ OpnDoFieldCommon ( UpdateRule = (UINT8) Next->Asl.Value.Integer; /* - * Generate the flags byte. The various fields are already + * Generate the flags byte. The various fields are already * in the right bit position via translation from the * keywords by the parser. */ @@ -326,7 +325,7 @@ OpnDoFieldCommon ( { /* * Offset is redundant; we don't need to output an - * offset opcode. Just set these nodes to default + * offset opcode. Just set these nodes to default */ Next->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; PkgLengthNode->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; @@ -502,7 +501,7 @@ OpnDoBankField ( * * RETURN: None * - * DESCRIPTION: Tries to get the length of the region. Can only do this at + * DESCRIPTION: Tries to get the length of the region. Can only do this at * compile time if the length is a constant. * ******************************************************************************/ @@ -549,7 +548,7 @@ OpnDoRegion ( * * RETURN: None * - * DESCRIPTION: Construct the AML operands for the BUFFER ASL keyword. We + * DESCRIPTION: Construct the AML operands for the BUFFER ASL keyword. We * build a single raw byte buffer from the initialization nodes, * each parse node contains a buffer byte. * @@ -615,7 +614,7 @@ OpnDoBuffer ( case PARSEOP_STRING_LITERAL: /* - * Only one initializer, the string. Buffer must be big enough to hold + * Only one initializer, the string. Buffer must be big enough to hold * the string plus the null termination byte */ BufferLength = strlen (InitializerOp->Asl.Value.String) + 1; @@ -682,7 +681,7 @@ OpnDoBuffer ( * * RETURN: None * - * DESCRIPTION: Construct the AML operands for the PACKAGE ASL keyword. NOTE: + * DESCRIPTION: Construct the AML operands for the PACKAGE ASL keyword. NOTE: * can only be called after constants have been folded, to ensure * that the PackageLength operand has been fully reduced. * @@ -898,7 +897,7 @@ OpnDoDefinitionBlock ( /* - * These nodes get stuffed into the table header. They are special + * These nodes get stuffed into the table header. They are special * cased when the table is written to the output file. * * Mark all of these nodes as non-usable so they won't get output @@ -998,7 +997,7 @@ OpnDoDefinitionBlock ( * PARAMETERS: Op - Get an argument for this op * Argn - Nth argument to get * - * RETURN: The argument (as an Op object). NULL if argument does not exist + * RETURN: The argument (as an Op object). NULL if argument does not exist * * DESCRIPTION: Get the specified op's argument (peer) * @@ -1111,7 +1110,7 @@ OpnAttachNameToNode ( * * RETURN: None * - * DESCRIPTION: Prepare nodes to be output as AML data and operands. The more + * DESCRIPTION: Prepare nodes to be output as AML data and operands. The more * complex AML opcodes require processing of the child nodes * (arguments/operands). * @@ -1184,5 +1183,3 @@ OpnGenerateAmlOperands ( OpnAttachNameToNode (Op); } - - diff --git a/source/compiler/aslopt.c b/source/compiler/aslopt.c index b31c587..fedc5ff 100644 --- a/source/compiler/aslopt.c +++ b/source/compiler/aslopt.c @@ -127,9 +127,9 @@ OptSearchToRoot ( /* - * Check if search-to-root can be utilized. Use the last NameSeg of + * Check if search-to-root can be utilized. Use the last NameSeg of * the NamePath and 1) See if can be found and 2) If found, make - * sure that it is the same node that we want. If there is another + * sure that it is the same node that we want. If there is another * name in the search path before the one we want, the nodes will * not match, and we cannot use this optimization. */ @@ -149,7 +149,7 @@ OptSearchToRoot ( /* * We found the name, but we must check to make sure that the node - * matches. Otherwise, there is another identical name in the search + * matches. Otherwise, there is another identical name in the search * path that precludes the use of this optimization. */ if (Node != TargetNode) @@ -233,7 +233,7 @@ OptBuildShortestPath ( /* * Determine the maximum number of NameSegs that the Target and Current paths - * can possibly have in common. (To optimize, we have to have at least 1) + * can possibly have in common. (To optimize, we have to have at least 1) * * Note: The external NamePath string lengths are always a multiple of 5 * (ACPI_NAME_SIZE + separator) @@ -254,12 +254,11 @@ OptBuildShortestPath ( { /* Compare two single NameSegs */ - if (ACPI_STRNCMP ( - &((char *) TargetPath->Pointer)[(NumCommonSegments * - ACPI_PATH_SEGMENT_LENGTH) + 1], - &((char *) CurrentPath->Pointer)[(NumCommonSegments * - ACPI_PATH_SEGMENT_LENGTH) + 1], - ACPI_NAME_SIZE)) + if (!ACPI_COMPARE_NAME ( + &((char *) TargetPath->Pointer)[ + (NumCommonSegments * ACPI_PATH_SEGMENT_LENGTH) + 1], + &((char *) CurrentPath->Pointer)[ + (NumCommonSegments * ACPI_PATH_SEGMENT_LENGTH) + 1])) { /* Mismatch */ @@ -371,7 +370,7 @@ OptBuildShortestPath ( /* * Check to make sure that the optimization finds the node we are - * looking for. This is simply a sanity check on the new + * looking for. This is simply a sanity check on the new * path that has been created. */ Status = AcpiNsLookup (&ScopeInfo, NewPath, @@ -453,7 +452,7 @@ OptOptimizeNameDeclaration ( { /* * The current scope is the root, and the namepath has a root prefix - * that is therefore extraneous. Remove it. + * that is therefore extraneous. Remove it. */ *NewPath = &AmlNameString[1]; @@ -470,7 +469,7 @@ OptOptimizeNameDeclaration ( /* * Check to make sure that the optimization finds the node we are - * looking for. This is simply a sanity check on the new + * looking for. This is simply a sanity check on the new * path that has been created. * * We know that we are at the root, so NULL is used for the scope. @@ -533,7 +532,7 @@ OptOptimizeNameDeclaration ( * AmlNameString - Unoptimized namepath * TargetNode - Node to which AmlNameString refers * - * RETURN: None. If path is optimized, the Op is updated with new path + * RETURN: None. If path is optimized, the Op is updated with new path * * DESCRIPTION: Optimize a Named Declaration or Reference to the minimal length. * Must take into account both the current location in the @@ -608,7 +607,7 @@ OptOptimizeNamePath ( /* * We need to obtain the node that represents the current scope -- where - * we are right now in the namespace. We will compare this path + * we are right now in the namespace. We will compare this path * against the Namepath, looking for commonality. */ CurrentNode = AcpiGbl_RootNode; @@ -741,7 +740,7 @@ OptOptimizeNamePath ( /* * Success from above indicates that the NamePath was successfully - * optimized. We need to update the parse op with the new name + * optimized. We need to update the parse op with the new name */ if (ACPI_SUCCESS (Status)) { @@ -803,4 +802,3 @@ OptOptimizeNamePath ( ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "\n")); return_VOID; } - diff --git a/source/compiler/aslresource.c b/source/compiler/aslresource.c index 8dbbb26..9337e88 100644 --- a/source/compiler/aslresource.c +++ b/source/compiler/aslresource.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslresource - Resource template/descriptor utilities @@ -398,7 +397,7 @@ RsGetStringDataLength ( InitializerOp = ASL_GET_PEER_NODE (InitializerOp); } - return 0; + return (0); } @@ -449,7 +448,7 @@ RsAllocateResourceNode ( * RETURN: None, sets fields within the input node * * DESCRIPTION: Utility function to generate a named bit field within a - * resource descriptor. Mark a node as 1) a field in a resource + * resource descriptor. Mark a node as 1) a field in a resource * descriptor, and 2) set the value to be a BIT offset * ******************************************************************************/ @@ -484,8 +483,8 @@ RsCreateResourceField ( * RETURN: Sets bits within the *Flags output byte. * * DESCRIPTION: Set a bit in a cumulative flags word from an initialization - * node. Will use a default value if the node is DEFAULT, meaning - * that no value was specified in the ASL. Used to merge multiple + * node. Will use a default value if the node is DEFAULT, meaning + * that no value was specified in the ASL. Used to merge multiple * keywords into a single flags byte. * ******************************************************************************/ @@ -929,7 +928,7 @@ RsLinkDescriptorChain ( if (!Rnode) { - return 0; + return (0); } /* Point the previous node to the new node */ @@ -949,7 +948,7 @@ RsLinkDescriptorChain ( /* Previous node becomes the last node in the chain */ *PreviousRnode = LastRnode; - return CurrentByteOffset; + return (CurrentByteOffset); } @@ -959,7 +958,7 @@ RsLinkDescriptorChain ( * * PARAMETERS: Op - Parent of a resource template list * - * RETURN: None. Sets input node to point to a list of AML code + * RETURN: None. Sets input node to point to a list of AML code * * DESCRIPTION: Merge a list of resource descriptors into a single AML buffer, * in preparation for output to the AML output file. @@ -1016,7 +1015,7 @@ RsDoResourceTemplate ( /* * Update current byte offset to indicate the number of bytes from the - * start of the buffer. Buffer can include multiple descriptors, we + * start of the buffer. Buffer can include multiple descriptors, we * must keep track of the offset of not only each descriptor, but each * element (field) within each descriptor as well. */ diff --git a/source/compiler/aslrestype1.c b/source/compiler/aslrestype1.c index d7ec6c4..7374645 100644 --- a/source/compiler/aslrestype1.c +++ b/source/compiler/aslrestype1.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslrestype1 - Miscellaneous small resource descriptors @@ -498,7 +497,7 @@ RsDoStartDependentDescriptor ( /* * Update current byte offset to indicate the number of bytes from the - * start of the buffer. Buffer can include multiple descriptors, we + * start of the buffer. Buffer can include multiple descriptors, we * must keep track of the offset of not only each descriptor, but each * element (field) within each descriptor as well. */ @@ -563,7 +562,7 @@ RsDoStartDependentNoPriDescriptor ( /* * Update current byte offset to indicate the number of bytes from the - * start of the buffer. Buffer can include multiple descriptors, we + * start of the buffer. Buffer can include multiple descriptors, we * must keep track of the offset of not only each descriptor, but each * element (field) within each descriptor as well. */ @@ -650,4 +649,3 @@ RsDoVendorSmallDescriptor ( Descriptor->VendorSmall.DescriptorType |= (UINT8) i; return (Rnode); } - diff --git a/source/compiler/aslrestype1i.c b/source/compiler/aslrestype1i.c index 1178fd0..d242879 100644 --- a/source/compiler/aslrestype1i.c +++ b/source/compiler/aslrestype1i.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslrestype1i - Small I/O-related resource descriptors diff --git a/source/compiler/aslrestype2d.c b/source/compiler/aslrestype2d.c index 8887e39..f0c5755 100644 --- a/source/compiler/aslrestype2d.c +++ b/source/compiler/aslrestype2d.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslrestype2d - Large DWord address resource descriptors diff --git a/source/compiler/aslrestype2e.c b/source/compiler/aslrestype2e.c index 5da5291..f1321fb 100644 --- a/source/compiler/aslrestype2e.c +++ b/source/compiler/aslrestype2e.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslrestype2e - Large Extended address resource descriptors diff --git a/source/compiler/aslrestype2q.c b/source/compiler/aslrestype2q.c index 473f259..4d92fe8 100644 --- a/source/compiler/aslrestype2q.c +++ b/source/compiler/aslrestype2q.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslrestype2q - Large QWord address resource descriptors diff --git a/source/compiler/aslrestype2w.c b/source/compiler/aslrestype2w.c index 154de2f..01d241e 100644 --- a/source/compiler/aslrestype2w.c +++ b/source/compiler/aslrestype2w.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslrestype2w - Large Word address resource descriptors diff --git a/source/compiler/aslstartup.c b/source/compiler/aslstartup.c index 1f51c71..4d556f2 100644 --- a/source/compiler/aslstartup.c +++ b/source/compiler/aslstartup.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslstartup - Compiler startup routines, called from main @@ -231,8 +230,12 @@ AslDetectSourceFileType ( if (ACPI_FAILURE (Status)) { printf ("Non-ascii input file - %s\n", Info->Filename); - Type = ASL_INPUT_TYPE_BINARY; - goto Cleanup; + + if (!Gbl_IgnoreErrors) + { + Type = ASL_INPUT_TYPE_BINARY; + goto Cleanup; + } } /* diff --git a/source/compiler/aslstubs.c b/source/compiler/aslstubs.c index cf6e410..918c97a 100644 --- a/source/compiler/aslstubs.c +++ b/source/compiler/aslstubs.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslstubs - Stubs used to link to Aml interpreter @@ -62,7 +61,7 @@ ACPI_PHYSICAL_ADDRESS AeLocalGetRootPointer ( void) { - return 0; + return (0); } void diff --git a/source/compiler/aslsupport.l b/source/compiler/aslsupport.l index eef9411..daab402 100644 --- a/source/compiler/aslsupport.l +++ b/source/compiler/aslsupport.l @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslsupport.l - Flex/lex scanner C support routines. @@ -167,8 +166,8 @@ ResetAndExit: * RETURN: 0 if a node was popped, -1 otherwise * * DESCRIPTION: Pop the top of the input file stack and point the parser to - * the saved parse buffer contained in the fnode. Also, set the - * global line counters to the saved values. This function is + * the saved parse buffer contained in the fnode. Also, set the + * global line counters to the saved values. This function is * called when an include file reaches EOF. * ******************************************************************************/ @@ -223,7 +222,7 @@ AslPopInputFileStack ( * RETURN: None * * DESCRIPTION: Push the InputFile onto the file stack, and point the parser - * to this file. Called when an include file is successfully + * to this file. Called when an include file is successfully * opened. * ******************************************************************************/ @@ -325,7 +324,7 @@ AslInsertLineBuffer ( Gbl_InputByteCount++; - /* Handle tabs. Convert to spaces */ + /* Handle tabs. Convert to spaces */ if (SourceChar == '\t') { @@ -580,7 +579,7 @@ DoCharacter: { case '\\': /* - * Special handling for backslash-escape sequence. We will + * Special handling for backslash-escape sequence. We will * toss the backslash and translate the escape char(s). */ State = ASL_ESCAPE_SEQUENCE; @@ -669,7 +668,7 @@ DoCharacter: (i > 2)) { /* - * Reached end of the constant. Convert the assembled ASCII + * Reached end of the constant. Convert the assembled ASCII * string and resume processing of the next character */ ConvertBuffer[i] = 0; @@ -714,7 +713,7 @@ DoCharacter: (i > 1)) { /* - * Reached end of the constant. Convert the assembled ASCII + * Reached end of the constant. Convert the assembled ASCII * string and resume processing of the next character */ ConvertBuffer[i] = 0; diff --git a/source/compiler/asltransform.c b/source/compiler/asltransform.c index 4a5900f..64ebc06 100644 --- a/source/compiler/asltransform.c +++ b/source/compiler/asltransform.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: asltransform - Parse tree transforms @@ -100,7 +99,7 @@ TrDoSwitch ( * * RETURN: A pointer to name (allocated here). * - * DESCRIPTION: Generate an ACPI name of the form _T_x. These names are + * DESCRIPTION: Generate an ACPI name of the form _T_x. These names are * reserved for use by the ASL compiler. (_T_0 through _T_Z) * ******************************************************************************/ @@ -281,7 +280,7 @@ TrAmlTransformWalk ( * * RETURN: None * - * DESCRIPTION: Prepare nodes to be output as AML data and operands. The more + * DESCRIPTION: Prepare nodes to be output as AML data and operands. The more * complex AML opcodes require processing of the child nodes * (arguments/operands). * @@ -332,7 +331,7 @@ TrTransformSubtree ( * RETURN: None * * DESCRIPTION: Find the end of the definition block and set a global to this - * node. It is used by the compiler to insert compiler-generated + * node. It is used by the compiler to insert compiler-generated * names at the root level of the namespace. * ******************************************************************************/ @@ -376,7 +375,7 @@ TrDoDefinitionBlock ( * RETURN: None * * - * DESCRIPTION: Translate ASL SWITCH statement to if/else pairs. There is + * DESCRIPTION: Translate ASL SWITCH statement to if/else pairs. There is * no actual AML opcode for SWITCH -- it must be simulated. * ******************************************************************************/ @@ -574,7 +573,7 @@ TrDoSwitch ( else { /* - * The IF is a child of previous IF/ELSE. It + * The IF is a child of previous IF/ELSE. It * is therefore without peer. */ CurrentParentNode->Asl.Child = Conditional; @@ -737,7 +736,7 @@ TrDoSwitch ( /* * Transform the Switch() into a While(One)-Break node. * And create a Store() node which will be used to save the - * Switch() value. The store is of the form: Store (Value, _T_x) + * Switch() value. The store is of the form: Store (Value, _T_x) * where _T_x is the temp variable. */ TrAmlInitNode (StartNode, PARSEOP_WHILE); @@ -778,5 +777,3 @@ TrDoSwitch ( BreakOp->Asl.Parent = StartNode; TrAmlInsertPeer (Conditional, BreakOp); } - - diff --git a/source/compiler/asltree.c b/source/compiler/asltree.c index 12223b6..e5fa600 100644 --- a/source/compiler/asltree.c +++ b/source/compiler/asltree.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: asltree - parse tree management @@ -121,7 +120,7 @@ TrAllocateNode ( Op->Asl.Column = Gbl_CurrentColumn; UtSetParseOpName (Op); - return Op; + return (Op); } @@ -171,7 +170,7 @@ TrUpdateNode ( if (!Op) { - return NULL; + return (NULL); } DbgPrint (ASL_PARSE_OUTPUT, @@ -234,7 +233,7 @@ TrUpdateNode ( break; } - return Op; + return (Op); } @@ -336,7 +335,7 @@ TrSetNodeFlags ( if (!Op) { - return NULL; + return (NULL); } Op->Asl.CompileFlags |= Flags; @@ -370,7 +369,7 @@ TrSetNodeAmlLength ( if (!Op) { - return NULL; + return (NULL); } Op->Asl.AmlLength = Length; @@ -434,7 +433,7 @@ TrCreateLeafNode ( "\nCreateLeafNode Ln/Col %u/%u NewNode %p Op %s\n\n", Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode)); - return Op; + return (Op); } @@ -580,7 +579,7 @@ TrCreateValuedLeafNode ( } DbgPrint (ASL_PARSE_OUTPUT, "\n\n"); - return Op; + return (Op); } @@ -702,7 +701,7 @@ TrCreateNode ( va_end(ap); DbgPrint (ASL_PARSE_OUTPUT, "\n\n"); - return Op; + return (Op); } @@ -776,7 +775,7 @@ TrLinkChildren ( { AslError (ASL_WARNING, ASL_MSG_COMPILER_INTERNAL, Child, "Child node list invalid"); - return Op; + return (Op); } DbgPrint (ASL_PARSE_OUTPUT, "%p, ", Child); @@ -825,7 +824,7 @@ TrLinkChildren ( va_end(ap); DbgPrint (ASL_PARSE_OUTPUT, "\n\n"); - return Op; + return (Op); } @@ -859,19 +858,19 @@ TrLinkPeerNode ( if ((!Op1) && (!Op2)) { DbgPrint (ASL_PARSE_OUTPUT, "\nTwo Null nodes!\n"); - return Op1; + return (Op1); } /* If one of the nodes is null, just return the non-null node */ if (!Op2) { - return Op1; + return (Op1); } if (!Op1) { - return Op2; + return (Op2); } if (Op1 == Op2) @@ -881,7 +880,7 @@ TrLinkPeerNode ( Op1); AslError (ASL_WARNING, ASL_MSG_COMPILER_INTERNAL, Op1, "Linking node to itself"); - return Op1; + return (Op1); } Op1->Asl.Parent = Op2->Asl.Parent; @@ -898,7 +897,7 @@ TrLinkPeerNode ( } Next->Asl.Next = Op2; - return Op1; + return (Op1); } @@ -994,7 +993,7 @@ TrLinkChildNode ( if (!Op1 || !Op2) { - return Op1; + return (Op1); } Op1->Asl.Child = Op2; @@ -1008,7 +1007,7 @@ TrLinkChildNode ( Next = Next->Asl.Next; } - return Op1; + return (Op1); } @@ -1236,5 +1235,3 @@ TrWalkParseTree ( return (AE_OK); } - - diff --git a/source/compiler/asltypes.h b/source/compiler/asltypes.h index b9f4fbe..0e3b16a 100644 --- a/source/compiler/asltypes.h +++ b/source/compiler/asltypes.h @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: asltypes.h - compiler data types and struct definitions diff --git a/source/compiler/aslutils.c b/source/compiler/aslutils.c index 43bf823..ac749c4 100644 --- a/source/compiler/aslutils.c +++ b/source/compiler/aslutils.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslutils -- compiler utilities @@ -54,7 +53,6 @@ ACPI_MODULE_NAME ("aslutils") - /* Local prototypes */ static void @@ -569,7 +567,7 @@ UtCheckIntegerRange ( if (!Op) { - return NULL; + return (NULL); } if ((Op->Asl.Value.Integer < LowValue) || @@ -833,12 +831,12 @@ UtAttachNameseg ( Name++; } - /* Remaing string should be one single nameseg */ + /* Remaining string should be one single nameseg */ UtPadNameWithUnderscores (Name, PaddedNameSeg); } - strncpy (Op->Asl.NameSeg, PaddedNameSeg, 4); + ACPI_MOVE_NAME (Op->Asl.NameSeg, PaddedNameSeg); } diff --git a/source/compiler/aslwalks.c b/source/compiler/aslwalks.c index d98806c..dce037e 100644 --- a/source/compiler/aslwalks.c +++ b/source/compiler/aslwalks.c @@ -566,7 +566,7 @@ AnMethodAnalysisWalkEnd ( /* * If there is a peer node after the return statement, then this * node is unreachable code -- i.e., it won't be executed because of - * the preceeding Return() statement. + * the preceding Return() statement. */ if (Op->Asl.Next) { diff --git a/source/compiler/dtcompile.c b/source/compiler/dtcompile.c index 8536400..e67f3e6 100644 --- a/source/compiler/dtcompile.c +++ b/source/compiler/dtcompile.c @@ -109,7 +109,7 @@ DtDoCompile ( if (Gbl_PreprocessOnly) { - return AE_OK; + return (AE_OK); } /* diff --git a/source/compiler/dtio.c b/source/compiler/dtio.c index aa9cd7b..9d1bcb2 100644 --- a/source/compiler/dtio.c +++ b/source/compiler/dtio.c @@ -577,7 +577,7 @@ DtGetNextLine ( break; default: /* Not a comment */ - i++; /* Save the preceeding slash */ + i++; /* Save the preceding slash */ if (i >= Gbl_LineBufferSize) { UtExpandLineBuffers (); @@ -1008,7 +1008,7 @@ DtWriteTableToListing ( AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n", ACPI_RAW_TABLE_DATA_HEADER, Gbl_TableLength, Gbl_TableLength); - AcpiUtDumpBuffer2 (Buffer, Gbl_TableLength, DB_BYTE_DISPLAY); + AcpiUtDumpBuffer (Buffer, Gbl_TableLength, DB_BYTE_DISPLAY, 0); AcpiOsRedirectOutput (stdout); } diff --git a/source/compiler/dttable.c b/source/compiler/dttable.c index d6baa53..2e8ac0a 100644 --- a/source/compiler/dttable.c +++ b/source/compiler/dttable.c @@ -872,7 +872,7 @@ DtCompileHest ( } } - return AE_OK; + return (AE_OK); } @@ -1184,8 +1184,8 @@ DtCompileMpst ( ACPI_MPST_POWER_NODE *MpstPowerNode; ACPI_MPST_DATA_HDR *MpstDataHeader; UINT16 SubtableCount; - UINT8 PowerStateCount; - UINT8 ComponentCount; + UINT32 PowerStateCount; + UINT32 ComponentCount; /* Main table */ diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h index 4d43704..1a817cd 100644 --- a/source/compiler/dttemplate.h +++ b/source/compiler/dttemplate.h @@ -539,20 +539,29 @@ const unsigned char TemplateMchi[] = const unsigned char TemplateMpst[] = { - 0x4D,0x50,0x53,0x54,0x6E,0x00,0x00,0x00, /* 00000000 "MPSTn..." */ - 0x01,0x98,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x4D,0x50,0x53,0x54,0xB6,0x00,0x00,0x00, /* 00000000 "MPST...." */ + 0x01,0x77,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".wINTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x04,0x08,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ - 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x13,0x09,0x12,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ + 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ - 0x00,0x00,0x02,0x03,0x00,0x00,0x00,0x00, /* 00000040 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ - 0x01,0x00,0x41,0x00,0x00,0x00,0x00,0x00, /* 00000050 "..A....." */ + 0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 00000040 "........" */ + 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ + 0x00,0x00,0x01,0x00,0x02,0x00,0x00,0x00, /* 00000050 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00 /* 00000068 "......" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000068 "........" */ + 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ + 0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00, /* 00000078 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */ + 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00 /* 000000B0 "......" */ }; const unsigned char TemplateMsct[] = diff --git a/source/compiler/new_table.txt b/source/compiler/new_table.txt new file mode 100644 index 0000000..1e48d38 --- /dev/null +++ b/source/compiler/new_table.txt @@ -0,0 +1,88 @@ +How to add a new ACPI table to ACPICA and the iASL compiler. +------------------------------------------------------------ + +There are four main tasks that are needed to provide support for a +new ACPI table: + 1) Create a full definition of the table and any subtables + in the ACPICA headers. + 2) Add disassembler support for the new table + 3) Add iASL table compiler support for the new table + 4) Create a default template for the new table for iASL -T + option. + +Notes for each of these tasks provided below. + + +1) Header Support +----------------- + +New tables should be added to the appropriate header: + actbl2.h: Used for new tables that are not defined in the ACPI spec. + actbl3.h: Used for new tables that are defined in the ACPI spec. + +Use ACPI_TABLE_HEADER for the common ACPI table header. +Subtables should be defined separately from the main table. +Don't add placeholder fields for subtables and other multiple data items. + (Don't use xxxxx[1] for a field that can have multiple items.) + The disassembler and data table compiler depends on this. +For tables not defined in the ACPI spec, add a comment to indicate where + the table came from. +Use other table definitions for additional guidance. + + +2) iASL Disassembler Support +---------------------------- + +Add definition of the table (and subtables) in common/dmtbinfo.c +Add table access macro(s) of the form ACPI_xxxx_OFFSET +Add ACPI_DMT_TERMINATOR at the end of every table/subtable definition + +Add externals for the table/subtable definitions in acdisasm.h +Add an entry for the new table in the AcpiDmTableData in common/dmtable.c + +If there are no subtables, add the AcpiDmTableInfoXXXX name to the + AcpiDmTableData and it will automatically be disassembled. + +If there are subtables, a dump routine must be written: +Add an AcpiDmDumpXXXX function to dmtbdump.c -- note, code for another + similar table can often be ported for the new table. +Add an external for this function to acdisasm.h +Add this function to the AcpiDmTableData entry for the new ACPI table + +Debug/Test: Either find an existing example of the new ACPI table, or + create one using the "generic ACPI table support" included in the + iASL data table compiler. Use the -G option to force a + generic compile. It is often best to create the table from scratch, + since this clearly exposes the dependencies (lengths, offsets, etc.) + that the Table Compiler support will need to generate. + + +3) iASL Table Compiler Support +------------------------------ + +Simple tables do not require a compile routine. The definition of the + table in common/dmtbinfo.c (created in step 2 above) will suffice. + +Complex tables with subtables will require a compile routine with a name + of the form DtCompileXXXX. +Add a DtCompileXXXX function to the dttable.c module. +Add an external for this function in dtcompiler.h +Add this function to the AcpiDmTableData entry for the new ACPI table + in common/dmtable.c + + +4) Template Support (-T iASL option) +------------------------------------ + +Create an example of the new ACPI table. This example should create + multiple subtables (if supported), and multiple instances of any + variable length data. + +Compile the example file with the -sc option. This will create a C + array that contains the table contents. + +Add this array to the dttemplate.h file. Name the array TemplateXXXX. +Add this array name to the AcpiDmTableData entry for the new ACPI table + +Debug/Test: Create the template file. Compile the file. Disassemble the file. + Compile the disassembly file. diff --git a/source/compiler/prutils.c b/source/compiler/prutils.c index b0e1e14..9ec851a 100644 --- a/source/compiler/prutils.c +++ b/source/compiler/prutils.c @@ -413,8 +413,8 @@ PrPushInputFileStack ( * RETURN: 0 if a node was popped, -1 otherwise * * DESCRIPTION: Pop the top of the input file stack and point the parser to - * the saved parse buffer contained in the fnode. Also, set the - * global line counters to the saved values. This function is + * the saved parse buffer contained in the fnode. Also, set the + * global line counters to the saved values. This function is * called when an include file reaches EOF. * ******************************************************************************/ diff --git a/source/compiler/readme.txt b/source/compiler/readme.txt index 882993b..d891cd1 100644 --- a/source/compiler/readme.txt +++ b/source/compiler/readme.txt @@ -1,33 +1,96 @@ +/* + * Miscellaneous instructions for building and using the iASL compiler. + */ -Instructions for integrating iASL compiler into MS VC++ environment. +1) Generating iASL from source +------------------------------ -1a) Integration as a custom tool -------------------------------- +Generation of the ASL compiler from source code requires these items: + + 1) The ACPICA source code tree. + 2) An ANSI C compiler. + 3) The Flex (or Lex) lexical analyzer generator. + 4) The Bison (or Yacc) parser generator. + +There are three major ACPICA source code components that are required to +generate the compiler (Basically, the entire ACPICA source tree should +be installed): + + 1) The ASL compiler source. + 2) The ACPICA Core Subsystem source. In particular, the Namespace + Manager component is used to create an internal ACPI namespace + and symbol table, and the AML Interpreter is used to evaluate + constant expressions. + 3) The "common" source directory that is used for all ACPI components. + +On Linux/Unix systems, the following commands will build the compiler: + + cd acpica (or cd acpica/generate/unix) + make clean + make iasl + +On Windows, the Visual Studio 2008 project file appears in this directory: + + generate/msvc9/AcpiComponents.sln + + + +1a) Notes for Windows GNU Flex and GNU Bison +-------------------------------------------- + +The Windows versions of GNU Flex/Bison must be installed, and they must +be installed in a directory that contains no embedded spaces in the +pathname. They cannot be installed in the default "c:\Program Files" +directory. This is a bug in Bison. The default Windows project file for +iASL assumes that these tools are installed at this location: + + c:\GnuWin32 + +Once the tools are installed, ensure that this path is added to the +default system $PATH environment variable: + + c:\GnuWin32\bin + +At this point, you will need to reboot Windows to make system aware of +the updated $PATH. + +iASL has been generated with these versions of Flex/Bison for Windows: + + Flex for Windows: V2.5.4 + Bison for Windows: V2.4.1 + +Flex is available at: http://gnuwin32.sourceforge.net/packages/flex.htm +Bison is available at: http://gnuwin32.sourceforge.net/packages/bison.htm + + + +2) Integration as a custom tool for Visual Studio +------------------------------------------------- This procedure adds the iASL compiler as a custom tool that can be used -to compile ASL source files. The output is sent to the VC output +to compile ASL source files. The output is sent to the VC output window. a) Select Tools->Customize. b) Select the "Tools" tab. -c) Scroll down to the bottom of the "Menu Contents" window. There you - will see an empty rectangle. Click in the rectangle to enter a +c) Scroll down to the bottom of the "Menu Contents" window. There you + will see an empty rectangle. Click in the rectangle to enter a name for this tool. -d) Type "iASL Compiler" in the box and hit enter. You can now edit +d) Type "iASL Compiler" in the box and hit enter. You can now edit the other fields for this new custom tool. e) Enter the following into the fields: Command: C:\Acpi\iasl.exe - Arguments: -e "$(FilePath)" + Arguments: -vi "$(FilePath)" Initial Directory "$(FileDir)" Use Output Window <Check this option> "Command" must be the path to wherever you copied the compiler. - "-e" instructs the compiler to produce messages appropriate for VC. + "-vi" instructs the compiler to produce messages appropriate for VC. Quotes around FilePath and FileDir enable spaces in filenames. f) Select "Close". @@ -35,12 +98,13 @@ f) Select "Close". These steps will add the compiler to the tools menu as a custom tool. By enabling "Use Output Window", you can click on error messages in the output window and the source file and source line will be -automatically displayed by VC. Also, you can use F4 to step through +automatically displayed by VC. Also, you can use F4 to step through the messages and the corresponding source line(s). -1b) Integration into a project build ------------------------------------- + +3) Integrating iASL into a Visual Studio ASL project build +---------------------------------------------------------- This procedure creates a project that compiles ASL files to AML. @@ -50,63 +114,7 @@ b) For all ASL files in the project, specify a custom build (under Project/Settings/CustomBuild with the following settings (or similar): Commands: -c:\acpi\libraries\iasl.exe -vs -vi "$(InputPath)" + c:\acpi\libraries\iasl.exe -vs -vi "$(InputPath)" Output: -$(InputDir)\$(InputPath).aml - - - -2) Compiler Generation From Source -------------------------------- - -Generation of the ASL compiler from source code requires these items: - - -2a) Required Tools --------------- - -1) The Flex (or Lex) lexical analyzer generator. -2) The Bison (or Yacc) parser generator. -3) An ANSI C compiler. - - -Windows GNU Flex and GNU Bison Notes: - -GNU Flex/Bison must be installed in a directory that has no embedded -spaces in the name. They cannot be installed in the default -c:\"Program Files" directory. This is a bug in Bison. The default -Windows project file for iASL assumes that these tools are -installed at c:\GnuWin32. - -When installed, ensure that c:\GnuWin32\bin is added to the default -system $PATH environment variable. - -iASL has been generated with these versions on Windows: - - Flex for Windows: V2.5.4 - Bison for Windows: V2.4.1 - - -Flex is available at: http://gnuwin32.sourceforge.net/packages/flex.htm -Bison is available at: http://gnuwin32.sourceforge.net/packages/bison.htm - - -2b) Required Source Code --------------------- - -There are three major source code components that are required to -generate the compiler: - -1) The ASL compiler source. -2) The ACPICA Core Subsystem source. In particular, the Namespace Manager - component is used to create an internal ACPI namespace and symbol table, - and the AML Interpreter is used to evaluate constant expressions. -3) The Common source for all ACPI components. - - - - - - - + $(InputDir)\$(InputPath).aml diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c index 0e9d78d..5cd4178 100644 --- a/source/components/debugger/dbcmds.c +++ b/source/components/debugger/dbcmds.c @@ -91,7 +91,7 @@ AcpiDbDeviceResources ( * * RETURN: Pointer to a NS node * - * DESCRIPTION: Convert a string to a valid NS pointer. Handles numeric or + * DESCRIPTION: Convert a string to a valid NS pointer. Handles numeric or * alpha strings. * ******************************************************************************/ @@ -194,13 +194,13 @@ AcpiDbSleep ( goto ErrorExit; } - return (Status); + return_ACPI_STATUS (Status); ErrorExit: ACPI_EXCEPTION ((AE_INFO, Status, "During sleep test")); - return (Status); + return_ACPI_STATUS (Status); } @@ -240,7 +240,7 @@ AcpiDbDisplayLocks ( * * RETURN: None * - * DESCRIPTION: Display information about loaded tables. Current + * DESCRIPTION: Display information about loaded tables. Current * implementation displays all loaded tables. * ******************************************************************************/ @@ -382,7 +382,7 @@ AcpiDbUnloadAcpiTable ( * * RETURN: None * - * DESCRIPTION: Send an ACPI notification. The value specified is sent to the + * DESCRIPTION: Send an ACPI notification. The value specified is sent to the * named object as an ACPI notify. * ******************************************************************************/ @@ -577,7 +577,7 @@ AcpiDbDisplayTemplate ( DumpBuffer: AcpiOsPrintf ("\nRaw data buffer:\n"); - AcpiUtDumpBuffer ((UINT8 *) Node->Object->Buffer.Pointer, + AcpiUtDebugDumpBuffer ((UINT8 *) Node->Object->Buffer.Pointer, Node->Object->Buffer.Length, DB_BYTE_DISPLAY, ACPI_UINT32_MAX); diff --git a/source/components/debugger/dbdisply.c b/source/components/debugger/dbdisply.c index b58cb1c..a9943a0 100644 --- a/source/components/debugger/dbdisply.c +++ b/source/components/debugger/dbdisply.c @@ -176,7 +176,7 @@ AcpiDbDumpParserDescriptor ( * * FUNCTION: AcpiDbDecodeAndDisplayObject * - * PARAMETERS: Target - String with object to be displayed. Names + * PARAMETERS: Target - String with object to be displayed. Names * and hex pointers are supported. * OutputType - Byte, Word, Dword, or Qword (B|W|D|Q) * @@ -270,7 +270,7 @@ AcpiDbDecodeAndDisplayObject ( return; } - AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), Display, + AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX); AcpiExDumpObjectDescriptor (ObjPtr, 1); break; @@ -287,7 +287,7 @@ AcpiDbDecodeAndDisplayObject ( return; } - AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display, + AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display, ACPI_UINT32_MAX); AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr); break; @@ -305,7 +305,7 @@ AcpiDbDecodeAndDisplayObject ( /* Just dump some memory */ - AcpiUtDumpBuffer (ObjPtr, Size, Display, ACPI_UINT32_MAX); + AcpiUtDebugDumpBuffer (ObjPtr, Size, Display, ACPI_UINT32_MAX); break; } @@ -342,7 +342,7 @@ DumpNode: return; } - AcpiUtDumpBuffer ((void *) Node, sizeof (ACPI_NAMESPACE_NODE), + AcpiUtDebugDumpBuffer ((void *) Node, sizeof (ACPI_NAMESPACE_NODE), Display, ACPI_UINT32_MAX); AcpiExDumpNamespaceNode (Node, 1); @@ -357,7 +357,7 @@ DumpNode: return; } - AcpiUtDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT), + AcpiUtDebugDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX); AcpiExDumpObjectDescriptor (ObjDesc, 1); } @@ -643,7 +643,7 @@ AcpiDbDisplayCallingTree ( * * FUNCTION: AcpiDbDisplayObjectType * - * PARAMETERS: ObjectArg - User entered NS node handle + * PARAMETERS: Name - User entered NS node handle or name * * RETURN: None * @@ -653,17 +653,21 @@ AcpiDbDisplayCallingTree ( void AcpiDbDisplayObjectType ( - char *ObjectArg) + char *Name) { - ACPI_HANDLE Handle; + ACPI_NAMESPACE_NODE *Node; ACPI_DEVICE_INFO *Info; ACPI_STATUS Status; UINT32 i; - Handle = ACPI_TO_POINTER (ACPI_STRTOUL (ObjectArg, NULL, 16)); + Node = AcpiDbConvertToNode (Name); + if (!Node) + { + return; + } - Status = AcpiGetObjectInfo (Handle, &Info); + Status = AcpiGetObjectInfo (ACPI_CAST_PTR (ACPI_HANDLE, Node), &Info); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get object info, %s\n", @@ -671,18 +675,25 @@ AcpiDbDisplayObjectType ( return; } - AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n", - ACPI_FORMAT_UINT64 (Info->Address), - Info->CurrentStatus, Info->Flags); - - AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n", - Info->HighestDstates[0], Info->HighestDstates[1], - Info->HighestDstates[2], Info->HighestDstates[3]); - - AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n", - Info->LowestDstates[0], Info->LowestDstates[1], - Info->LowestDstates[2], Info->LowestDstates[3], - Info->LowestDstates[4]); + if (Info->Valid & ACPI_VALID_ADR) + { + AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n", + ACPI_FORMAT_UINT64 (Info->Address), + Info->CurrentStatus, Info->Flags); + } + if (Info->Valid & ACPI_VALID_SXDS) + { + AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n", + Info->HighestDstates[0], Info->HighestDstates[1], + Info->HighestDstates[2], Info->HighestDstates[3]); + } + if (Info->Valid & ACPI_VALID_SXWS) + { + AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n", + Info->LowestDstates[0], Info->LowestDstates[1], + Info->LowestDstates[2], Info->LowestDstates[3], + Info->LowestDstates[4]); + } if (Info->Valid & ACPI_VALID_HID) { @@ -692,6 +703,10 @@ AcpiDbDisplayObjectType ( { AcpiOsPrintf ("UID: %s\n", Info->UniqueId.String); } + if (Info->Valid & ACPI_VALID_SUB) + { + AcpiOsPrintf ("SUB: %s\n", Info->SubsystemId.String); + } if (Info->Valid & ACPI_VALID_CID) { for (i = 0; i < Info->CompatibleIdList.Count; i++) diff --git a/source/components/debugger/dbexec.c b/source/components/debugger/dbexec.c index d8ec3d3..1644fc2 100644 --- a/source/components/debugger/dbexec.c +++ b/source/components/debugger/dbexec.c @@ -674,7 +674,7 @@ AcpiDbGetOutstandingAllocations ( * * RETURN: Status * - * DESCRIPTION: Execute a control method. Name is relative to the current + * DESCRIPTION: Execute a control method. Name is relative to the current * scope. * ******************************************************************************/ @@ -862,8 +862,8 @@ AcpiDbDumpPldBuffer ( { AcpiOsPrintf ("Converted _PLD buffer does not compare. New:\n"); - AcpiUtDumpBuffer2 (NewBuffer, - BufferDesc->Buffer.Length, DB_BYTE_DISPLAY); + AcpiUtDumpBuffer (NewBuffer, + BufferDesc->Buffer.Length, DB_BYTE_DISPLAY, 0); } /* First 32-bit dword */ @@ -924,7 +924,7 @@ AcpiDbDumpPldBuffer ( * * RETURN: None * - * DESCRIPTION: Execute a control method. Name is relative to the current + * DESCRIPTION: Execute a control method. Name is relative to the current * scope. * ******************************************************************************/ @@ -1058,7 +1058,7 @@ AcpiDbExecute ( * * RETURN: None * - * DESCRIPTION: Debugger execute thread. Waits for a command line, then + * DESCRIPTION: Debugger execute thread. Waits for a command line, then * simply dispatches it. * ******************************************************************************/ @@ -1329,5 +1329,3 @@ CleanupAndExit: } #endif /* ACPI_DEBUGGER */ - - diff --git a/source/components/debugger/dbfileio.c b/source/components/debugger/dbfileio.c index 9845ff4..7b0870d 100644 --- a/source/components/debugger/dbfileio.c +++ b/source/components/debugger/dbfileio.c @@ -328,9 +328,9 @@ AcpiDbReadTable ( #ifdef ACPI_OBSOLETE_CODE /* We only support a limited number of table types */ - if (ACPI_STRNCMP ((char *) TableHeader.Signature, DSDT_SIG, 4) && - ACPI_STRNCMP ((char *) TableHeader.Signature, PSDT_SIG, 4) && - ACPI_STRNCMP ((char *) TableHeader.Signature, SSDT_SIG, 4)) + if (!ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_DSDT) && + !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_PSDT) && + !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_SSDT)) { AcpiOsPrintf ("Table signature [%4.4s] is invalid or not supported\n", (char *) TableHeader.Signature); @@ -588,4 +588,3 @@ AcpiDbGetTableFromFile ( } #endif /* ACPI_DEBUGGER */ - diff --git a/source/components/debugger/dbhistry.c b/source/components/debugger/dbhistry.c index 536b69c..571ed3f 100644 --- a/source/components/debugger/dbhistry.c +++ b/source/components/debugger/dbhistry.c @@ -217,4 +217,3 @@ AcpiDbGetFromHistory ( } #endif /* ACPI_DEBUGGER */ - diff --git a/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c index 2d48171..a431ddc 100644 --- a/source/components/debugger/dbinput.c +++ b/source/components/debugger/dbinput.c @@ -457,7 +457,7 @@ AcpiDbDisplayHelp ( * * RETURN: Pointer to the start of the next token. * - * DESCRIPTION: Command line parsing. Get the next token on the command line + * DESCRIPTION: Command line parsing. Get the next token on the command line * ******************************************************************************/ @@ -610,7 +610,7 @@ AcpiDbGetNextToken ( * * RETURN: Count of arguments to the command * - * DESCRIPTION: Get the next command line from the user. Gets entire line + * DESCRIPTION: Get the next command line from the user. Gets entire line * up to the next newline * ******************************************************************************/ @@ -1083,7 +1083,7 @@ AcpiDbCommandDispatch ( * * RETURN: None * - * DESCRIPTION: Debugger execute thread. Waits for a command line, then + * DESCRIPTION: Debugger execute thread. Waits for a command line, then * simply dispatches it. * ******************************************************************************/ @@ -1126,7 +1126,7 @@ AcpiDbExecuteThread ( * * RETURN: None * - * DESCRIPTION: Debugger execute thread. Waits for a command line, then + * DESCRIPTION: Debugger execute thread. Waits for a command line, then * simply dispatches it. * ******************************************************************************/ @@ -1152,7 +1152,7 @@ AcpiDbSingleThread ( * * RETURN: None * - * DESCRIPTION: Command line execution for the AML debugger. Commands are + * DESCRIPTION: Command line execution for the AML debugger. Commands are * matched and dispatched here. * ******************************************************************************/ @@ -1231,4 +1231,3 @@ AcpiDbUserCommands ( } #endif /* ACPI_DEBUGGER */ - diff --git a/source/components/debugger/dbnames.c b/source/components/debugger/dbnames.c index 0393e6b..a51c08d 100644 --- a/source/components/debugger/dbnames.c +++ b/source/components/debugger/dbnames.c @@ -208,7 +208,7 @@ ErrorExit: * * RETURN: None * - * DESCRIPTION: Dump entire namespace or a subtree. Each node is displayed + * DESCRIPTION: Dump entire namespace or a subtree. Each node is displayed * with type and other information. * ******************************************************************************/ @@ -305,7 +305,7 @@ AcpiDbDumpNamespaceByOwner ( * * RETURN: Status * - * DESCRIPTION: Find a particular name/names within the namespace. Wildcards + * DESCRIPTION: Find a particular name/names within the namespace. Wildcards * are supported -- '?' matches any character. * ******************************************************************************/ diff --git a/source/components/debugger/dbstats.c b/source/components/debugger/dbstats.c index 64c847a..9bcc963 100644 --- a/source/components/debugger/dbstats.c +++ b/source/components/debugger/dbstats.c @@ -314,7 +314,7 @@ AcpiDbClassifyOneObject ( AcpiGbl_NodeTypeCount [Type]++; } - return AE_OK; + return (AE_OK); #ifdef ACPI_FUTURE_IMPLEMENTATION diff --git a/source/components/debugger/dbutils.c b/source/components/debugger/dbutils.c index 36a6d20..947dd9d 100644 --- a/source/components/debugger/dbutils.c +++ b/source/components/debugger/dbutils.c @@ -117,7 +117,7 @@ AcpiDbMatchArgument ( * * RETURN: None * - * DESCRIPTION: Set the current destination for debugger output. Also sets + * DESCRIPTION: Set the current destination for debugger output. Also sets * the debug output level accordingly. * ******************************************************************************/ @@ -204,7 +204,7 @@ AcpiDbDumpExternalObject ( { AcpiOsPrintf ("\n"); } - AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), + AcpiUtDebugDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), ObjDesc->Buffer.Length, DB_BYTE_DISPLAY, _COMPONENT); } else @@ -316,7 +316,7 @@ AcpiDbPrepNamestring ( * * DESCRIPTION: Lookup a name in the ACPI namespace * - * Note: Currently begins search from the root. Could be enhanced to use + * Note: Currently begins search from the root. Could be enhanced to use * the current prefix (scope) node as the search beginning point. * ******************************************************************************/ @@ -407,7 +407,7 @@ AcpiDbUint32ToHexString ( * * RETURN: Status * - * DESCRIPTION: Second pass parse of the ACPI tables. We need to wait until + * DESCRIPTION: Second pass parse of the ACPI tables. We need to wait until * second pass to parse the control methods * ******************************************************************************/ @@ -513,11 +513,9 @@ AcpiDbDumpBuffer ( AcpiOsPrintf ("\nLocation %X:\n", Address); AcpiDbgLevel |= ACPI_LV_TABLES; - AcpiUtDumpBuffer (ACPI_TO_POINTER (Address), 64, DB_BYTE_DISPLAY, + AcpiUtDebugDumpBuffer (ACPI_TO_POINTER (Address), 64, DB_BYTE_DISPLAY, ACPI_UINT32_MAX); } #endif #endif /* ACPI_DEBUGGER */ - - diff --git a/source/components/debugger/dbxface.c b/source/components/debugger/dbxface.c index cd30273..0a7b946 100644 --- a/source/components/debugger/dbxface.c +++ b/source/components/debugger/dbxface.c @@ -231,7 +231,7 @@ AcpiDbSingleStep ( switch (OpcodeClass) { case AML_CLASS_UNKNOWN: - case AML_CLASS_ARGUMENT: /* constants, literals, etc. do nothing */ + case AML_CLASS_ARGUMENT: /* constants, literals, etc. do nothing */ return (AE_OK); default: diff --git a/source/components/disassembler/dmbuffer.c b/source/components/disassembler/dmbuffer.c index d0a66ef..43134ab 100644 --- a/source/components/disassembler/dmbuffer.c +++ b/source/components/disassembler/dmbuffer.c @@ -421,7 +421,7 @@ AcpiDmIsPldBuffer ( * ******************************************************************************/ -#define ACPI_PLD_OUTPUT "%*.s/* %18s : %-6.2X */\n", ACPI_MUL_4 (Level), " " +#define ACPI_PLD_OUTPUT08 "%*.s/* %18s : %-6.2X */\n", ACPI_MUL_4 (Level), " " #define ACPI_PLD_OUTPUT16 "%*.s/* %18s : %-6.4X */\n", ACPI_MUL_4 (Level), " " #define ACPI_PLD_OUTPUT24 "%*.s/* %18s : %-6.6X */\n", ACPI_MUL_4 (Level), " " @@ -452,8 +452,8 @@ AcpiDmPldBuffer ( /* First 32-bit dword */ - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Revision", PldInfo->Revision); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "IgnoreColor", PldInfo->IgnoreColor); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Revision", PldInfo->Revision); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "IgnoreColor", PldInfo->IgnoreColor); AcpiOsPrintf (ACPI_PLD_OUTPUT24,"Color", PldInfo->Color); /* Second 32-bit dword */ @@ -463,27 +463,27 @@ AcpiDmPldBuffer ( /* Third 32-bit dword */ - AcpiOsPrintf (ACPI_PLD_OUTPUT, "UserVisible", PldInfo->UserVisible); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Dock", PldInfo->Dock); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Lid", PldInfo->Lid); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Panel", PldInfo->Panel); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "VerticalPosition", PldInfo->VerticalPosition); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "HorizontalPosition", PldInfo->HorizontalPosition); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Shape", PldInfo->Shape); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupOrientation", PldInfo->GroupOrientation); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupToken", PldInfo->GroupToken); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupPosition", PldInfo->GroupPosition); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Bay", PldInfo->Bay); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "UserVisible", PldInfo->UserVisible); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Dock", PldInfo->Dock); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Lid", PldInfo->Lid); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Panel", PldInfo->Panel); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "VerticalPosition", PldInfo->VerticalPosition); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "HorizontalPosition", PldInfo->HorizontalPosition); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Shape", PldInfo->Shape); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "GroupOrientation", PldInfo->GroupOrientation); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "GroupToken", PldInfo->GroupToken); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "GroupPosition", PldInfo->GroupPosition); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Bay", PldInfo->Bay); /* Fourth 32-bit dword */ - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Ejectable", PldInfo->Ejectable); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "OspmEjectRequired", PldInfo->OspmEjectRequired); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "CabinetNumber", PldInfo->CabinetNumber); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "CardCageNumber", PldInfo->CardCageNumber); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Reference", PldInfo->Reference); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Rotation", PldInfo->Rotation); - AcpiOsPrintf (ACPI_PLD_OUTPUT, "Order", PldInfo->Order); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Ejectable", PldInfo->Ejectable); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "OspmEjectRequired", PldInfo->OspmEjectRequired); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "CabinetNumber", PldInfo->CabinetNumber); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "CardCageNumber", PldInfo->CardCageNumber); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Reference", PldInfo->Reference); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Rotation", PldInfo->Rotation); + AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Order", PldInfo->Order); /* Fifth 32-bit dword */ @@ -505,7 +505,7 @@ AcpiDmPldBuffer ( * * RETURN: None * - * DESCRIPTION: Dump Unicode string as a standard ASCII string. (Remove + * DESCRIPTION: Dump Unicode string as a standard ASCII string. (Remove * the extra zero bytes). * ******************************************************************************/ diff --git a/source/components/disassembler/dmnames.c b/source/components/disassembler/dmnames.c index 92e67c2..7284721 100644 --- a/source/components/disassembler/dmnames.c +++ b/source/components/disassembler/dmnames.c @@ -128,7 +128,7 @@ AcpiDmDumpName ( * * RETURN: Status * - * DESCRIPTION: Diplay the pathname associated with a named object. Two + * DESCRIPTION: Diplay the pathname associated with a named object. Two * versions. One searches the parse tree (for parser-only * applications suchas AcpiDump), and the other searches the * ACPI namespace (the parse tree is probably deleted) @@ -166,7 +166,7 @@ AcpiPsDisplayObjectPathname ( { /* * We can't get the pathname since the object - * is not in the namespace. This can happen during single + * is not in the namespace. This can happen during single * stepping where a dynamic named object is *about* to be created. */ AcpiOsPrintf (" [Path not found]"); @@ -437,9 +437,9 @@ AcpiDmValidateName ( if (!TargetOp) { /* - * Didn't find the name in the parse tree. This may be + * Didn't find the name in the parse tree. This may be * a problem, or it may simply be one of the predefined names - * (such as _OS_). Rather than worry about looking up all + * (such as _OS_). Rather than worry about looking up all * the predefined names, just display the name as given */ AcpiOsPrintf ( @@ -449,5 +449,3 @@ AcpiDmValidateName ( #endif #endif - - diff --git a/source/components/disassembler/dmobject.c b/source/components/disassembler/dmobject.c index cb515e9..1eec0e7 100644 --- a/source/components/disassembler/dmobject.c +++ b/source/components/disassembler/dmobject.c @@ -181,7 +181,7 @@ AcpiDmDumpMethodInfo ( * * RETURN: None * - * DESCRIPTION: Short display of an internal object. Numbers/Strings/Buffers. + * DESCRIPTION: Short display of an internal object. Numbers/Strings/Buffers. * ******************************************************************************/ @@ -585,5 +585,3 @@ AcpiDmDisplayArguments ( } #endif - - diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c index caebe26..9d61b02 100644 --- a/source/components/disassembler/dmopcode.c +++ b/source/components/disassembler/dmopcode.c @@ -46,7 +46,6 @@ #include "acparser.h" #include "amlcode.h" #include "acdisasm.h" -#include "acnamesp.h" #ifdef ACPI_DISASSEMBLER @@ -633,7 +632,7 @@ AcpiDmDisassembleOneOp ( case AML_BUFFER_OP: /* - * Determine the type of buffer. We can have one of the following: + * Determine the type of buffer. We can have one of the following: * * 1) ResourceTemplate containing Resource Descriptors. * 2) Unicode String buffer diff --git a/source/components/disassembler/dmresrc.c b/source/components/disassembler/dmresrc.c index 9c07bf7..470be95 100644 --- a/source/components/disassembler/dmresrc.c +++ b/source/components/disassembler/dmresrc.c @@ -371,7 +371,7 @@ AcpiDmResourceTemplate ( * RETURN: Status. AE_OK if valid template * * DESCRIPTION: Walk a byte list to determine if it consists of a valid set - * of resource descriptors. Nothing is output. + * of resource descriptors. Nothing is output. * ******************************************************************************/ diff --git a/source/components/disassembler/dmresrcl2.c b/source/components/disassembler/dmresrcl2.c index e79307e..afa1f5c 100644 --- a/source/components/disassembler/dmresrcl2.c +++ b/source/components/disassembler/dmresrcl2.c @@ -697,4 +697,3 @@ AcpiDmSerialBusDescriptor ( } #endif - diff --git a/source/components/disassembler/dmresrcs.c b/source/components/disassembler/dmresrcs.c index 32759d9..d3b1dd8 100644 --- a/source/components/disassembler/dmresrcs.c +++ b/source/components/disassembler/dmresrcs.c @@ -355,4 +355,3 @@ AcpiDmVendorSmallDescriptor ( } #endif - diff --git a/source/components/disassembler/dmutils.c b/source/components/disassembler/dmutils.c index ce3443e..b529b88 100644 --- a/source/components/disassembler/dmutils.c +++ b/source/components/disassembler/dmutils.c @@ -252,7 +252,7 @@ AcpiDmCommaIfListMember ( if (!Op->Common.Next) { - return FALSE; + return (FALSE); } if (AcpiDmListType (Op->Common.Parent) & BLOCK_COMMA_LIST) @@ -264,20 +264,20 @@ AcpiDmCommaIfListMember ( { /* * To handle the Divide() case where there are two optional - * targets, look ahead one more op. If null, this null target - * is the one and only target -- no comma needed. Otherwise, + * targets, look ahead one more op. If null, this null target + * is the one and only target -- no comma needed. Otherwise, * we need a comma to prepare for the next target. */ if (!Op->Common.Next->Common.Next) { - return FALSE; + return (FALSE); } } if ((Op->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST) && (!(Op->Common.Next->Common.DisasmFlags & ACPI_PARSEOP_PARAMLIST))) { - return FALSE; + return (FALSE); } AcpiOsPrintf (", "); diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c index 6a6b95e..0fa4049 100644 --- a/source/components/disassembler/dmwalk.c +++ b/source/components/disassembler/dmwalk.c @@ -98,7 +98,7 @@ AcpiDmBlockType ( * * RETURN: None * - * DESCRIPTION: Disassemble parser object and its children. This is the + * DESCRIPTION: Disassemble parser object and its children. This is the * main entry point of the disassembler. * ******************************************************************************/ @@ -773,7 +773,7 @@ AcpiDmDescendingOp ( * RETURN: Status * * DESCRIPTION: Second visitation of a parse object, during ascent of parse - * tree. Close out any parameter lists and complete the opcode. + * tree. Close out any parameter lists and complete the opcode. * ******************************************************************************/ diff --git a/source/components/dispatcher/dscontrol.c b/source/components/dispatcher/dscontrol.c index 5c5c51a..ec2fa43 100644 --- a/source/components/dispatcher/dscontrol.c +++ b/source/components/dispatcher/dscontrol.c @@ -290,7 +290,7 @@ AcpiDsExecEndControlOp ( /* * Get the return value and save as the last result - * value. This is the only place where WalkState->ReturnDesc + * value. This is the only place where WalkState->ReturnDesc * is set to anything other than zero! */ WalkState->ReturnDesc = WalkState->Operands[0]; diff --git a/source/components/dispatcher/dsfield.c b/source/components/dispatcher/dsfield.c index e3e05b9..cf2abb5 100644 --- a/source/components/dispatcher/dsfield.c +++ b/source/components/dispatcher/dsfield.c @@ -305,7 +305,7 @@ Cleanup: * * RETURN: Status * - * DESCRIPTION: Process all named fields in a field declaration. Names are + * DESCRIPTION: Process all named fields in a field declaration. Names are * entered into the namespace. * ******************************************************************************/ @@ -828,5 +828,3 @@ AcpiDsCreateIndexField ( Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next); return_ACPI_STATUS (Status); } - - diff --git a/source/components/dispatcher/dsinit.c b/source/components/dispatcher/dsinit.c index 1c7ad88..114404b 100644 --- a/source/components/dispatcher/dsinit.c +++ b/source/components/dispatcher/dsinit.c @@ -73,7 +73,7 @@ AcpiDsInitOneObject ( * * RETURN: Status * - * DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every object + * DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every object * within the namespace. * * Currently, the only objects that require initialization are: @@ -234,5 +234,3 @@ AcpiDsInitializeObjects ( return_ACPI_STATUS (AE_OK); } - - diff --git a/source/components/dispatcher/dsmethod.c b/source/components/dispatcher/dsmethod.c index 670382a..4f79010 100644 --- a/source/components/dispatcher/dsmethod.c +++ b/source/components/dispatcher/dsmethod.c @@ -183,7 +183,7 @@ AcpiDsCreateMethodMutex ( * * RETURN: Status * - * DESCRIPTION: Prepare a method for execution. Parses the method if necessary, + * DESCRIPTION: Prepare a method for execution. Parses the method if necessary, * increments the thread count, and waits at the method semaphore * for clearance to execute. * @@ -480,7 +480,7 @@ Cleanup: * RETURN: Status * * DESCRIPTION: Restart a method that was preempted by another (nested) method - * invocation. Handle the return value (if any) from the callee. + * invocation. Handle the return value (if any) from the callee. * ******************************************************************************/ @@ -570,7 +570,7 @@ AcpiDsRestartControlMethod ( * * RETURN: None * - * DESCRIPTION: Terminate a control method. Delete everything that the method + * DESCRIPTION: Terminate a control method. Delete everything that the method * created, delete all locals and arguments, and delete the parse * tree if requested. * @@ -722,5 +722,3 @@ AcpiDsTerminateControlMethod ( return_VOID; } - - diff --git a/source/components/dispatcher/dsmthdat.c b/source/components/dispatcher/dsmthdat.c index b4509e7..aeabe74 100644 --- a/source/components/dispatcher/dsmthdat.c +++ b/source/components/dispatcher/dsmthdat.c @@ -86,7 +86,7 @@ AcpiDsMethodDataGetType ( * RETURN: Status * * DESCRIPTION: Initialize the data structures that hold the method's arguments - * and locals. The data struct is an array of namespace nodes for + * and locals. The data struct is an array of namespace nodes for * each - this allows RefOf and DeRefOf to work properly for these * special data types. * @@ -143,7 +143,7 @@ AcpiDsMethodDataInit ( * * RETURN: None * - * DESCRIPTION: Delete method locals and arguments. Arguments are only + * DESCRIPTION: Delete method locals and arguments. Arguments are only * deleted if this method was called from another method. * ******************************************************************************/ @@ -202,7 +202,7 @@ AcpiDsMethodDataDeleteAll ( * * RETURN: Status * - * DESCRIPTION: Initialize arguments for a method. The parameter list is a list + * DESCRIPTION: Initialize arguments for a method. The parameter list is a list * of ACPI operand objects, either null terminated or whose length * is defined by MaxParamCount. * @@ -443,7 +443,7 @@ AcpiDsMethodDataGetValue ( * This means that either 1) The expected argument was * not passed to the method, or 2) A local variable * was referenced by the method (via the ASL) - * before it was initialized. Either case is an error. + * before it was initialized. Either case is an error. */ /* If slack enabled, init the LocalX/ArgX to an Integer of value zero */ @@ -508,7 +508,7 @@ AcpiDsMethodDataGetValue ( * * RETURN: None * - * DESCRIPTION: Delete the entry at Opcode:Index. Inserts + * DESCRIPTION: Delete the entry at Opcode:Index. Inserts * a null into the stack slot after the object is deleted. * ******************************************************************************/ @@ -573,7 +573,7 @@ AcpiDsMethodDataDeleteValue ( * * RETURN: Status * - * DESCRIPTION: Store a value in an Arg or Local. The ObjDesc is installed + * DESCRIPTION: Store a value in an Arg or Local. The ObjDesc is installed * as the new value for the Arg or Local and the reference count * for ObjDesc is incremented. * @@ -621,7 +621,7 @@ AcpiDsStoreObjectToLocal ( /* * If the reference count on the object is more than one, we must - * take a copy of the object before we store. A reference count + * take a copy of the object before we store. A reference count * of exactly 1 means that the object was just created during the * evaluation of an expression, and we can safely use it since it * is not used anywhere else. @@ -768,5 +768,3 @@ AcpiDsMethodDataGetType ( return_VALUE (Object->Type); } #endif - - diff --git a/source/components/dispatcher/dsobject.c b/source/components/dispatcher/dsobject.c index b356776..24a5c09 100644 --- a/source/components/dispatcher/dsobject.c +++ b/source/components/dispatcher/dsobject.c @@ -296,7 +296,7 @@ AcpiDsBuildInternalBufferObj ( /* * Second arg is the buffer data (optional) ByteList can be either - * individual bytes or a string initializer. In either case, a + * individual bytes or a string initializer. In either case, a * ByteList appears in the AML. */ Arg = Op->Common.Value.Arg; /* skip first arg */ @@ -590,7 +590,7 @@ AcpiDsCreateNode ( /* * Because of the execution pass through the non-control-method - * parts of the table, we can arrive here twice. Only init + * parts of the table, we can arrive here twice. Only init * the named object node the first time through */ if (AcpiNsGetAttachedObject (Node)) @@ -643,7 +643,7 @@ AcpiDsCreateNode ( * RETURN: Status * * DESCRIPTION: Initialize a namespace object from a parser Op and its - * associated arguments. The namespace object is a more compact + * associated arguments. The namespace object is a more compact * representation of the Op and its arguments. * ******************************************************************************/ @@ -863,5 +863,3 @@ AcpiDsInitObjectFromOp ( return_ACPI_STATUS (Status); } - - diff --git a/source/components/dispatcher/dsopcode.c b/source/components/dispatcher/dsopcode.c index 6fd58d8..c888dfd 100644 --- a/source/components/dispatcher/dsopcode.c +++ b/source/components/dispatcher/dsopcode.c @@ -806,4 +806,3 @@ AcpiDsEvalBankFieldOperands ( AcpiUtRemoveReference (OperandDesc); return_ACPI_STATUS (Status); } - diff --git a/source/components/dispatcher/dsutils.c b/source/components/dispatcher/dsutils.c index 66431aa..2cabdc6 100644 --- a/source/components/dispatcher/dsutils.c +++ b/source/components/dispatcher/dsutils.c @@ -64,7 +64,7 @@ * * RETURN: None. * - * DESCRIPTION: Clear and remove a reference on an implicit return value. Used + * DESCRIPTION: Clear and remove a reference on an implicit return value. Used * to delete "stale" return values (if enabled, the return value * from every operator is saved at least momentarily, in case the * parent method exits.) @@ -117,7 +117,7 @@ AcpiDsClearImplicitReturn ( * * DESCRIPTION: Implements the optional "implicit return". We save the result * of every ASL operator and control method invocation in case the - * parent method exit. Before storing a new return value, we + * parent method exit. Before storing a new return value, we * delete the previous return value. * ******************************************************************************/ @@ -220,7 +220,7 @@ AcpiDsIsResultUsed ( * * If there is no parent, or the parent is a ScopeOp, we are executing * at the method level. An executing method typically has no parent, - * since each method is parsed separately. A method invoked externally + * since each method is parsed separately. A method invoked externally * via ExecuteControlMethod has a ScopeOp as the parent. */ if ((!Op->Common.Parent) || @@ -245,7 +245,7 @@ AcpiDsIsResultUsed ( } /* - * Decide what to do with the result based on the parent. If + * Decide what to do with the result based on the parent. If * the parent opcode will not use the result, delete the object. * Otherwise leave it as is, it will be deleted when it is used * as an operand later. @@ -290,7 +290,7 @@ AcpiDsIsResultUsed ( /* * These opcodes allow TermArg(s) as operands and therefore - * the operands can be method calls. The result is used. + * the operands can be method calls. The result is used. */ goto ResultUsed; @@ -307,7 +307,7 @@ AcpiDsIsResultUsed ( { /* * These opcodes allow TermArg(s) as operands and therefore - * the operands can be method calls. The result is used. + * the operands can be method calls. The result is used. */ goto ResultUsed; } @@ -354,9 +354,9 @@ ResultNotUsed: * * RETURN: Status * - * DESCRIPTION: Used after interpretation of an opcode. If there is an internal + * DESCRIPTION: Used after interpretation of an opcode. If there is an internal * result descriptor, check if the parent opcode will actually use - * this result. If not, delete the result now so that it will + * this result. If not, delete the result now so that it will * not become orphaned. * ******************************************************************************/ @@ -408,7 +408,7 @@ AcpiDsDeleteResultIfNotUsed ( * * RETURN: Status * - * DESCRIPTION: Resolve all operands to their values. Used to prepare + * DESCRIPTION: Resolve all operands to their values. Used to prepare * arguments to a control method invocation (a call from one * method to another.) * @@ -427,7 +427,7 @@ AcpiDsResolveOperands ( /* * Attempt to resolve each of the valid operands - * Method arguments are passed by reference, not by value. This means + * Method arguments are passed by reference, not by value. This means * that the actual objects are passed, not copies of the objects. */ for (i = 0; i < WalkState->NumOperands; i++) @@ -494,7 +494,7 @@ AcpiDsClearOperands ( * RETURN: Status * * DESCRIPTION: Translate a parse tree object that is an argument to an AML - * opcode to the equivalent interpreter object. This may include + * opcode to the equivalent interpreter object. This may include * looking up a name or entering a new name into the internal * namespace. * @@ -540,11 +540,11 @@ AcpiDsCreateOperand ( /* All prefixes have been handled, and the name is in NameString */ /* - * Special handling for BufferField declarations. This is a deferred + * Special handling for BufferField declarations. This is a deferred * opcode that unfortunately defines the field name as the last - * parameter instead of the first. We get here when we are performing + * parameter instead of the first. We get here when we are performing * the deferred execution, so the actual name of the field is already - * in the namespace. We don't want to attempt to look it up again + * in the namespace. We don't want to attempt to look it up again * because we may be executing in a different scope than where the * actual opcode exists. */ @@ -651,8 +651,8 @@ AcpiDsCreateOperand ( /* * If the name is null, this means that this is an * optional result parameter that was not specified - * in the original ASL. Create a Zero Constant for a - * placeholder. (Store to a constant is a Noop.) + * in the original ASL. Create a Zero Constant for a + * placeholder. (Store to a constant is a Noop.) */ Opcode = AML_ZERO_OP; /* Has no arguments! */ diff --git a/source/components/dispatcher/dswexec.c b/source/components/dispatcher/dswexec.c index 5732855..0d38b73 100644 --- a/source/components/dispatcher/dswexec.c +++ b/source/components/dispatcher/dswexec.c @@ -223,7 +223,7 @@ Cleanup: * RETURN: Status * * DESCRIPTION: Descending callback used during the execution of control - * methods. This is where most operators and operands are + * methods. This is where most operators and operands are * dispatched to the interpreter. * ****************************************************************************/ @@ -325,7 +325,7 @@ AcpiDsExecBeginOp ( { /* * Found a named object declaration during method execution; - * we must enter this object into the namespace. The created + * we must enter this object into the namespace. The created * object is temporary and will be deleted upon completion of * the execution of this method. * @@ -381,7 +381,7 @@ ErrorExit: * RETURN: Status * * DESCRIPTION: Ascending callback used during the execution of control - * methods. The only thing we really need to do here is to + * methods. The only thing we really need to do here is to * notice the beginning of IF, ELSE, and WHILE blocks. * ****************************************************************************/ @@ -469,7 +469,7 @@ AcpiDsExecEndOp ( { /* * Dispatch the request to the appropriate interpreter handler - * routine. There is one routine per opcode "type" based upon the + * routine. There is one routine per opcode "type" based upon the * number of opcode arguments and return type. */ Status = AcpiGbl_OpTypeDispatch[OpType] (WalkState); @@ -793,5 +793,3 @@ Cleanup: WalkState->NumOperands = 0; return_ACPI_STATUS (Status); } - - diff --git a/source/components/dispatcher/dswload2.c b/source/components/dispatcher/dswload2.c index 90d85d6..9c92e2c 100644 --- a/source/components/dispatcher/dswload2.c +++ b/source/components/dispatcher/dswload2.c @@ -266,7 +266,7 @@ AcpiDsLoad2BeginOp ( "Scope operator [%4.4s] (Cannot override)", AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node))); - return (AE_AML_OPERAND_TYPE); + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } break; @@ -625,7 +625,7 @@ AcpiDsLoad2EndOp ( RegionSpace, WalkState); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } AcpiExExitInterpreter (); @@ -758,4 +758,3 @@ Cleanup: WalkState->NumOperands = 0; return_ACPI_STATUS (Status); } - diff --git a/source/components/dispatcher/dswscope.c b/source/components/dispatcher/dswscope.c index a59fdc9..3bdfbed 100644 --- a/source/components/dispatcher/dswscope.c +++ b/source/components/dispatcher/dswscope.c @@ -235,5 +235,3 @@ AcpiDsScopeStackPop ( AcpiUtDeleteGenericState (ScopeInfo); return_ACPI_STATUS (AE_OK); } - - diff --git a/source/components/dispatcher/dswstate.c b/source/components/dispatcher/dswstate.c index dd11a18..0224021 100644 --- a/source/components/dispatcher/dswstate.c +++ b/source/components/dispatcher/dswstate.c @@ -385,7 +385,7 @@ AcpiDsObjStackPush ( * * RETURN: Status * - * DESCRIPTION: Pop this walk's object stack. Objects on the stack are NOT + * DESCRIPTION: Pop this walk's object stack. Objects on the stack are NOT * deleted by this routine. * ******************************************************************************/ @@ -549,7 +549,7 @@ AcpiDsPushWalkState ( * RETURN: A WalkState object popped from the thread's stack * * DESCRIPTION: Remove and return the walkstate object that is at the head of - * the walk stack for the given walk list. NULL indicates that + * the walk stack for the given walk list. NULL indicates that * the list is empty. * ******************************************************************************/ @@ -594,7 +594,7 @@ AcpiDsPopWalkState ( * * RETURN: Pointer to the new walk state. * - * DESCRIPTION: Allocate and initialize a new walk state. The current walk + * DESCRIPTION: Allocate and initialize a new walk state. The current walk * state is set to this new state. * ******************************************************************************/ @@ -730,7 +730,7 @@ AcpiDsInitAmlWalk ( /* * Setup the current scope. * Find a Named Op that has a namespace node associated with it. - * search upwards from this Op. Current scope is the first + * search upwards from this Op. Current scope is the first * Op with a namespace node. */ ExtraOp = ParserState->StartOp; @@ -790,14 +790,14 @@ AcpiDsDeleteWalkState ( if (!WalkState) { - return; + return_VOID; } if (WalkState->DescriptorType != ACPI_DESC_TYPE_WALK) { ACPI_ERROR ((AE_INFO, "%p is not a valid walk state", WalkState)); - return; + return_VOID; } /* There should not be any open scopes */ @@ -842,5 +842,3 @@ AcpiDsDeleteWalkState ( ACPI_FREE (WalkState); return_VOID; } - - diff --git a/source/components/events/evevent.c b/source/components/events/evevent.c index b5a7acd..45ed927 100644 --- a/source/components/events/evevent.c +++ b/source/components/events/evevent.c @@ -332,5 +332,3 @@ AcpiEvFixedEventDispatch ( } #endif /* !ACPI_REDUCED_HARDWARE */ - - diff --git a/source/components/events/evrgnini.c b/source/components/events/evrgnini.c index 92946b5..2dd9ebf 100644 --- a/source/components/events/evrgnini.c +++ b/source/components/events/evrgnini.c @@ -389,8 +389,8 @@ AcpiEvIsPciRootBridge ( ACPI_NAMESPACE_NODE *Node) { ACPI_STATUS Status; - ACPI_DEVICE_ID *Hid; - ACPI_DEVICE_ID_LIST *Cid; + ACPI_PNP_DEVICE_ID *Hid; + ACPI_PNP_DEVICE_ID_LIST *Cid; UINT32 i; BOOLEAN Match; @@ -729,4 +729,3 @@ AcpiEvInitializeRegion ( return_ACPI_STATUS (AE_NOT_EXIST); } - diff --git a/source/components/events/evxfgpe.c b/source/components/events/evxfgpe.c index 1e83d1d..118fb56 100644 --- a/source/components/events/evxfgpe.c +++ b/source/components/events/evxfgpe.c @@ -774,7 +774,7 @@ AcpiInstallGpeBlock ( Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } Node = AcpiNsValidateHandle (GpeDevice); @@ -867,7 +867,7 @@ AcpiRemoveGpeBlock ( Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } Node = AcpiNsValidateHandle (GpeDevice); diff --git a/source/components/events/evxfregn.c b/source/components/events/evxfregn.c index 493df92..26afaf3 100644 --- a/source/components/events/evxfregn.c +++ b/source/components/events/evxfregn.c @@ -310,4 +310,3 @@ UnlockAndExit: } ACPI_EXPORT_SYMBOL (AcpiRemoveAddressSpaceHandler) - diff --git a/source/components/executer/exconfig.c b/source/components/executer/exconfig.c index 581bc57..f0083ff 100644 --- a/source/components/executer/exconfig.c +++ b/source/components/executer/exconfig.c @@ -222,7 +222,7 @@ AcpiExLoadTableOp ( if (Operand[3]->String.Length > 0) { /* - * Find the node referenced by the RootPathString. This is the + * Find the node referenced by the RootPathString. This is the * location within the namespace where the table will be loaded. */ Status = AcpiNsGetNode (StartNode, Operand[3]->String.Pointer, @@ -685,4 +685,3 @@ AcpiExUnloadTable ( DdbHandle->Common.Flags &= ~AOPOBJ_DATA_VALID; return_ACPI_STATUS (AE_OK); } - diff --git a/source/components/executer/exconvrt.c b/source/components/executer/exconvrt.c index e79cbc9..81cde05c 100644 --- a/source/components/executer/exconvrt.c +++ b/source/components/executer/exconvrt.c @@ -750,5 +750,3 @@ AcpiExConvertToTargetType ( return_ACPI_STATUS (Status); } - - diff --git a/source/components/executer/excreate.c b/source/components/executer/excreate.c index 888ff7d..cd1ffc2 100644 --- a/source/components/executer/excreate.c +++ b/source/components/executer/excreate.c @@ -89,7 +89,7 @@ AcpiExCreateAlias ( { /* * Dereference an existing alias so that we don't create a chain - * of aliases. With this code, we guarantee that an alias is + * of aliases. With this code, we guarantee that an alias is * always exactly one level of indirection away from the * actual aliased name. */ @@ -99,7 +99,7 @@ AcpiExCreateAlias ( /* * For objects that can never change (i.e., the NS node will * permanently point to the same object), we can simply attach - * the object to the new NS node. For other objects (such as + * the object to the new NS node. For other objects (such as * Integers, buffers, etc.), we have to point the Alias node * to the original Node. */ @@ -147,7 +147,7 @@ AcpiExCreateAlias ( /* * The new alias assumes the type of the target, and it points - * to the same object. The reference count of the object has an + * to the same object. The reference count of the object has an * additional reference to prevent deletion out from under either the * target node or the alias Node */ @@ -570,5 +570,3 @@ Exit: AcpiUtRemoveReference (Operand[1]); return_ACPI_STATUS (Status); } - - diff --git a/source/components/executer/exdebug.c b/source/components/executer/exdebug.c index 166b2af..883c2ac 100644 --- a/source/components/executer/exdebug.c +++ b/source/components/executer/exdebug.c @@ -162,9 +162,9 @@ AcpiExDoDebugObject ( case ACPI_TYPE_BUFFER: AcpiOsPrintf ("[0x%.2X]\n", (UINT32) SourceDesc->Buffer.Length); - AcpiUtDumpBuffer2 (SourceDesc->Buffer.Pointer, + AcpiUtDumpBuffer (SourceDesc->Buffer.Pointer, (SourceDesc->Buffer.Length < 256) ? - SourceDesc->Buffer.Length : 256, DB_BYTE_DISPLAY); + SourceDesc->Buffer.Length : 256, DB_BYTE_DISPLAY, 0); break; case ACPI_TYPE_STRING: @@ -205,7 +205,7 @@ AcpiExDoDebugObject ( /* Case for DdbHandle */ AcpiOsPrintf ("Table Index 0x%X\n", SourceDesc->Reference.Value); - return; + return_VOID; default: break; @@ -274,5 +274,3 @@ AcpiExDoDebugObject ( return_VOID; } #endif - - diff --git a/source/components/executer/exdump.c b/source/components/executer/exdump.c index 0943e66..5e13849 100644 --- a/source/components/executer/exdump.c +++ b/source/components/executer/exdump.c @@ -828,7 +828,7 @@ AcpiExDumpOperands ( * PARAMETERS: Title - Descriptive text * Value - Value to be displayed * - * DESCRIPTION: Object dump output formatting functions. These functions + * DESCRIPTION: Object dump output formatting functions. These functions * reduce the number of format strings required and keeps them * all in one place for easy modification. * @@ -1015,7 +1015,7 @@ AcpiExDumpPackageObj ( AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length); if (ObjDesc->Buffer.Length) { - AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), + AcpiUtDebugDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT); } else @@ -1122,4 +1122,3 @@ AcpiExDumpObjectDescriptor ( } #endif - diff --git a/source/components/executer/exfield.c b/source/components/executer/exfield.c index a682406..9fa93cc 100644 --- a/source/components/executer/exfield.c +++ b/source/components/executer/exfield.c @@ -64,7 +64,7 @@ * * RETURN: Status * - * DESCRIPTION: Read from a named field. Returns either an Integer or a + * DESCRIPTION: Read from a named field. Returns either an Integer or a * Buffer, depending on the size of the field. * ******************************************************************************/ @@ -161,7 +161,7 @@ AcpiExReadDataFromField ( * Allocate a buffer for the contents of the field. * * If the field is larger than the current integer width, create - * a BUFFER to hold it. Otherwise, use an INTEGER. This allows + * a BUFFER to hold it. Otherwise, use an INTEGER. This allows * the use of arithmetic operators on the returned value if the * field size is equal or smaller than an Integer. * @@ -402,5 +402,3 @@ AcpiExWriteDataToField ( return_ACPI_STATUS (Status); } - - diff --git a/source/components/executer/exfldio.c b/source/components/executer/exfldio.c index e138e9a..2b84976 100644 --- a/source/components/executer/exfldio.c +++ b/source/components/executer/exfldio.c @@ -86,7 +86,7 @@ AcpiExSetupRegion ( * RETURN: Status * * DESCRIPTION: Common processing for AcpiExExtractFromField and - * AcpiExInsertIntoField. Initialize the Region if necessary and + * AcpiExInsertIntoField. Initialize the Region if necessary and * validate the request. * ******************************************************************************/ @@ -168,7 +168,7 @@ AcpiExSetupRegion ( #endif /* - * Validate the request. The entire request from the byte offset for a + * Validate the request. The entire request from the byte offset for a * length of one field datum (access width) must fit within the region. * (Region length is specified in bytes) */ @@ -197,7 +197,7 @@ AcpiExSetupRegion ( { /* * This is the case where the AccessType (AccWord, etc.) is wider - * than the region itself. For example, a region of length one + * than the region itself. For example, a region of length one * byte, and a field with Dword access specified. */ ACPI_ERROR ((AE_INFO, @@ -339,7 +339,7 @@ AcpiExAccessRegion ( * * DESCRIPTION: Check if a value is out of range of the field being written. * Used to check if the values written to Index and Bank registers - * are out of range. Normally, the value is simply truncated + * are out of range. Normally, the value is simply truncated * to fit the field, but this case is most likely a serious * coding error in the ASL. * @@ -392,7 +392,7 @@ AcpiExRegisterOverflow ( * * RETURN: Status * - * DESCRIPTION: Read or Write a single datum of a field. The FieldType is + * DESCRIPTION: Read or Write a single datum of a field. The FieldType is * demultiplexed here to handle the different types of fields * (BufferField, RegionField, IndexField, BankField) * @@ -906,7 +906,7 @@ AcpiExInsertIntoField ( ObjDesc->CommonField.BitLength); /* * We must have a buffer that is at least as long as the field - * we are writing to. This is because individual fields are + * we are writing to. This is because individual fields are * indivisible and partial writes are not supported -- as per * the ACPI specification. */ @@ -922,7 +922,7 @@ AcpiExInsertIntoField ( /* * Copy the original data to the new buffer, starting - * at Byte zero. All unused (upper) bytes of the + * at Byte zero. All unused (upper) bytes of the * buffer will be 0. */ ACPI_MEMCPY ((char *) NewBuffer, (char *) Buffer, BufferLength); @@ -1051,5 +1051,3 @@ Exit: } return_ACPI_STATUS (Status); } - - diff --git a/source/components/executer/exmisc.c b/source/components/executer/exmisc.c index 63114f5..1966aac 100644 --- a/source/components/executer/exmisc.c +++ b/source/components/executer/exmisc.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes @@ -278,7 +277,7 @@ AcpiExDoConcatenate ( /* - * Convert the second operand if necessary. The first operand + * Convert the second operand if necessary. The first operand * determines the type of the second operand, (See the Data Types * section of the ACPI specification.) Both object types are * guaranteed to be either Integer/String/Buffer by the operand @@ -630,7 +629,7 @@ AcpiExDoLogicalOp ( /* - * Convert the second operand if necessary. The first operand + * Convert the second operand if necessary. The first operand * determines the type of the second operand, (See the Data Types * section of the ACPI 3.0+ specification.) Both object types are * guaranteed to be either Integer/String/Buffer by the operand @@ -796,5 +795,3 @@ Cleanup: *LogicalResult = LocalResult; return_ACPI_STATUS (Status); } - - diff --git a/source/components/executer/exmutex.c b/source/components/executer/exmutex.c index 4c702b8..70ccfd0 100644 --- a/source/components/executer/exmutex.c +++ b/source/components/executer/exmutex.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exmutex - ASL Mutex Acquire/Release functions @@ -341,7 +340,7 @@ AcpiExReleaseMutexObject ( if (ObjDesc->Mutex.AcquisitionDepth == 0) { - return (AE_NOT_ACQUIRED); + return_ACPI_STATUS (AE_NOT_ACQUIRED); } /* Match multiple Acquires with multiple Releases */ @@ -515,7 +514,7 @@ AcpiExReleaseAllMutexes ( ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_FUNCTION_ENTRY (); + ACPI_FUNCTION_NAME (ExReleaseAllMutexes); /* Traverse the list of owned mutexes, releasing each one */ @@ -529,6 +528,9 @@ AcpiExReleaseAllMutexes ( ObjDesc->Mutex.Next = NULL; ObjDesc->Mutex.AcquisitionDepth = 0; + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "Force-releasing held mutex: %p\n", ObjDesc)); + /* Release the mutex, special case for Global Lock */ if (ObjDesc == AcpiGbl_GlobalLockMutex) diff --git a/source/components/executer/exnames.c b/source/components/executer/exnames.c index c3cb6b0..0d0b6e2 100644 --- a/source/components/executer/exnames.c +++ b/source/components/executer/exnames.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exnames - interpreter/scanner name load/execute @@ -73,7 +72,7 @@ AcpiExNameSegment ( * (-1)==root, 0==none * NumNameSegs - count of 4-character name segments * - * RETURN: A pointer to the allocated string segment. This segment must + * RETURN: A pointer to the allocated string segment. This segment must * be deleted by the caller. * * DESCRIPTION: Allocate a buffer for a name string. Ensure allocated name @@ -484,5 +483,3 @@ AcpiExGetNameString ( return_ACPI_STATUS (Status); } - - diff --git a/source/components/executer/exoparg1.c b/source/components/executer/exoparg1.c index 9a6cd9f..6f683cd 100644 --- a/source/components/executer/exoparg1.c +++ b/source/components/executer/exoparg1.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exoparg1 - AML execution - opcodes with 1 argument @@ -668,7 +667,7 @@ AcpiExOpcode_1A_0T_1R ( } /* - * Set result to ONES (TRUE) if Value == 0. Note: + * Set result to ONES (TRUE) if Value == 0. Note: * ReturnDesc->Integer.Value is initially == 0 (FALSE) from above. */ if (!Operand[0]->Integer.Value) @@ -682,7 +681,7 @@ AcpiExOpcode_1A_0T_1R ( case AML_INCREMENT_OP: /* Increment (Operand) */ /* - * Create a new integer. Can't just get the base integer and + * Create a new integer. Can't just get the base integer and * increment it because it may be an Arg or Field. */ ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); @@ -750,7 +749,7 @@ AcpiExOpcode_1A_0T_1R ( /* * Note: The operand is not resolved at this point because we want to - * get the associated object, not its value. For example, we don't + * get the associated object, not its value. For example, we don't * want to resolve a FieldUnit to its value, we want the actual * FieldUnit object. */ @@ -792,7 +791,7 @@ AcpiExOpcode_1A_0T_1R ( /* * The type of the base object must be integer, buffer, string, or - * package. All others are not supported. + * package. All others are not supported. * * NOTE: Integer is not specifically supported by the ACPI spec, * but is supported implicitly via implicit operand conversion. @@ -1030,7 +1029,7 @@ AcpiExOpcode_1A_0T_1R ( case ACPI_TYPE_PACKAGE: /* - * Return the referenced element of the package. We must + * Return the referenced element of the package. We must * add another reference to the referenced object, however. */ ReturnDesc = *(Operand[0]->Reference.Where); @@ -1108,4 +1107,3 @@ Cleanup: return_ACPI_STATUS (Status); } - diff --git a/source/components/executer/exoparg2.c b/source/components/executer/exoparg2.c index b76da75..6ff7c49 100644 --- a/source/components/executer/exoparg2.c +++ b/source/components/executer/exoparg2.c @@ -137,7 +137,7 @@ AcpiExOpcode_2A_0T_0R ( /* * Dispatch the notify to the appropriate handler * NOTE: the request is queued for execution after this method - * completes. The notify handlers are NOT invoked synchronously + * completes. The notify handlers are NOT invoked synchronously * from this thread -- because handlers may in turn run other * control methods. */ @@ -638,5 +638,3 @@ Cleanup: return_ACPI_STATUS (Status); } - - diff --git a/source/components/executer/exoparg3.c b/source/components/executer/exoparg3.c index 0edac68..42aae03 100644 --- a/source/components/executer/exoparg3.c +++ b/source/components/executer/exoparg3.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exoparg3 - AML execution - opcodes with 3 arguments @@ -179,7 +178,7 @@ AcpiExOpcode_3A_1T_1R ( case AML_MID_OP: /* Mid (Source[0], Index[1], Length[2], Result[3]) */ /* - * Create the return object. The Source operand is guaranteed to be + * Create the return object. The Source operand is guaranteed to be * either a String or a Buffer, so just use its type. */ ReturnDesc = AcpiUtCreateInternalObject ( @@ -300,5 +299,3 @@ Cleanup: } return_ACPI_STATUS (Status); } - - diff --git a/source/components/executer/exoparg6.c b/source/components/executer/exoparg6.c index bfc6585..b667815 100644 --- a/source/components/executer/exoparg6.c +++ b/source/components/executer/exoparg6.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exoparg6 - AML execution - opcodes with 6 arguments @@ -209,7 +208,7 @@ AcpiExDoMatch ( return (FALSE); } - return LogicalResult; + return (LogicalResult); } @@ -288,7 +287,7 @@ AcpiExOpcode_6A_0T_1R ( * and the next should be examined. * * Upon finding a match, the loop will terminate via "break" at - * the bottom. If it terminates "normally", MatchValue will be + * the bottom. If it terminates "normally", MatchValue will be * ACPI_UINT64_MAX (Ones) (its initial value) indicating that no * match was found. */ diff --git a/source/components/executer/exprep.c b/source/components/executer/exprep.c index 6b8f691..2f62e9d 100644 --- a/source/components/executer/exprep.c +++ b/source/components/executer/exprep.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities @@ -87,8 +86,8 @@ AcpiExGenerateAccess ( * AnyAcc keyword. * * NOTE: Need to have the RegionLength in order to check for boundary - * conditions (end-of-region). However, the RegionLength is a deferred - * operation. Therefore, to complete this implementation, the generation + * conditions (end-of-region). However, the RegionLength is a deferred + * operation. Therefore, to complete this implementation, the generation * of this access width must be deferred until the region length has * been evaluated. * @@ -326,7 +325,7 @@ AcpiExDecodeFieldAccess ( * RETURN: Status * * DESCRIPTION: Initialize the areas of the field object that are common - * to the various types of fields. Note: This is very "sensitive" + * to the various types of fields. Note: This is very "sensitive" * code because we are solving the general case for field * alignment. * @@ -358,13 +357,13 @@ AcpiExPrepCommonFieldObject ( ObjDesc->CommonField.BitLength = FieldBitLength; /* - * Decode the access type so we can compute offsets. The access type gives + * Decode the access type so we can compute offsets. The access type gives * two pieces of information - the width of each field access and the * necessary ByteAlignment (address granularity) of the access. * * For AnyAcc, the AccessBitWidth is the largest width that is both * necessary and possible in an attempt to access the whole field in one - * I/O operation. However, for AnyAcc, the ByteAlignment is always one + * I/O operation. However, for AnyAcc, the ByteAlignment is always one * byte. * * For all Buffer Fields, the ByteAlignment is always one byte. @@ -386,7 +385,7 @@ AcpiExPrepCommonFieldObject ( /* * BaseByteOffset is the address of the start of the field within the - * region. It is the byte address of the first *datum* (field-width data + * region. It is the byte address of the first *datum* (field-width data * unit) of the field. (i.e., the first datum that contains at least the * first *bit* of the field.) * @@ -645,4 +644,3 @@ AcpiExPrepFieldValue ( AcpiUtRemoveReference (ObjDesc); return_ACPI_STATUS (Status); } - diff --git a/source/components/executer/exregion.c b/source/components/executer/exregion.c index 8a40250..f312046 100644 --- a/source/components/executer/exregion.c +++ b/source/components/executer/exregion.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exregion - ACPI default OpRegion (address space) handlers @@ -220,7 +219,7 @@ AcpiExSystemMemorySpaceHandler ( * Perform the memory read or write * * Note: For machines that do not support non-aligned transfers, the target - * address was checked for alignment above. We do not attempt to break the + * address was checked for alignment above. We do not attempt to break the * transfer up into smaller (byte-size) chunks because the AML specifically * asked for a transfer width that the hardware may require. */ @@ -561,5 +560,3 @@ AcpiExDataTableSpaceHandler ( return_ACPI_STATUS (AE_OK); } - - diff --git a/source/components/executer/exresnte.c b/source/components/executer/exresnte.c index 03962ed..d20b15f 100644 --- a/source/components/executer/exresnte.c +++ b/source/components/executer/exresnte.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exresnte - AML Interpreter object resolution @@ -62,8 +61,8 @@ * PARAMETERS: ObjectPtr - Pointer to a location that contains * a pointer to a NS node, and will receive a * pointer to the resolved object. - * WalkState - Current state. Valid only if executing AML - * code. NULL if simply resolving an object + * WalkState - Current state. Valid only if executing AML + * code. NULL if simply resolving an object * * RETURN: Status * @@ -71,7 +70,7 @@ * * Note: for some of the data types, the pointer attached to the Node * can be either a pointer to an actual internal object or a pointer into the - * AML stream itself. These types are currently: + * AML stream itself. These types are currently: * * ACPI_TYPE_INTEGER * ACPI_TYPE_STRING @@ -98,7 +97,7 @@ AcpiExResolveNodeToValue ( /* - * The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the + * The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the * object that is attached to the Node. */ Node = *ObjectPtr; @@ -298,5 +297,3 @@ AcpiExResolveNodeToValue ( *ObjectPtr = (void *) ObjDesc; return_ACPI_STATUS (Status); } - - diff --git a/source/components/executer/exresolv.c b/source/components/executer/exresolv.c index 72286b0..4421b17 100644 --- a/source/components/executer/exresolv.c +++ b/source/components/executer/exresolv.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exresolv - AML Interpreter object resolution @@ -349,7 +348,7 @@ AcpiExResolveObjectToValue ( * * RETURN: Status * - * DESCRIPTION: Return the base object and type. Traverse a reference list if + * DESCRIPTION: Return the base object and type. Traverse a reference list if * necessary to get to the base object. * ******************************************************************************/ @@ -576,5 +575,3 @@ Exit: } return_ACPI_STATUS (AE_OK); } - - diff --git a/source/components/executer/exresop.c b/source/components/executer/exresop.c index 1bcba69..a9e0caf 100644 --- a/source/components/executer/exresop.c +++ b/source/components/executer/exresop.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exresop - AML Interpreter operand/object resolution @@ -98,7 +97,7 @@ AcpiExCheckObjectType ( { /* * Allow the AML "Constant" opcodes (Zero, One, etc.) to be reference - * objects and thus allow them to be targets. (As per the ACPI + * objects and thus allow them to be targets. (As per the ACPI * specification, a store to a constant is a noop.) */ if ((ThisType == ACPI_TYPE_INTEGER) && @@ -674,7 +673,7 @@ AcpiExResolveOperands ( { /* * Enable original behavior of Store(), allowing any and all - * objects as the source operand. The ACPI spec does not + * objects as the source operand. The ACPI spec does not * allow this, however. */ break; @@ -734,5 +733,3 @@ NextOperand: return_ACPI_STATUS (Status); } - - diff --git a/source/components/executer/exstore.c b/source/components/executer/exstore.c index 3a88811..283cff5 100644 --- a/source/components/executer/exstore.c +++ b/source/components/executer/exstore.c @@ -398,7 +398,7 @@ AcpiExStoreObjectToIndex ( * with the input value. * * When storing into an object the data is converted to the - * target object type then stored in the object. This means + * target object type then stored in the object. This means * that the target object type (for an initialized target) will * not be changed by a store operation. * @@ -518,7 +518,7 @@ AcpiExStoreObjectToNode ( "Storing %s (%p) directly into node (%p) with no implicit conversion\n", AcpiUtGetObjectTypeName (SourceDesc), SourceDesc, Node)); - /* No conversions for all other types. Just attach the source object */ + /* No conversions for all other types. Just attach the source object */ Status = AcpiNsAttachObject (Node, SourceDesc, SourceDesc->Common.Type); @@ -527,5 +527,3 @@ AcpiExStoreObjectToNode ( return_ACPI_STATUS (Status); } - - diff --git a/source/components/executer/exstoren.c b/source/components/executer/exstoren.c index 464d6b1..84699b6 100644 --- a/source/components/executer/exstoren.c +++ b/source/components/executer/exstoren.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exstoren - AML Interpreter object store support, @@ -65,7 +64,7 @@ * * RETURN: Status, resolved object in SourceDescPtr. * - * DESCRIPTION: Resolve an object. If the object is a reference, dereference + * DESCRIPTION: Resolve an object. If the object is a reference, dereference * it and return the actual object in the SourceDescPtr. * ******************************************************************************/ @@ -102,7 +101,7 @@ AcpiExResolveObject ( /* * Stores into a Field/Region or into a Integer/Buffer/String - * are all essentially the same. This case handles the + * are all essentially the same. This case handles the * "interchangeable" types Integer, String, and Buffer. */ if (SourceDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) @@ -179,7 +178,7 @@ AcpiExResolveObject ( * * RETURN: Status * - * DESCRIPTION: "Store" an object to another object. This may include + * DESCRIPTION: "Store" an object to another object. This may include * converting the source type to the target type (implicit * conversion), and a copy of the value of the source to * the target. @@ -190,14 +189,14 @@ AcpiExResolveObject ( * with the input value. * * When storing into an object the data is converted to the - * target object type then stored in the object. This means + * target object type then stored in the object. This means * that the target object type (for an initialized target) will * not be changed by a store operation. * * This module allows destination types of Number, String, * Buffer, and Package. * - * Assumes parameters are already validated. NOTE: SourceDesc + * Assumes parameters are already validated. NOTE: SourceDesc * resolution (from a reference object) must be performed by * the caller if necessary. * @@ -310,5 +309,3 @@ AcpiExStoreObjectToObject ( *NewDesc = DestDesc; return_ACPI_STATUS (Status); } - - diff --git a/source/components/executer/exstorob.c b/source/components/executer/exstorob.c index e74d5b3..e7166d5 100644 --- a/source/components/executer/exstorob.c +++ b/source/components/executer/exstorob.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exstorob - AML Interpreter object store support, store to object @@ -118,7 +117,7 @@ AcpiExStoreBufferToBuffer ( #ifdef ACPI_OBSOLETE_BEHAVIOR /* * NOTE: ACPI versions up to 3.0 specified that the buffer must be - * truncated if the string is smaller than the buffer. However, "other" + * truncated if the string is smaller than the buffer. However, "other" * implementations of ACPI never did this and thus became the defacto * standard. ACPI 3.0A changes this behavior such that the buffer * is no longer truncated. @@ -127,7 +126,7 @@ AcpiExStoreBufferToBuffer ( /* * OBSOLETE BEHAVIOR: * If the original source was a string, we must truncate the buffer, - * according to the ACPI spec. Integer-to-Buffer and Buffer-to-Buffer + * according to the ACPI spec. Integer-to-Buffer and Buffer-to-Buffer * copy must not truncate the original buffer. */ if (OriginalSrcType == ACPI_TYPE_STRING) @@ -240,5 +239,3 @@ AcpiExStoreStringToString ( TargetDesc->String.Length = Length; return_ACPI_STATUS (AE_OK); } - - diff --git a/source/components/executer/exsystem.c b/source/components/executer/exsystem.c index 37f5b23..bbb8e18 100644 --- a/source/components/executer/exsystem.c +++ b/source/components/executer/exsystem.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exsystem - Interface to OS services @@ -62,7 +61,7 @@ * RETURN: Status * * DESCRIPTION: Implements a semaphore wait with a check to see if the - * semaphore is available immediately. If it is not, the + * semaphore is available immediately. If it is not, the * interpreter is released before waiting. * ******************************************************************************/ @@ -115,7 +114,7 @@ AcpiExSystemWaitSemaphore ( * RETURN: Status * * DESCRIPTION: Implements a mutex wait with a check to see if the - * mutex is available immediately. If it is not, the + * mutex is available immediately. If it is not, the * interpreter is released before waiting. * ******************************************************************************/ @@ -170,7 +169,7 @@ AcpiExSystemWaitMutex ( * DESCRIPTION: Suspend running thread for specified amount of time. * Note: ACPI specification requires that Stall() does not * relinquish the processor, and delays longer than 100 usec - * should use Sleep() instead. We allow stalls up to 255 usec + * should use Sleep() instead. We allow stalls up to 255 usec * for compatibility with other interpreters and existing BIOSs. * ******************************************************************************/ @@ -290,7 +289,7 @@ AcpiExSystemSignalEvent ( * RETURN: Status * * DESCRIPTION: Provides an access point to perform synchronization operations - * within the AML. This operation is a request to wait for an + * within the AML. This operation is a request to wait for an * event. * ******************************************************************************/ @@ -352,4 +351,3 @@ AcpiExSystemResetEvent ( return (Status); } - diff --git a/source/components/executer/exutils.c b/source/components/executer/exutils.c index faf34fc..12befff 100644 --- a/source/components/executer/exutils.c +++ b/source/components/executer/exutils.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exutils - interpreter/scanner utilities @@ -47,12 +46,12 @@ /* * DEFINE_AML_GLOBALS is tested in amlcode.h * to determine whether certain global names should be "defined" or only - * "declared" in the current compilation. This enhances maintainability + * "declared" in the current compilation. This enhances maintainability * by enabling a single header file to embody all knowledge of the names * in question. * * Exactly one module of any executable should #define DEFINE_GLOBALS - * before #including the header files which use this convention. The + * before #including the header files which use this convention. The * names in question will be defined and initialized in that module, * and declared as extern in all other modules which #include those * header files. diff --git a/source/components/hardware/hwacpi.c b/source/components/hardware/hwacpi.c index d9f16ef..9f9fec3 100644 --- a/source/components/hardware/hwacpi.c +++ b/source/components/hardware/hwacpi.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface @@ -165,7 +164,7 @@ AcpiHwSetMode ( * * RETURN: SYS_MODE_ACPI or SYS_MODE_LEGACY * - * DESCRIPTION: Return current operating state of system. Determined by + * DESCRIPTION: Return current operating state of system. Determined by * querying the SCI_EN bit. * ******************************************************************************/ diff --git a/source/components/hardware/hwgpe.c b/source/components/hardware/hwgpe.c index 11cb36e..8203916 100644 --- a/source/components/hardware/hwgpe.c +++ b/source/components/hardware/hwgpe.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: hwgpe - Low level GPE enable/disable/clear functions diff --git a/source/components/hardware/hwpci.c b/source/components/hardware/hwpci.c index 065e42d..1c42f3a 100644 --- a/source/components/hardware/hwpci.c +++ b/source/components/hardware/hwpci.c @@ -292,7 +292,7 @@ AcpiHwProcessPciList ( &BusNumber, &IsBridge); if (ACPI_FAILURE (Status)) { - return_ACPI_STATUS (Status); + return (Status); } Info = Info->Next; @@ -304,7 +304,7 @@ AcpiHwProcessPciList ( PciId->Segment, PciId->Bus, PciId->Device, PciId->Function, Status, BusNumber, IsBridge)); - return_ACPI_STATUS (AE_OK); + return (AE_OK); } diff --git a/source/components/hardware/hwregs.c b/source/components/hardware/hwregs.c index 6d89883..a89e97c 100644 --- a/source/components/hardware/hwregs.c +++ b/source/components/hardware/hwregs.c @@ -1,4 +1,3 @@ - /******************************************************************************* * * Module Name: hwregs - Read/write access functions for the various ACPI diff --git a/source/components/hardware/hwtimer.c b/source/components/hardware/hwtimer.c index 15dc58f..44de309 100644 --- a/source/components/hardware/hwtimer.c +++ b/source/components/hardware/hwtimer.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Name: hwtimer.c - ACPI Power Management Timer Interface @@ -144,7 +143,7 @@ ACPI_EXPORT_SYMBOL (AcpiGetTimer) * a versatile and accurate timer. * * Note that this function accommodates only a single timer - * rollover. Thus for 24-bit timers, this function should only + * rollover. Thus for 24-bit timers, this function should only * be used for calculating durations less than ~4.6 seconds * (~20 minutes for 32-bit timers) -- calculations below: * diff --git a/source/components/hardware/hwvalid.c b/source/components/hardware/hwvalid.c index 4462434..535cdbb 100644 --- a/source/components/hardware/hwvalid.c +++ b/source/components/hardware/hwvalid.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: hwvalid - I/O request validation @@ -364,5 +363,3 @@ AcpiHwWritePort ( return (AE_OK); } - - diff --git a/source/components/hardware/hwxface.c b/source/components/hardware/hwxface.c index 3fec9b5..e4f8c80 100644 --- a/source/components/hardware/hwxface.c +++ b/source/components/hardware/hwxface.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: hwxface - Public ACPICA hardware interfaces diff --git a/source/components/namespace/nsaccess.c b/source/components/namespace/nsaccess.c index 9dfa76f..64342ba 100644 --- a/source/components/namespace/nsaccess.c +++ b/source/components/namespace/nsaccess.c @@ -121,12 +121,12 @@ AcpiNsRootInitialize ( Status = AcpiNsLookup (NULL, InitVal->Name, InitVal->Type, ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH, NULL, &NewNode); - - if (ACPI_FAILURE (Status) || (!NewNode)) /* Must be on same line for code converter */ + if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "Could not create predefined name %s", InitVal->Name)); + continue; } /* @@ -697,4 +697,3 @@ AcpiNsLookup ( *ReturnNode = ThisNode; return_ACPI_STATUS (AE_OK); } - diff --git a/source/components/namespace/nsalloc.c b/source/components/namespace/nsalloc.c index c7e83e0..d10c997 100644 --- a/source/components/namespace/nsalloc.c +++ b/source/components/namespace/nsalloc.c @@ -376,7 +376,7 @@ AcpiNsDeleteChildren ( * * RETURN: None. * - * DESCRIPTION: Delete a subtree of the namespace. This includes all objects + * DESCRIPTION: Delete a subtree of the namespace. This includes all objects * stored within the subtree. * ******************************************************************************/ @@ -472,7 +472,7 @@ AcpiNsDeleteNamespaceSubtree ( * RETURN: Status * * DESCRIPTION: Delete entries within the namespace that are owned by a - * specific ID. Used to delete entire ACPI tables. All + * specific ID. Used to delete entire ACPI tables. All * reference counts are updated. * * MUTEX: Locks namespace during deletion walk. @@ -584,5 +584,3 @@ AcpiNsDeleteNamespaceByOwner ( (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); return_VOID; } - - diff --git a/source/components/namespace/nsdump.c b/source/components/namespace/nsdump.c index e0635dc..ef2aac5 100644 --- a/source/components/namespace/nsdump.c +++ b/source/components/namespace/nsdump.c @@ -736,7 +736,7 @@ AcpiNsDumpEntry ( * * PARAMETERS: SearchBase - Root of subtree to be dumped, or * NS_ALL to dump the entire namespace - * MaxDepth - Maximum depth of dump. Use INT_MAX + * MaxDepth - Maximum depth of dump. Use INT_MAX * for an effectively unlimited depth. * * RETURN: None @@ -780,4 +780,3 @@ AcpiNsDumpTables ( } #endif #endif - diff --git a/source/components/namespace/nsdumpdv.c b/source/components/namespace/nsdumpdv.c index 9d30886..b42b824 100644 --- a/source/components/namespace/nsdumpdv.c +++ b/source/components/namespace/nsdumpdv.c @@ -157,5 +157,3 @@ AcpiNsDumpRootDevices ( #endif #endif - - diff --git a/source/components/namespace/nseval.c b/source/components/namespace/nseval.c index 0183f7e7..537dfaf 100644 --- a/source/components/namespace/nseval.c +++ b/source/components/namespace/nseval.c @@ -482,4 +482,3 @@ Exit: } return_VOID; } - diff --git a/source/components/namespace/nsinit.c b/source/components/namespace/nsinit.c index f3907aa..a24a67a 100644 --- a/source/components/namespace/nsinit.c +++ b/source/components/namespace/nsinit.c @@ -254,7 +254,7 @@ ErrorExit: * * RETURN: Status * - * DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every object + * DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every object * within the namespace. * * Currently, the only objects that require initialization are: diff --git a/source/components/namespace/nsload.c b/source/components/namespace/nsload.c index 3ef33f9..77aed81 100644 --- a/source/components/namespace/nsload.c +++ b/source/components/namespace/nsload.c @@ -93,8 +93,8 @@ AcpiNsLoadTable ( /* * Parse the table and load the namespace with all named - * objects found within. Control methods are NOT parsed - * at this time. In fact, the control methods cannot be + * objects found within. Control methods are NOT parsed + * at this time. In fact, the control methods cannot be * parsed until the entire namespace is loaded, because * if a control method makes a forward reference (call) * to another control method, we can't continue parsing @@ -142,7 +142,7 @@ Unlock: } /* - * Now we can parse the control methods. We always parse + * Now we can parse the control methods. We always parse * them here for a sanity check, and if configured for * just-in-time parsing, we delete the control method * parse trees. @@ -192,7 +192,7 @@ AcpiNsLoadNamespace ( } /* - * Load the namespace. The DSDT is required, + * Load the namespace. The DSDT is required, * but the SSDT and PSDT tables are optional. */ Status = AcpiNsLoadTableByType (ACPI_TABLE_ID_DSDT); @@ -318,7 +318,7 @@ AcpiNsDeleteSubtree ( * RETURN: Status * * DESCRIPTION: Shrinks the namespace, typically in response to an undocking - * event. Deletes an entire subtree starting from (and + * event. Deletes an entire subtree starting from (and * including) the given handle. * ******************************************************************************/ @@ -353,4 +353,3 @@ AcpiNsUnloadNamespace ( } #endif #endif - diff --git a/source/components/namespace/nsnames.c b/source/components/namespace/nsnames.c index f70900d..e7c73a2 100644 --- a/source/components/namespace/nsnames.c +++ b/source/components/namespace/nsnames.c @@ -223,7 +223,7 @@ AcpiNsGetPathnameLength ( ACPI_ERROR ((AE_INFO, "Invalid Namespace Node (%p) while traversing namespace", NextNode)); - return 0; + return (0); } Size += ACPI_PATH_SEGMENT_LENGTH; NextNode = NextNode->Parent; @@ -299,5 +299,3 @@ AcpiNsHandleToPathname ( (char *) Buffer->Pointer, (UINT32) RequiredSize)); return_ACPI_STATUS (AE_OK); } - - diff --git a/source/components/namespace/nsobject.c b/source/components/namespace/nsobject.c index 9b219a5..54e918e 100644 --- a/source/components/namespace/nsobject.c +++ b/source/components/namespace/nsobject.c @@ -66,7 +66,7 @@ * RETURN: Status * * DESCRIPTION: Record the given object as the value associated with the - * name whose ACPI_HANDLE is passed. If Object is NULL + * name whose ACPI_HANDLE is passed. If Object is NULL * and Type is ACPI_TYPE_ANY, set the name as having no value. * Note: Future may require that the Node->Flags field be passed * as a parameter. @@ -146,7 +146,7 @@ AcpiNsAttachObject ( { /* * Value passed is a name handle and that name has a - * non-null value. Use that name's value and type. + * non-null value. Use that name's value and type. */ ObjDesc = ((ACPI_NAMESPACE_NODE *) Object)->Object; ObjectType = ((ACPI_NAMESPACE_NODE *) Object)->Type; @@ -354,7 +354,7 @@ AcpiNsGetSecondaryObject ( * * RETURN: Status * - * DESCRIPTION: Low-level attach data. Create and attach a Data object. + * DESCRIPTION: Low-level attach data. Create and attach a Data object. * ******************************************************************************/ @@ -420,7 +420,7 @@ AcpiNsAttachData ( * * RETURN: Status * - * DESCRIPTION: Low-level detach data. Delete the data node, but the caller + * DESCRIPTION: Low-level detach data. Delete the data node, but the caller * is responsible for the actual data. * ******************************************************************************/ @@ -501,5 +501,3 @@ AcpiNsGetAttachedData ( return (AE_NOT_FOUND); } - - diff --git a/source/components/namespace/nsparse.c b/source/components/namespace/nsparse.c index 2c768c0..4037456 100644 --- a/source/components/namespace/nsparse.c +++ b/source/components/namespace/nsparse.c @@ -187,11 +187,11 @@ AcpiNsParseTable ( /* * AML Parse, pass 1 * - * In this pass, we load most of the namespace. Control methods - * are not parsed until later. A parse tree is not created. Instead, - * each Parser Op subtree is deleted when it is finished. This saves + * In this pass, we load most of the namespace. Control methods + * are not parsed until later. A parse tree is not created. Instead, + * each Parser Op subtree is deleted when it is finished. This saves * a great deal of memory, and allows a small cache of parse objects - * to service the entire parse. The second pass of the parse then + * to service the entire parse. The second pass of the parse then * performs another complete parse of the AML. */ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 1\n")); @@ -221,5 +221,3 @@ AcpiNsParseTable ( return_ACPI_STATUS (Status); } - - diff --git a/source/components/namespace/nssearch.c b/source/components/namespace/nssearch.c index d6f59cc..82d9a06 100644 --- a/source/components/namespace/nssearch.c +++ b/source/components/namespace/nssearch.c @@ -421,4 +421,3 @@ AcpiNsSearchAndEnter ( *ReturnNode = NewNode; return_ACPI_STATUS (AE_OK); } - diff --git a/source/components/namespace/nsutils.c b/source/components/namespace/nsutils.c index 43f734e..6370dab 100644 --- a/source/components/namespace/nsutils.c +++ b/source/components/namespace/nsutils.c @@ -622,7 +622,7 @@ AcpiNsExternalizeName ( ((NumSegments > 0) ? (NumSegments - 1) : 0) + 1; /* - * Check to see if we're still in bounds. If not, there's a problem + * Check to see if we're still in bounds. If not, there's a problem * with InternalName (invalid format). */ if (RequiredLength > InternalNameLength) @@ -655,10 +655,13 @@ AcpiNsExternalizeName ( (*ConvertedName)[j++] = '.'; } - (*ConvertedName)[j++] = InternalName[NamesIndex++]; - (*ConvertedName)[j++] = InternalName[NamesIndex++]; - (*ConvertedName)[j++] = InternalName[NamesIndex++]; - (*ConvertedName)[j++] = InternalName[NamesIndex++]; + /* Copy and validate the 4-char name segment */ + + ACPI_MOVE_NAME (&(*ConvertedName)[j], &InternalName[NamesIndex]); + AcpiUtRepairName (&(*ConvertedName)[j]); + + j += ACPI_NAME_SIZE; + NamesIndex += ACPI_NAME_SIZE; } } @@ -797,7 +800,7 @@ AcpiNsOpensScope ( * \ (backslash) and ^ (carat) prefixes, and the * . (period) to separate segments are supported. * PrefixNode - Root of subtree to be searched, or NS_ALL for the - * root of the name space. If Name is fully + * root of the name space. If Name is fully * qualified (first INT8 is '\'), the passed value * of Scope will not be accessed. * Flags - Used to indicate whether to perform upsearch or @@ -805,7 +808,7 @@ AcpiNsOpensScope ( * ReturnNode - Where the Node is returned * * DESCRIPTION: Look up a name relative to a given scope and return the - * corresponding Node. NOTE: Scope can be null. + * corresponding Node. NOTE: Scope can be null. * * MUTEX: Locks namespace * diff --git a/source/components/namespace/nswalk.c b/source/components/namespace/nswalk.c index 35c3e17..7c3a434 100644 --- a/source/components/namespace/nswalk.c +++ b/source/components/namespace/nswalk.c @@ -65,8 +65,8 @@ * RETURN: ACPI_NAMESPACE_NODE - Pointer to the NEXT child or NULL if * none is found. * - * DESCRIPTION: Return the next peer node within the namespace. If Handle - * is valid, Scope is ignored. Otherwise, the first node + * DESCRIPTION: Return the next peer node within the namespace. If Handle + * is valid, Scope is ignored. Otherwise, the first node * within Scope is returned. * ******************************************************************************/ @@ -105,8 +105,8 @@ AcpiNsGetNextNode ( * RETURN: ACPI_NAMESPACE_NODE - Pointer to the NEXT child or NULL if * none is found. * - * DESCRIPTION: Return the next peer node within the namespace. If Handle - * is valid, Scope is ignored. Otherwise, the first node + * DESCRIPTION: Return the next peer node within the namespace. If Handle + * is valid, Scope is ignored. Otherwise, the first node * within Scope is returned. * ******************************************************************************/ @@ -327,7 +327,7 @@ AcpiNsWalkNamespace ( /* * Depth first search: Attempt to go down another level in the - * namespace if we are allowed to. Don't go any further if we have + * namespace if we are allowed to. Don't go any further if we have * reached the caller specified maximum depth or if the user * function has specified that the maximum depth has been reached. */ @@ -382,5 +382,3 @@ AcpiNsWalkNamespace ( return_ACPI_STATUS (AE_OK); } - - diff --git a/source/components/namespace/nsxfeval.c b/source/components/namespace/nsxfeval.c index 5006588..fcd6fb7 100644 --- a/source/components/namespace/nsxfeval.c +++ b/source/components/namespace/nsxfeval.c @@ -68,16 +68,16 @@ AcpiNsResolveReferences ( * PARAMETERS: Handle - Object handle (optional) * Pathname - Object pathname (optional) * ExternalParams - List of parameters to pass to method, - * terminated by NULL. May be NULL + * terminated by NULL. May be NULL * if no parameters are being passed. * ReturnBuffer - Where to put method's return value (if - * any). If NULL, no value is returned. + * any). If NULL, no value is returned. * ReturnType - Expected type of return object * * RETURN: Status * * DESCRIPTION: Find and evaluate the given object, passing the given - * parameters if necessary. One of "Handle" or "Pathname" must + * parameters if necessary. One of "Handle" or "Pathname" must * be valid (non-null) * ******************************************************************************/ @@ -168,15 +168,15 @@ ACPI_EXPORT_SYMBOL (AcpiEvaluateObjectTyped) * PARAMETERS: Handle - Object handle (optional) * Pathname - Object pathname (optional) * ExternalParams - List of parameters to pass to method, - * terminated by NULL. May be NULL + * terminated by NULL. May be NULL * if no parameters are being passed. * ReturnBuffer - Where to put method's return value (if - * any). If NULL, no value is returned. + * any). If NULL, no value is returned. * * RETURN: Status * * DESCRIPTION: Find and evaluate the given object, passing the given - * parameters if necessary. One of "Handle" or "Pathname" must + * parameters if necessary. One of "Handle" or "Pathname" must * be valid (non-null) * ******************************************************************************/ @@ -537,7 +537,7 @@ AcpiWalkNamespace ( Status = AcpiUtAcquireReadLock (&AcpiGbl_NamespaceRwLock); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } /* @@ -591,8 +591,8 @@ AcpiNsGetDeviceCallback ( ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node; UINT32 Flags; - ACPI_DEVICE_ID *Hid; - ACPI_DEVICE_ID_LIST *Cid; + ACPI_PNP_DEVICE_ID *Hid; + ACPI_PNP_DEVICE_ID_LIST *Cid; UINT32 i; BOOLEAN Found; int NoMatch; @@ -726,7 +726,7 @@ AcpiNsGetDeviceCallback ( * DESCRIPTION: Performs a modified depth-first walk of the namespace tree, * starting (and ending) at the object specified by StartHandle. * The UserFunction is called whenever an object of type - * Device is found. If the user function returns + * Device is found. If the user function returns * a non-zero value, the search is terminated immediately and this * value is returned to the caller. * @@ -956,5 +956,3 @@ UnlockAndExit: } ACPI_EXPORT_SYMBOL (AcpiGetData) - - diff --git a/source/components/namespace/nsxfname.c b/source/components/namespace/nsxfname.c index 4690d09..1d5aeec 100644 --- a/source/components/namespace/nsxfname.c +++ b/source/components/namespace/nsxfname.c @@ -58,8 +58,8 @@ static char * AcpiNsCopyDeviceId ( - ACPI_DEVICE_ID *Dest, - ACPI_DEVICE_ID *Source, + ACPI_PNP_DEVICE_ID *Dest, + ACPI_PNP_DEVICE_ID *Source, char *StringArea); @@ -75,8 +75,8 @@ AcpiNsCopyDeviceId ( * RETURN: Status * * DESCRIPTION: This routine will search for a caller specified name in the - * name space. The caller can restrict the search region by - * specifying a non NULL parent. The parent value is itself a + * name space. The caller can restrict the search region by + * specifying a non NULL parent. The parent value is itself a * namespace handle. * ******************************************************************************/ @@ -164,7 +164,7 @@ ACPI_EXPORT_SYMBOL (AcpiGetHandle) * RETURN: Pointer to a string containing the fully qualified Name. * * DESCRIPTION: This routine returns the fully qualified name associated with - * the Handle parameter. This and the AcpiPathnameToHandle are + * the Handle parameter. This and the AcpiPathnameToHandle are * complementary functions. * ******************************************************************************/ @@ -227,8 +227,7 @@ AcpiGetName ( /* Just copy the ACPI name from the Node and zero terminate it */ - ACPI_STRNCPY (Buffer->Pointer, AcpiUtGetNodeName (Node), - ACPI_NAME_SIZE); + ACPI_MOVE_NAME (Buffer->Pointer, AcpiUtGetNodeName (Node)); ((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0; Status = AE_OK; @@ -246,23 +245,24 @@ ACPI_EXPORT_SYMBOL (AcpiGetName) * * FUNCTION: AcpiNsCopyDeviceId * - * PARAMETERS: Dest - Pointer to the destination DEVICE_ID - * Source - Pointer to the source DEVICE_ID + * PARAMETERS: Dest - Pointer to the destination PNP_DEVICE_ID + * Source - Pointer to the source PNP_DEVICE_ID * StringArea - Pointer to where to copy the dest string * * RETURN: Pointer to the next string area * - * DESCRIPTION: Copy a single DEVICE_ID, including the string data. + * DESCRIPTION: Copy a single PNP_DEVICE_ID, including the string data. * ******************************************************************************/ static char * AcpiNsCopyDeviceId ( - ACPI_DEVICE_ID *Dest, - ACPI_DEVICE_ID *Source, + ACPI_PNP_DEVICE_ID *Dest, + ACPI_PNP_DEVICE_ID *Source, char *StringArea) { - /* Create the destination DEVICE_ID */ + + /* Create the destination PNP_DEVICE_ID */ Dest->String = StringArea; Dest->Length = Source->Length; @@ -287,8 +287,8 @@ AcpiNsCopyDeviceId ( * namespace node and possibly by running several standard * control methods (Such as in the case of a device.) * - * For Device and Processor objects, run the Device _HID, _UID, _CID, _STA, - * _ADR, _SxW, and _SxD methods. + * For Device and Processor objects, run the Device _HID, _UID, _CID, _SUB, + * _STA, _ADR, _SxW, and _SxD methods. * * Note: Allocates the return buffer, must be freed by the caller. * @@ -301,9 +301,10 @@ AcpiGetObjectInfo ( { ACPI_NAMESPACE_NODE *Node; ACPI_DEVICE_INFO *Info; - ACPI_DEVICE_ID_LIST *CidList = NULL; - ACPI_DEVICE_ID *Hid = NULL; - ACPI_DEVICE_ID *Uid = NULL; + ACPI_PNP_DEVICE_ID_LIST *CidList = NULL; + ACPI_PNP_DEVICE_ID *Hid = NULL; + ACPI_PNP_DEVICE_ID *Uid = NULL; + ACPI_PNP_DEVICE_ID *Sub = NULL; char *NextIdString; ACPI_OBJECT_TYPE Type; ACPI_NAME Name; @@ -356,7 +357,7 @@ AcpiGetObjectInfo ( { /* * Get extra info for ACPI Device/Processor objects only: - * Run the Device _HID, _UID, and _CID methods. + * Run the Device _HID, _UID, _SUB, and _CID methods. * * Note: none of these methods are required, so they may or may * not be present for this device. The Info->Valid bitfield is used @@ -381,6 +382,15 @@ AcpiGetObjectInfo ( Valid |= ACPI_VALID_UID; } + /* Execute the Device._SUB method */ + + Status = AcpiUtExecute_SUB (Node, &Sub); + if (ACPI_SUCCESS (Status)) + { + InfoSize += Sub->Length; + Valid |= ACPI_VALID_SUB; + } + /* Execute the Device._CID method */ Status = AcpiUtExecute_CID (Node, &CidList); @@ -388,7 +398,7 @@ AcpiGetObjectInfo ( { /* Add size of CID strings and CID pointer array */ - InfoSize += (CidList->ListSize - sizeof (ACPI_DEVICE_ID_LIST)); + InfoSize += (CidList->ListSize - sizeof (ACPI_PNP_DEVICE_ID_LIST)); Valid |= ACPI_VALID_CID; } } @@ -463,14 +473,15 @@ AcpiGetObjectInfo ( NextIdString = ACPI_CAST_PTR (char, Info->CompatibleIdList.Ids); if (CidList) { - /* Point past the CID DEVICE_ID array */ + /* Point past the CID PNP_DEVICE_ID array */ - NextIdString += ((ACPI_SIZE) CidList->Count * sizeof (ACPI_DEVICE_ID)); + NextIdString += ((ACPI_SIZE) CidList->Count * sizeof (ACPI_PNP_DEVICE_ID)); } /* - * Copy the HID, UID, and CIDs to the return buffer. The variable-length - * strings are copied to the reserved area at the end of the buffer. + * Copy the HID, UID, SUB, and CIDs to the return buffer. + * The variable-length strings are copied to the reserved area + * at the end of the buffer. * * For HID and CID, check if the ID is a PCI Root Bridge. */ @@ -491,6 +502,12 @@ AcpiGetObjectInfo ( Uid, NextIdString); } + if (Sub) + { + NextIdString = AcpiNsCopyDeviceId (&Info->SubsystemId, + Sub, NextIdString); + } + if (CidList) { Info->CompatibleIdList.Count = CidList->Count; @@ -531,6 +548,10 @@ Cleanup: { ACPI_FREE (Uid); } + if (Sub) + { + ACPI_FREE (Sub); + } if (CidList) { ACPI_FREE (CidList); diff --git a/source/components/namespace/nsxfobj.c b/source/components/namespace/nsxfobj.c index 02f7777..ea83271 100644 --- a/source/components/namespace/nsxfobj.c +++ b/source/components/namespace/nsxfobj.c @@ -202,8 +202,8 @@ ACPI_EXPORT_SYMBOL (AcpiGetParent) * * RETURN: Status * - * DESCRIPTION: Return the next peer object within the namespace. If Handle is - * valid, Scope is ignored. Otherwise, the first object within + * DESCRIPTION: Return the next peer object within the namespace. If Handle is + * valid, Scope is ignored. Otherwise, the first object within * Scope is returned. * ******************************************************************************/ @@ -282,4 +282,3 @@ UnlockAndExit: } ACPI_EXPORT_SYMBOL (AcpiGetNextObject) - diff --git a/source/components/parser/psargs.c b/source/components/parser/psargs.c index 8140fdb..74d0cc8 100644 --- a/source/components/parser/psargs.c +++ b/source/components/parser/psargs.c @@ -131,7 +131,7 @@ AcpiPsGetNextPackageLength ( * RETURN: Pointer to end-of-package +1 * * DESCRIPTION: Get next package length and return a pointer past the end of - * the package. Consumes the package length field + * the package. Consumes the package length field * ******************************************************************************/ @@ -163,8 +163,8 @@ AcpiPsGetNextPackageEnd ( * RETURN: Pointer to the start of the name string (pointer points into * the AML. * - * DESCRIPTION: Get next raw namestring within the AML stream. Handles all name - * prefix characters. Set parser state to point past the string. + * DESCRIPTION: Get next raw namestring within the AML stream. Handles all name + * prefix characters. Set parser state to point past the string. * (Name is consumed from the AML.) * ******************************************************************************/ @@ -244,7 +244,7 @@ AcpiPsGetNextNamestring ( * * DESCRIPTION: Get next name (if method call, return # of required args). * Names are looked up in the internal namespace to determine - * if the name represents a control method. If a method + * if the name represents a control method. If a method * is found, the number of arguments to the method is returned. * This information is critical for parsing to continue correctly. * diff --git a/source/components/parser/psloop.c b/source/components/parser/psloop.c index d578c7e3..e63dd04 100644 --- a/source/components/parser/psloop.c +++ b/source/components/parser/psloop.c @@ -153,17 +153,44 @@ AcpiPsGetAmlOpcode ( case AML_CLASS_UNKNOWN: - /* The opcode is unrecognized. Just skip unknown opcodes */ + /* The opcode is unrecognized. Complain and skip unknown opcodes */ - ACPI_ERROR ((AE_INFO, - "Found unknown opcode 0x%X at AML address %p offset 0x%X, ignoring", - WalkState->Opcode, WalkState->ParserState.Aml, WalkState->AmlOffset)); + if (WalkState->PassNumber == 2) + { + ACPI_ERROR ((AE_INFO, + "Unknown opcode 0x%.2X at table offset 0x%.4X, ignoring", + WalkState->Opcode, + (UINT32) (WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER)))); + + ACPI_DUMP_BUFFER (WalkState->ParserState.Aml - 16, 48); + +#ifdef ACPI_ASL_COMPILER + /* + * This is executed for the disassembler only. Output goes + * to the disassembled ASL output file. + */ + AcpiOsPrintf ( + "/*\nError: Unknown opcode 0x%.2X at table offset 0x%.4X, context:\n", + WalkState->Opcode, + (UINT32) (WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER))); + + /* Dump the context surrounding the invalid opcode */ - ACPI_DUMP_BUFFER (WalkState->ParserState.Aml, 128); + AcpiUtDumpBuffer (((UINT8 *) WalkState->ParserState.Aml - 16), + 48, DB_BYTE_DISPLAY, + WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER) - 16); + AcpiOsPrintf (" */\n"); +#endif + } - /* Assume one-byte bad opcode */ + /* Increment past one-byte or two-byte opcode */ WalkState->ParserState.Aml++; + if (WalkState->Opcode > 0xFF) /* Can only happen if first byte is 0x5B */ + { + WalkState->ParserState.Aml++; + } + return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE); default: @@ -551,8 +578,8 @@ AcpiPsGetArguments ( (!Arg)) { ACPI_WARNING ((AE_INFO, - "Detected an unsupported executable opcode " - "at module-level: [0x%.4X] at table offset 0x%.4X", + "Unsupported module-level executable opcode " + "0x%.2X at table offset 0x%.4X", Op->Common.AmlOpcode, (UINT32) (ACPI_PTR_DIFF (AmlOpStart, WalkState->ParserState.AmlStart) + @@ -1265,4 +1292,3 @@ AcpiPsParseLoop ( Status = AcpiPsCompleteFinalOp (WalkState, Op, Status); return_ACPI_STATUS (Status); } - diff --git a/source/components/parser/psopcode.c b/source/components/parser/psopcode.c index ef2257e..139c934 100644 --- a/source/components/parser/psopcode.c +++ b/source/components/parser/psopcode.c @@ -62,7 +62,7 @@ static const UINT8 AcpiGbl_ArgumentCount[] = {0,1,1,1,1,2,2,2,2,3,3,6}; * * DESCRIPTION: Opcode table. Each entry contains <opcode, type, name, operands> * The name is a simple ascii string, the operand specifier is an - * ascii string with one letter per operand. The letter specifies + * ascii string with one letter per operand. The letter specifies * the operand type. * ******************************************************************************/ @@ -187,7 +187,7 @@ static const UINT8 AcpiGbl_ArgumentCount[] = {0,1,1,1,1,2,2,2,2,3,3,6}; /* - * Master Opcode information table. A summary of everything we know about each + * Master Opcode information table. A summary of everything we know about each * opcode, all in one place. */ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] = @@ -387,7 +387,7 @@ static const UINT8 AcpiGbl_ShortOpIndex[256] = /* * This table is indexed by the second opcode of the extended opcode - * pair. It returns an index into the opcode table (AcpiGbl_AmlOpInfo) + * pair. It returns an index into the opcode table (AcpiGbl_AmlOpInfo) */ static const UINT8 AcpiGbl_LongOpIndex[NUM_EXTENDED_OPCODE] = { diff --git a/source/components/parser/psparse.c b/source/components/parser/psparse.c index bcf46ad..b85dac7 100644 --- a/source/components/parser/psparse.c +++ b/source/components/parser/psparse.c @@ -44,9 +44,9 @@ /* * Parse the AML and build an operation tree as most interpreters, - * like Perl, do. Parsing is done by hand rather than with a YACC + * like Perl, do. Parsing is done by hand rather than with a YACC * generated parser to tightly constrain stack and dynamic memory - * usage. At the same time, parsing is kept flexible and the code + * usage. At the same time, parsing is kept flexible and the code * fairly compact by parsing based on a list of AML opcode * templates in AmlOpInfo[] */ @@ -196,7 +196,7 @@ AcpiPsCompleteThisOp ( case AML_CLASS_CREATE: /* - * These opcodes contain TermArg operands. The current + * These opcodes contain TermArg operands. The current * op must be replaced by a placeholder return op */ ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP); @@ -209,7 +209,7 @@ AcpiPsCompleteThisOp ( case AML_CLASS_NAMED_OBJECT: /* - * These opcodes contain TermArg operands. The current + * These opcodes contain TermArg operands. The current * op must be replaced by a placeholder return op */ if ((Op->Common.Parent->Common.AmlOpcode == AML_REGION_OP) || @@ -394,7 +394,7 @@ AcpiPsNextParseState ( case AE_CTRL_FALSE: /* * Either an IF/WHILE Predicate was false or we encountered a BREAK - * opcode. In both cases, we do not execute the rest of the + * opcode. In both cases, we do not execute the rest of the * package; We simply close out the parent (finishing the walk of * this branch of the tree) and continue execution at the parent * level. @@ -508,7 +508,7 @@ AcpiPsParseAml ( AcpiGbl_CurrentWalkList = Thread; /* - * Execute the walk loop as long as there is a valid Walk State. This + * Execute the walk loop as long as there is a valid Walk State. This * handles nested control method invocations without recursion. */ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "State=%p\n", WalkState)); @@ -707,5 +707,3 @@ AcpiPsParseAml ( AcpiGbl_CurrentWalkList = PrevWalkList; return_ACPI_STATUS (Status); } - - diff --git a/source/components/parser/psscope.c b/source/components/parser/psscope.c index 1df5a33..359f350 100644 --- a/source/components/parser/psscope.c +++ b/source/components/parser/psscope.c @@ -299,4 +299,3 @@ AcpiPsCleanupScope ( return_VOID; } - diff --git a/source/components/parser/pstree.c b/source/components/parser/pstree.c index 8271314..36771b7 100644 --- a/source/components/parser/pstree.c +++ b/source/components/parser/pstree.c @@ -356,5 +356,3 @@ AcpiPsGetChild ( return (Child); } #endif - - diff --git a/source/components/parser/psutils.c b/source/components/parser/psutils.c index e28b75c..c72173f 100644 --- a/source/components/parser/psutils.c +++ b/source/components/parser/psutils.c @@ -120,7 +120,7 @@ AcpiPsInitOp ( * RETURN: Pointer to the new Op, null on failure * * DESCRIPTION: Allocate an acpi_op, choose op type (and thus size) based on - * opcode. A cache of opcodes is available for the pure + * opcode. A cache of opcodes is available for the pure * GENERIC_OP, since this is by far the most commonly used. * ******************************************************************************/ @@ -189,7 +189,7 @@ AcpiPsAllocOp ( * * RETURN: None. * - * DESCRIPTION: Free an Op object. Either put it on the GENERIC_OP cache list + * DESCRIPTION: Free an Op object. Either put it on the GENERIC_OP cache list * or actually free it. * ******************************************************************************/ @@ -287,4 +287,3 @@ AcpiPsSetName ( Op->Named.Name = name; } - diff --git a/source/components/parser/psxface.c b/source/components/parser/psxface.c index a9ceb6d..f8af99e 100644 --- a/source/components/parser/psxface.c +++ b/source/components/parser/psxface.c @@ -438,5 +438,3 @@ AcpiPsUpdateParameterList ( } } } - - diff --git a/source/components/resources/rsaddr.c b/source/components/resources/rsaddr.c index 90e7d43..14e59e3 100644 --- a/source/components/resources/rsaddr.c +++ b/source/components/resources/rsaddr.c @@ -403,5 +403,3 @@ AcpiRsSetAddressCommon ( Aml->Address.SpecificFlags = Resource->Data.Address.Info.TypeSpecific; } } - - diff --git a/source/components/resources/rscalc.c b/source/components/resources/rscalc.c index 845ed69..12af85e 100644 --- a/source/components/resources/rscalc.c +++ b/source/components/resources/rscalc.c @@ -482,6 +482,16 @@ AcpiRsGetListLength ( * Get the number of vendor data bytes */ ExtraStructBytes = ResourceLength; + + /* + * There is already one byte included in the minimum + * descriptor size. If there are extra struct bytes, + * subtract one from the count. + */ + if (ExtraStructBytes) + { + ExtraStructBytes--; + } break; @@ -626,7 +636,7 @@ AcpiRsGetPciRoutingTableLength ( /* * Calculate the size of the return buffer. * The base size is the number of elements * the sizes of the - * structures. Additional space for the strings is added below. + * structures. Additional space for the strings is added below. * The minus one is to subtract the size of the UINT8 Source[1] * member because it is added below. * diff --git a/source/components/resources/rscreate.c b/source/components/resources/rscreate.c index dcfe7e4..4c444ce 100644 --- a/source/components/resources/rscreate.c +++ b/source/components/resources/rscreate.c @@ -531,4 +531,3 @@ AcpiRsCreateAmlResources ( OutputBuffer->Pointer, (UINT32) OutputBuffer->Length)); return_ACPI_STATUS (AE_OK); } - diff --git a/source/components/resources/rsdump.c b/source/components/resources/rsdump.c index 6856473..6e20132 100644 --- a/source/components/resources/rsdump.c +++ b/source/components/resources/rsdump.c @@ -943,4 +943,3 @@ AcpiRsDumpWordList ( } #endif - diff --git a/source/components/resources/rsio.c b/source/components/resources/rsio.c index 065108c..8304627 100644 --- a/source/components/resources/rsio.c +++ b/source/components/resources/rsio.c @@ -300,5 +300,3 @@ ACPI_RSCONVERT_INFO AcpiRsSetStartDpf[10] = {ACPI_RSC_LENGTH, 0, 0, sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO)} }; - - diff --git a/source/components/resources/rslist.c b/source/components/resources/rslist.c index 187d56c..c5aeb1b 100644 --- a/source/components/resources/rslist.c +++ b/source/components/resources/rslist.c @@ -125,7 +125,7 @@ AcpiRsConvertAmlToResources ( ACPI_ERROR ((AE_INFO, "Invalid/unsupported resource descriptor: Type 0x%2.2X", ResourceIndex)); - return (AE_AML_INVALID_RESOURCE_TYPE); + return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE); } /* Convert the AML byte stream resource to a local resource struct */ @@ -225,7 +225,7 @@ AcpiRsConvertResourcesToAml ( ACPI_ERROR ((AE_INFO, "Invalid/unsupported resource descriptor: Type 0x%2.2X", Resource->Type)); - return (AE_AML_INVALID_RESOURCE_TYPE); + return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE); } Status = AcpiRsConvertResourceToAml (Resource, @@ -272,4 +272,3 @@ AcpiRsConvertResourcesToAml ( return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); } - diff --git a/source/components/resources/rsmemory.c b/source/components/resources/rsmemory.c index 83d1319..b9452f2 100644 --- a/source/components/resources/rsmemory.c +++ b/source/components/resources/rsmemory.c @@ -247,5 +247,3 @@ ACPI_RSCONVERT_INFO AcpiRsSetVendor[7] = sizeof (AML_RESOURCE_LARGE_HEADER), 0} }; - - diff --git a/source/components/resources/rsmisc.c b/source/components/resources/rsmisc.c index dfad696..6734928 100644 --- a/source/components/resources/rsmisc.c +++ b/source/components/resources/rsmisc.c @@ -865,5 +865,3 @@ Exit: return_ACPI_STATUS (AE_BAD_DATA); } #endif - - diff --git a/source/components/resources/rsutils.c b/source/components/resources/rsutils.c index 273638f..aeac5e7 100644 --- a/source/components/resources/rsutils.c +++ b/source/components/resources/rsutils.c @@ -858,4 +858,3 @@ Cleanup: ACPI_FREE (Info); return_ACPI_STATUS (Status); } - diff --git a/source/components/tables/tbfadt.c b/source/components/tables/tbfadt.c index 0bc6f28..f9a6d8e 100644 --- a/source/components/tables/tbfadt.c +++ b/source/components/tables/tbfadt.c @@ -724,4 +724,3 @@ AcpiTbSetupFadtRegisters ( } } } - diff --git a/source/components/tables/tbfind.c b/source/components/tables/tbfind.c index d7e2440..ab3ec1a 100644 --- a/source/components/tables/tbfind.c +++ b/source/components/tables/tbfind.c @@ -86,7 +86,7 @@ AcpiTbFindTable ( /* Normalize the input strings */ ACPI_MEMSET (&Header, 0, sizeof (ACPI_TABLE_HEADER)); - ACPI_STRNCPY (Header.Signature, Signature, ACPI_NAME_SIZE); + ACPI_MOVE_NAME (Header.Signature, Signature); ACPI_STRNCPY (Header.OemId, OemId, ACPI_OEM_ID_SIZE); ACPI_STRNCPY (Header.OemTableId, OemTableId, ACPI_OEM_TABLE_ID_SIZE); diff --git a/source/components/tables/tbinstal.c b/source/components/tables/tbinstal.c index 0626440..5071fc64 100644 --- a/source/components/tables/tbinstal.c +++ b/source/components/tables/tbinstal.c @@ -577,6 +577,8 @@ AcpiTbTerminate ( ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Tables freed\n")); (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + + return_VOID; } @@ -816,4 +818,3 @@ AcpiTbSetTableLoadedFlag ( (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); } - diff --git a/source/components/tables/tbutils.c b/source/components/tables/tbutils.c index c0a9456..5dda467 100644 --- a/source/components/tables/tbutils.c +++ b/source/components/tables/tbutils.c @@ -329,7 +329,7 @@ AcpiTbChecksum ( Sum = (UINT8) (Sum + *(Buffer++)); } - return Sum; + return (Sum); } diff --git a/source/components/tables/tbxface.c b/source/components/tables/tbxface.c index d2f31ea..1224e31 100644 --- a/source/components/tables/tbxface.c +++ b/source/components/tables/tbxface.c @@ -268,22 +268,23 @@ AcpiGetTableHeader ( sizeof (ACPI_TABLE_HEADER)); if (!Header) { - return AE_NO_MEMORY; + return (AE_NO_MEMORY); } - ACPI_MEMCPY (OutTableHeader, Header, sizeof(ACPI_TABLE_HEADER)); - AcpiOsUnmapMemory (Header, sizeof(ACPI_TABLE_HEADER)); + ACPI_MEMCPY (OutTableHeader, Header, + sizeof (ACPI_TABLE_HEADER)); + AcpiOsUnmapMemory (Header, sizeof (ACPI_TABLE_HEADER)); } else { - return AE_NOT_FOUND; + return (AE_NOT_FOUND); } } else { ACPI_MEMCPY (OutTableHeader, AcpiGbl_RootTableList.Tables[i].Pointer, - sizeof(ACPI_TABLE_HEADER)); + sizeof (ACPI_TABLE_HEADER)); } return (AE_OK); @@ -522,4 +523,3 @@ Cleanup: } ACPI_EXPORT_SYMBOL (AcpiRemoveTableHandler) - diff --git a/source/components/tables/tbxfload.c b/source/components/tables/tbxfload.c index 2883bab..ecf8773 100644 --- a/source/components/tables/tbxfload.c +++ b/source/components/tables/tbxfload.c @@ -219,7 +219,7 @@ UnlockAndExit: * DESCRIPTION: Dynamically load an ACPI table from the caller's buffer. Must * be a valid ACPI table with a valid ACPI table header. * Note1: Mainly intended to support hotplug addition of SSDTs. - * Note2: Does not copy the incoming table. User is reponsible + * Note2: Does not copy the incoming table. User is responsible * to ensure that the table is not deleted or unmapped. * ******************************************************************************/ diff --git a/source/components/tables/tbxfroot.c b/source/components/tables/tbxfroot.c index 604f4d0..5124d36 100644 --- a/source/components/tables/tbxfroot.c +++ b/source/components/tables/tbxfroot.c @@ -79,8 +79,6 @@ static ACPI_STATUS AcpiTbValidateRsdp ( ACPI_TABLE_RSDP *Rsdp) { - ACPI_FUNCTION_ENTRY (); - /* * The signature and checksum must both be correct @@ -124,7 +122,7 @@ AcpiTbValidateRsdp ( * RETURN: Status, RSDP physical address * * DESCRIPTION: Search lower 1Mbyte of memory for the root system descriptor - * pointer structure. If it is found, set *RSDP to point to it. + * pointer structure. If it is found, set *RSDP to point to it. * * NOTE1: The RSDP must be either in the first 1K of the Extended * BIOS Data Area or between E0000 and FFFFF (From ACPI Spec.) @@ -296,4 +294,3 @@ AcpiTbScanMemoryForRsdp ( StartAddress)); return_PTR (NULL); } - diff --git a/source/components/utilities/utalloc.c b/source/components/utilities/utalloc.c index d2eb11e..8c076b1 100644 --- a/source/components/utilities/utalloc.c +++ b/source/components/utilities/utalloc.c @@ -413,4 +413,3 @@ AcpiUtAllocateZeroed ( return (Allocation); } - diff --git a/source/components/utilities/utcache.c b/source/components/utilities/utcache.c index 7b3abe2..44edbe5 100644 --- a/source/components/utilities/utcache.c +++ b/source/components/utilities/utcache.c @@ -205,7 +205,7 @@ AcpiOsDeleteCache ( * * RETURN: None * - * DESCRIPTION: Release an object to the specified cache. If cache is full, + * DESCRIPTION: Release an object to the specified cache. If cache is full, * the object is deleted. * ******************************************************************************/ @@ -269,9 +269,9 @@ AcpiOsReleaseObject ( * * PARAMETERS: Cache - Handle to cache object * - * RETURN: the acquired object. NULL on error + * RETURN: the acquired object. NULL on error * - * DESCRIPTION: Get an object from the specified cache. If cache is empty, + * DESCRIPTION: Get an object from the specified cache. If cache is empty, * the object is allocated. * ******************************************************************************/ @@ -357,5 +357,3 @@ AcpiOsAcquireObject ( return (Object); } #endif /* ACPI_USE_LOCAL_CACHE */ - - diff --git a/source/components/utilities/utclib.c b/source/components/utilities/utclib.c index d0153ec..c3eeec2 100644 --- a/source/components/utilities/utclib.c +++ b/source/components/utilities/utclib.c @@ -49,7 +49,7 @@ /* * These implementations of standard C Library routines can optionally be - * used if a C library is not available. In general, they are less efficient + * used if a C library is not available. In general, they are less efficient * than an inline or assembly implementation */ @@ -745,134 +745,134 @@ AcpiUtToLower ( ******************************************************************************/ const UINT8 _acpi_ctype[257] = { - _ACPI_CN, /* 0x0 0. */ - _ACPI_CN, /* 0x1 1. */ - _ACPI_CN, /* 0x2 2. */ - _ACPI_CN, /* 0x3 3. */ - _ACPI_CN, /* 0x4 4. */ - _ACPI_CN, /* 0x5 5. */ - _ACPI_CN, /* 0x6 6. */ - _ACPI_CN, /* 0x7 7. */ - _ACPI_CN, /* 0x8 8. */ - _ACPI_CN|_ACPI_SP, /* 0x9 9. */ - _ACPI_CN|_ACPI_SP, /* 0xA 10. */ - _ACPI_CN|_ACPI_SP, /* 0xB 11. */ - _ACPI_CN|_ACPI_SP, /* 0xC 12. */ - _ACPI_CN|_ACPI_SP, /* 0xD 13. */ - _ACPI_CN, /* 0xE 14. */ - _ACPI_CN, /* 0xF 15. */ - _ACPI_CN, /* 0x10 16. */ - _ACPI_CN, /* 0x11 17. */ - _ACPI_CN, /* 0x12 18. */ - _ACPI_CN, /* 0x13 19. */ - _ACPI_CN, /* 0x14 20. */ - _ACPI_CN, /* 0x15 21. */ - _ACPI_CN, /* 0x16 22. */ - _ACPI_CN, /* 0x17 23. */ - _ACPI_CN, /* 0x18 24. */ - _ACPI_CN, /* 0x19 25. */ - _ACPI_CN, /* 0x1A 26. */ - _ACPI_CN, /* 0x1B 27. */ - _ACPI_CN, /* 0x1C 28. */ - _ACPI_CN, /* 0x1D 29. */ - _ACPI_CN, /* 0x1E 30. */ - _ACPI_CN, /* 0x1F 31. */ - _ACPI_XS|_ACPI_SP, /* 0x20 32. ' ' */ - _ACPI_PU, /* 0x21 33. '!' */ - _ACPI_PU, /* 0x22 34. '"' */ - _ACPI_PU, /* 0x23 35. '#' */ - _ACPI_PU, /* 0x24 36. '$' */ - _ACPI_PU, /* 0x25 37. '%' */ - _ACPI_PU, /* 0x26 38. '&' */ - _ACPI_PU, /* 0x27 39. ''' */ - _ACPI_PU, /* 0x28 40. '(' */ - _ACPI_PU, /* 0x29 41. ')' */ - _ACPI_PU, /* 0x2A 42. '*' */ - _ACPI_PU, /* 0x2B 43. '+' */ - _ACPI_PU, /* 0x2C 44. ',' */ - _ACPI_PU, /* 0x2D 45. '-' */ - _ACPI_PU, /* 0x2E 46. '.' */ - _ACPI_PU, /* 0x2F 47. '/' */ - _ACPI_XD|_ACPI_DI, /* 0x30 48. '0' */ - _ACPI_XD|_ACPI_DI, /* 0x31 49. '1' */ - _ACPI_XD|_ACPI_DI, /* 0x32 50. '2' */ - _ACPI_XD|_ACPI_DI, /* 0x33 51. '3' */ - _ACPI_XD|_ACPI_DI, /* 0x34 52. '4' */ - _ACPI_XD|_ACPI_DI, /* 0x35 53. '5' */ - _ACPI_XD|_ACPI_DI, /* 0x36 54. '6' */ - _ACPI_XD|_ACPI_DI, /* 0x37 55. '7' */ - _ACPI_XD|_ACPI_DI, /* 0x38 56. '8' */ - _ACPI_XD|_ACPI_DI, /* 0x39 57. '9' */ - _ACPI_PU, /* 0x3A 58. ':' */ - _ACPI_PU, /* 0x3B 59. ';' */ - _ACPI_PU, /* 0x3C 60. '<' */ - _ACPI_PU, /* 0x3D 61. '=' */ - _ACPI_PU, /* 0x3E 62. '>' */ - _ACPI_PU, /* 0x3F 63. '?' */ - _ACPI_PU, /* 0x40 64. '@' */ - _ACPI_XD|_ACPI_UP, /* 0x41 65. 'A' */ - _ACPI_XD|_ACPI_UP, /* 0x42 66. 'B' */ - _ACPI_XD|_ACPI_UP, /* 0x43 67. 'C' */ - _ACPI_XD|_ACPI_UP, /* 0x44 68. 'D' */ - _ACPI_XD|_ACPI_UP, /* 0x45 69. 'E' */ - _ACPI_XD|_ACPI_UP, /* 0x46 70. 'F' */ - _ACPI_UP, /* 0x47 71. 'G' */ - _ACPI_UP, /* 0x48 72. 'H' */ - _ACPI_UP, /* 0x49 73. 'I' */ - _ACPI_UP, /* 0x4A 74. 'J' */ - _ACPI_UP, /* 0x4B 75. 'K' */ - _ACPI_UP, /* 0x4C 76. 'L' */ - _ACPI_UP, /* 0x4D 77. 'M' */ - _ACPI_UP, /* 0x4E 78. 'N' */ - _ACPI_UP, /* 0x4F 79. 'O' */ - _ACPI_UP, /* 0x50 80. 'P' */ - _ACPI_UP, /* 0x51 81. 'Q' */ - _ACPI_UP, /* 0x52 82. 'R' */ - _ACPI_UP, /* 0x53 83. 'S' */ - _ACPI_UP, /* 0x54 84. 'T' */ - _ACPI_UP, /* 0x55 85. 'U' */ - _ACPI_UP, /* 0x56 86. 'V' */ - _ACPI_UP, /* 0x57 87. 'W' */ - _ACPI_UP, /* 0x58 88. 'X' */ - _ACPI_UP, /* 0x59 89. 'Y' */ - _ACPI_UP, /* 0x5A 90. 'Z' */ - _ACPI_PU, /* 0x5B 91. '[' */ - _ACPI_PU, /* 0x5C 92. '\' */ - _ACPI_PU, /* 0x5D 93. ']' */ - _ACPI_PU, /* 0x5E 94. '^' */ - _ACPI_PU, /* 0x5F 95. '_' */ - _ACPI_PU, /* 0x60 96. '`' */ - _ACPI_XD|_ACPI_LO, /* 0x61 97. 'a' */ - _ACPI_XD|_ACPI_LO, /* 0x62 98. 'b' */ - _ACPI_XD|_ACPI_LO, /* 0x63 99. 'c' */ - _ACPI_XD|_ACPI_LO, /* 0x64 100. 'd' */ - _ACPI_XD|_ACPI_LO, /* 0x65 101. 'e' */ - _ACPI_XD|_ACPI_LO, /* 0x66 102. 'f' */ - _ACPI_LO, /* 0x67 103. 'g' */ - _ACPI_LO, /* 0x68 104. 'h' */ - _ACPI_LO, /* 0x69 105. 'i' */ - _ACPI_LO, /* 0x6A 106. 'j' */ - _ACPI_LO, /* 0x6B 107. 'k' */ - _ACPI_LO, /* 0x6C 108. 'l' */ - _ACPI_LO, /* 0x6D 109. 'm' */ - _ACPI_LO, /* 0x6E 110. 'n' */ - _ACPI_LO, /* 0x6F 111. 'o' */ - _ACPI_LO, /* 0x70 112. 'p' */ - _ACPI_LO, /* 0x71 113. 'q' */ - _ACPI_LO, /* 0x72 114. 'r' */ - _ACPI_LO, /* 0x73 115. 's' */ - _ACPI_LO, /* 0x74 116. 't' */ - _ACPI_LO, /* 0x75 117. 'u' */ - _ACPI_LO, /* 0x76 118. 'v' */ - _ACPI_LO, /* 0x77 119. 'w' */ - _ACPI_LO, /* 0x78 120. 'x' */ - _ACPI_LO, /* 0x79 121. 'y' */ - _ACPI_LO, /* 0x7A 122. 'z' */ - _ACPI_PU, /* 0x7B 123. '{' */ - _ACPI_PU, /* 0x7C 124. '|' */ - _ACPI_PU, /* 0x7D 125. '}' */ - _ACPI_PU, /* 0x7E 126. '~' */ - _ACPI_CN, /* 0x7F 127. */ + _ACPI_CN, /* 0x00 0 NUL */ + _ACPI_CN, /* 0x01 1 SOH */ + _ACPI_CN, /* 0x02 2 STX */ + _ACPI_CN, /* 0x03 3 ETX */ + _ACPI_CN, /* 0x04 4 EOT */ + _ACPI_CN, /* 0x05 5 ENQ */ + _ACPI_CN, /* 0x06 6 ACK */ + _ACPI_CN, /* 0x07 7 BEL */ + _ACPI_CN, /* 0x08 8 BS */ + _ACPI_CN|_ACPI_SP, /* 0x09 9 TAB */ + _ACPI_CN|_ACPI_SP, /* 0x0A 10 LF */ + _ACPI_CN|_ACPI_SP, /* 0x0B 11 VT */ + _ACPI_CN|_ACPI_SP, /* 0x0C 12 FF */ + _ACPI_CN|_ACPI_SP, /* 0x0D 13 CR */ + _ACPI_CN, /* 0x0E 14 SO */ + _ACPI_CN, /* 0x0F 15 SI */ + _ACPI_CN, /* 0x10 16 DLE */ + _ACPI_CN, /* 0x11 17 DC1 */ + _ACPI_CN, /* 0x12 18 DC2 */ + _ACPI_CN, /* 0x13 19 DC3 */ + _ACPI_CN, /* 0x14 20 DC4 */ + _ACPI_CN, /* 0x15 21 NAK */ + _ACPI_CN, /* 0x16 22 SYN */ + _ACPI_CN, /* 0x17 23 ETB */ + _ACPI_CN, /* 0x18 24 CAN */ + _ACPI_CN, /* 0x19 25 EM */ + _ACPI_CN, /* 0x1A 26 SUB */ + _ACPI_CN, /* 0x1B 27 ESC */ + _ACPI_CN, /* 0x1C 28 FS */ + _ACPI_CN, /* 0x1D 29 GS */ + _ACPI_CN, /* 0x1E 30 RS */ + _ACPI_CN, /* 0x1F 31 US */ + _ACPI_XS|_ACPI_SP, /* 0x20 32 ' ' */ + _ACPI_PU, /* 0x21 33 '!' */ + _ACPI_PU, /* 0x22 34 '"' */ + _ACPI_PU, /* 0x23 35 '#' */ + _ACPI_PU, /* 0x24 36 '$' */ + _ACPI_PU, /* 0x25 37 '%' */ + _ACPI_PU, /* 0x26 38 '&' */ + _ACPI_PU, /* 0x27 39 ''' */ + _ACPI_PU, /* 0x28 40 '(' */ + _ACPI_PU, /* 0x29 41 ')' */ + _ACPI_PU, /* 0x2A 42 '*' */ + _ACPI_PU, /* 0x2B 43 '+' */ + _ACPI_PU, /* 0x2C 44 ',' */ + _ACPI_PU, /* 0x2D 45 '-' */ + _ACPI_PU, /* 0x2E 46 '.' */ + _ACPI_PU, /* 0x2F 47 '/' */ + _ACPI_XD|_ACPI_DI, /* 0x30 48 '0' */ + _ACPI_XD|_ACPI_DI, /* 0x31 49 '1' */ + _ACPI_XD|_ACPI_DI, /* 0x32 50 '2' */ + _ACPI_XD|_ACPI_DI, /* 0x33 51 '3' */ + _ACPI_XD|_ACPI_DI, /* 0x34 52 '4' */ + _ACPI_XD|_ACPI_DI, /* 0x35 53 '5' */ + _ACPI_XD|_ACPI_DI, /* 0x36 54 '6' */ + _ACPI_XD|_ACPI_DI, /* 0x37 55 '7' */ + _ACPI_XD|_ACPI_DI, /* 0x38 56 '8' */ + _ACPI_XD|_ACPI_DI, /* 0x39 57 '9' */ + _ACPI_PU, /* 0x3A 58 ':' */ + _ACPI_PU, /* 0x3B 59 ';' */ + _ACPI_PU, /* 0x3C 60 '<' */ + _ACPI_PU, /* 0x3D 61 '=' */ + _ACPI_PU, /* 0x3E 62 '>' */ + _ACPI_PU, /* 0x3F 63 '?' */ + _ACPI_PU, /* 0x40 64 '@' */ + _ACPI_XD|_ACPI_UP, /* 0x41 65 'A' */ + _ACPI_XD|_ACPI_UP, /* 0x42 66 'B' */ + _ACPI_XD|_ACPI_UP, /* 0x43 67 'C' */ + _ACPI_XD|_ACPI_UP, /* 0x44 68 'D' */ + _ACPI_XD|_ACPI_UP, /* 0x45 69 'E' */ + _ACPI_XD|_ACPI_UP, /* 0x46 70 'F' */ + _ACPI_UP, /* 0x47 71 'G' */ + _ACPI_UP, /* 0x48 72 'H' */ + _ACPI_UP, /* 0x49 73 'I' */ + _ACPI_UP, /* 0x4A 74 'J' */ + _ACPI_UP, /* 0x4B 75 'K' */ + _ACPI_UP, /* 0x4C 76 'L' */ + _ACPI_UP, /* 0x4D 77 'M' */ + _ACPI_UP, /* 0x4E 78 'N' */ + _ACPI_UP, /* 0x4F 79 'O' */ + _ACPI_UP, /* 0x50 80 'P' */ + _ACPI_UP, /* 0x51 81 'Q' */ + _ACPI_UP, /* 0x52 82 'R' */ + _ACPI_UP, /* 0x53 83 'S' */ + _ACPI_UP, /* 0x54 84 'T' */ + _ACPI_UP, /* 0x55 85 'U' */ + _ACPI_UP, /* 0x56 86 'V' */ + _ACPI_UP, /* 0x57 87 'W' */ + _ACPI_UP, /* 0x58 88 'X' */ + _ACPI_UP, /* 0x59 89 'Y' */ + _ACPI_UP, /* 0x5A 90 'Z' */ + _ACPI_PU, /* 0x5B 91 '[' */ + _ACPI_PU, /* 0x5C 92 '\' */ + _ACPI_PU, /* 0x5D 93 ']' */ + _ACPI_PU, /* 0x5E 94 '^' */ + _ACPI_PU, /* 0x5F 95 '_' */ + _ACPI_PU, /* 0x60 96 '`' */ + _ACPI_XD|_ACPI_LO, /* 0x61 97 'a' */ + _ACPI_XD|_ACPI_LO, /* 0x62 98 'b' */ + _ACPI_XD|_ACPI_LO, /* 0x63 99 'c' */ + _ACPI_XD|_ACPI_LO, /* 0x64 100 'd' */ + _ACPI_XD|_ACPI_LO, /* 0x65 101 'e' */ + _ACPI_XD|_ACPI_LO, /* 0x66 102 'f' */ + _ACPI_LO, /* 0x67 103 'g' */ + _ACPI_LO, /* 0x68 104 'h' */ + _ACPI_LO, /* 0x69 105 'i' */ + _ACPI_LO, /* 0x6A 106 'j' */ + _ACPI_LO, /* 0x6B 107 'k' */ + _ACPI_LO, /* 0x6C 108 'l' */ + _ACPI_LO, /* 0x6D 109 'm' */ + _ACPI_LO, /* 0x6E 110 'n' */ + _ACPI_LO, /* 0x6F 111 'o' */ + _ACPI_LO, /* 0x70 112 'p' */ + _ACPI_LO, /* 0x71 113 'q' */ + _ACPI_LO, /* 0x72 114 'r' */ + _ACPI_LO, /* 0x73 115 's' */ + _ACPI_LO, /* 0x74 116 't' */ + _ACPI_LO, /* 0x75 117 'u' */ + _ACPI_LO, /* 0x76 118 'v' */ + _ACPI_LO, /* 0x77 119 'w' */ + _ACPI_LO, /* 0x78 120 'x' */ + _ACPI_LO, /* 0x79 121 'y' */ + _ACPI_LO, /* 0x7A 122 'z' */ + _ACPI_PU, /* 0x7B 123 '{' */ + _ACPI_PU, /* 0x7C 124 '|' */ + _ACPI_PU, /* 0x7D 125 '}' */ + _ACPI_PU, /* 0x7E 126 '~' */ + _ACPI_CN, /* 0x7F 127 DEL */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x80 to 0x8F */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x90 to 0x9F */ @@ -881,9 +881,9 @@ const UINT8 _acpi_ctype[257] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xC0 to 0xCF */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xD0 to 0xDF */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xE0 to 0xEF */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* 0xF0 to 0x100 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xF0 to 0xFF */ + 0 /* 0x100 */ }; #endif /* ACPI_USE_SYSTEM_CLIBRARY */ - diff --git a/source/components/utilities/utcopy.c b/source/components/utilities/utcopy.c index ab04a7a..e6437c9 100644 --- a/source/components/utilities/utcopy.c +++ b/source/components/utilities/utcopy.c @@ -1074,5 +1074,3 @@ AcpiUtCopyIobjectToIobject ( return_ACPI_STATUS (Status); } - - diff --git a/source/components/utilities/utdebug.c b/source/components/utilities/utdebug.c index 051d47b..ea38e98 100644 --- a/source/components/utilities/utdebug.c +++ b/source/components/utilities/utdebug.c @@ -250,7 +250,7 @@ ACPI_EXPORT_SYMBOL (AcpiDebugPrint) * * RETURN: None * - * DESCRIPTION: Print message with no headers. Has same interface as + * DESCRIPTION: Print message with no headers. Has same interface as * DebugPrint so that the same macros can be used. * ******************************************************************************/ @@ -293,7 +293,7 @@ ACPI_EXPORT_SYMBOL (AcpiDebugPrintRaw) * * RETURN: None * - * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is + * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is * set in DebugLevel * ******************************************************************************/ @@ -329,7 +329,7 @@ ACPI_EXPORT_SYMBOL (AcpiUtTrace) * * RETURN: None * - * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is + * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is * set in DebugLevel * ******************************************************************************/ @@ -342,6 +342,7 @@ AcpiUtTracePtr ( UINT32 ComponentId, void *Pointer) { + AcpiGbl_NestingLevel++; AcpiUtTrackStackPtr (); @@ -363,7 +364,7 @@ AcpiUtTracePtr ( * * RETURN: None * - * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is + * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is * set in DebugLevel * ******************************************************************************/ @@ -398,7 +399,7 @@ AcpiUtTraceStr ( * * RETURN: None * - * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is + * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is * set in DebugLevel * ******************************************************************************/ @@ -432,7 +433,7 @@ AcpiUtTraceU32 ( * * RETURN: None * - * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is + * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is * set in DebugLevel * ******************************************************************************/ @@ -467,8 +468,8 @@ ACPI_EXPORT_SYMBOL (AcpiUtExit) * * RETURN: None * - * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is - * set in DebugLevel. Prints exit status also. + * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is + * set in DebugLevel. Prints exit status also. * ******************************************************************************/ @@ -514,8 +515,8 @@ ACPI_EXPORT_SYMBOL (AcpiUtStatusExit) * * RETURN: None * - * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is - * set in DebugLevel. Prints exit value also. + * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is + * set in DebugLevel. Prints exit value also. * ******************************************************************************/ @@ -551,8 +552,8 @@ ACPI_EXPORT_SYMBOL (AcpiUtValueExit) * * RETURN: None * - * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is - * set in DebugLevel. Prints exit value also. + * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is + * set in DebugLevel. Prints exit value also. * ******************************************************************************/ @@ -582,7 +583,7 @@ AcpiUtPtrExit ( * PARAMETERS: Buffer - Buffer to dump * Count - Amount to dump, in bytes * Display - BYTE, WORD, DWORD, or QWORD display - * ComponentID - Caller's component ID + * Offset - Beginning buffer offset (display only) * * RETURN: None * @@ -591,10 +592,11 @@ AcpiUtPtrExit ( ******************************************************************************/ void -AcpiUtDumpBuffer2 ( +AcpiUtDumpBuffer ( UINT8 *Buffer, UINT32 Count, - UINT32 Display) + UINT32 Display, + UINT32 BaseOffset) { UINT32 i = 0; UINT32 j; @@ -619,7 +621,7 @@ AcpiUtDumpBuffer2 ( { /* Print current offset */ - AcpiOsPrintf ("%6.4X: ", i); + AcpiOsPrintf ("%6.4X: ", (BaseOffset + i)); /* Print 16 hex chars */ @@ -706,7 +708,7 @@ AcpiUtDumpBuffer2 ( /******************************************************************************* * - * FUNCTION: AcpiUtDumpBuffer + * FUNCTION: AcpiUtDebugDumpBuffer * * PARAMETERS: Buffer - Buffer to dump * Count - Amount to dump, in bytes @@ -720,7 +722,7 @@ AcpiUtDumpBuffer2 ( ******************************************************************************/ void -AcpiUtDumpBuffer ( +AcpiUtDebugDumpBuffer ( UINT8 *Buffer, UINT32 Count, UINT32 Display, @@ -735,7 +737,5 @@ AcpiUtDumpBuffer ( return; } - AcpiUtDumpBuffer2 (Buffer, Count, Display); + AcpiUtDumpBuffer (Buffer, Count, Display, 0); } - - diff --git a/source/components/utilities/utdelete.c b/source/components/utilities/utdelete.c index fb32611..4ed6297 100644 --- a/source/components/utilities/utdelete.c +++ b/source/components/utilities/utdelete.c @@ -773,5 +773,3 @@ AcpiUtRemoveReference ( (void) AcpiUtUpdateObjectReference (Object, REF_DECREMENT); return_VOID; } - - diff --git a/source/components/utilities/utids.c b/source/components/utilities/utids.c index 226d8c1..86aea04 100644 --- a/source/components/utilities/utids.c +++ b/source/components/utilities/utids.c @@ -73,10 +73,10 @@ ACPI_STATUS AcpiUtExecute_HID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID **ReturnId) + ACPI_PNP_DEVICE_ID **ReturnId) { ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_DEVICE_ID *Hid; + ACPI_PNP_DEVICE_ID *Hid; UINT32 Length; ACPI_STATUS Status; @@ -104,16 +104,16 @@ AcpiUtExecute_HID ( /* Allocate a buffer for the HID */ - Hid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_DEVICE_ID) + (ACPI_SIZE) Length); + Hid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); if (!Hid) { Status = AE_NO_MEMORY; goto Cleanup; } - /* Area for the string starts after DEVICE_ID struct */ + /* Area for the string starts after PNP_DEVICE_ID struct */ - Hid->String = ACPI_ADD_PTR (char, Hid, sizeof (ACPI_DEVICE_ID)); + Hid->String = ACPI_ADD_PTR (char, Hid, sizeof (ACPI_PNP_DEVICE_ID)); /* Convert EISAID to a string or simply copy existing string */ @@ -141,6 +141,77 @@ Cleanup: /******************************************************************************* * + * FUNCTION: AcpiUtExecute_SUB + * + * PARAMETERS: DeviceNode - Node for the device + * ReturnId - Where the _SUB is returned + * + * RETURN: Status + * + * DESCRIPTION: Executes the _SUB control method that returns the subsystem + * ID of the device. The _SUB value is always a string containing + * either a valid PNP or ACPI ID. + * + * NOTE: Internal function, no parameter validation + * + ******************************************************************************/ + +ACPI_STATUS +AcpiUtExecute_SUB ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_PNP_DEVICE_ID **ReturnId) +{ + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_PNP_DEVICE_ID *Sub; + UINT32 Length; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (UtExecute_SUB); + + + Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__SUB, + ACPI_BTYPE_STRING, &ObjDesc); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Get the size of the String to be returned, includes null terminator */ + + Length = ObjDesc->String.Length + 1; + + /* Allocate a buffer for the SUB */ + + Sub = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); + if (!Sub) + { + Status = AE_NO_MEMORY; + goto Cleanup; + } + + /* Area for the string starts after PNP_DEVICE_ID struct */ + + Sub->String = ACPI_ADD_PTR (char, Sub, sizeof (ACPI_PNP_DEVICE_ID)); + + /* Simply copy existing string */ + + ACPI_STRCPY (Sub->String, ObjDesc->String.Pointer); + Sub->Length = Length; + *ReturnId = Sub; + + +Cleanup: + + /* On exit, we must delete the return object */ + + AcpiUtRemoveReference (ObjDesc); + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * * FUNCTION: AcpiUtExecute_UID * * PARAMETERS: DeviceNode - Node for the device @@ -160,10 +231,10 @@ Cleanup: ACPI_STATUS AcpiUtExecute_UID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID **ReturnId) + ACPI_PNP_DEVICE_ID **ReturnId) { ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_DEVICE_ID *Uid; + ACPI_PNP_DEVICE_ID *Uid; UINT32 Length; ACPI_STATUS Status; @@ -191,16 +262,16 @@ AcpiUtExecute_UID ( /* Allocate a buffer for the UID */ - Uid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_DEVICE_ID) + (ACPI_SIZE) Length); + Uid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); if (!Uid) { Status = AE_NO_MEMORY; goto Cleanup; } - /* Area for the string starts after DEVICE_ID struct */ + /* Area for the string starts after PNP_DEVICE_ID struct */ - Uid->String = ACPI_ADD_PTR (char, Uid, sizeof (ACPI_DEVICE_ID)); + Uid->String = ACPI_ADD_PTR (char, Uid, sizeof (ACPI_PNP_DEVICE_ID)); /* Convert an Integer to string, or just copy an existing string */ @@ -252,11 +323,11 @@ Cleanup: ACPI_STATUS AcpiUtExecute_CID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID_LIST **ReturnCidList) + ACPI_PNP_DEVICE_ID_LIST **ReturnCidList) { ACPI_OPERAND_OBJECT **CidObjects; ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_DEVICE_ID_LIST *CidList; + ACPI_PNP_DEVICE_ID_LIST *CidList; char *NextIdString; UINT32 StringAreaSize; UINT32 Length; @@ -320,11 +391,11 @@ AcpiUtExecute_CID ( /* * Now that we know the length of the CIDs, allocate return buffer: * 1) Size of the base structure + - * 2) Size of the CID DEVICE_ID array + + * 2) Size of the CID PNP_DEVICE_ID array + * 3) Size of the actual CID strings */ - CidListSize = sizeof (ACPI_DEVICE_ID_LIST) + - ((Count - 1) * sizeof (ACPI_DEVICE_ID)) + + CidListSize = sizeof (ACPI_PNP_DEVICE_ID_LIST) + + ((Count - 1) * sizeof (ACPI_PNP_DEVICE_ID)) + StringAreaSize; CidList = ACPI_ALLOCATE_ZEROED (CidListSize); @@ -334,10 +405,10 @@ AcpiUtExecute_CID ( goto Cleanup; } - /* Area for CID strings starts after the CID DEVICE_ID array */ + /* Area for CID strings starts after the CID PNP_DEVICE_ID array */ NextIdString = ACPI_CAST_PTR (char, CidList->Ids) + - ((ACPI_SIZE) Count * sizeof (ACPI_DEVICE_ID)); + ((ACPI_SIZE) Count * sizeof (ACPI_PNP_DEVICE_ID)); /* Copy/convert the CIDs to the return buffer */ @@ -377,4 +448,3 @@ Cleanup: AcpiUtRemoveReference (ObjDesc); return_ACPI_STATUS (Status); } - diff --git a/source/components/utilities/utinit.c b/source/components/utilities/utinit.c index 6831595..861b00c 100644 --- a/source/components/utilities/utinit.c +++ b/source/components/utilities/utinit.c @@ -188,5 +188,3 @@ AcpiUtSubsystemShutdown ( (void) AcpiUtDeleteCaches (); return_VOID; } - - diff --git a/source/components/utilities/utlock.c b/source/components/utilities/utlock.c index 61585ad..1e4648e 100644 --- a/source/components/utilities/utlock.c +++ b/source/components/utilities/utlock.c @@ -202,4 +202,3 @@ AcpiUtReleaseWriteLock ( AcpiOsReleaseMutex (Lock->WriterMutex); } - diff --git a/source/components/utilities/utmath.c b/source/components/utilities/utmath.c index d0fad7c..bbb2ffc 100644 --- a/source/components/utilities/utmath.c +++ b/source/components/utilities/utmath.c @@ -90,7 +90,7 @@ typedef union uint64_overlay * RETURN: Status (Checks for divide-by-zero) * * DESCRIPTION: Perform a short (maximum 64 bits divided by 32 bits) - * divide and modulo. The result is a 64-bit quotient and a + * divide and modulo. The result is a 64-bit quotient and a * 32-bit remainder. * ******************************************************************************/ @@ -375,5 +375,3 @@ AcpiUtDivide ( } #endif - - diff --git a/source/components/utilities/utmisc.c b/source/components/utilities/utmisc.c index a92121f..c0c1f20 100644 --- a/source/components/utilities/utmisc.c +++ b/source/components/utilities/utmisc.c @@ -281,7 +281,7 @@ Exit: * control method or unloading a table. Either way, we would * ignore any error anyway. * - * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 255 + * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 255 * ******************************************************************************/ @@ -612,8 +612,8 @@ AcpiUtDwordByteSwap ( * RETURN: None * * DESCRIPTION: Set the global integer bit width based upon the revision - * of the DSDT. For Revision 1 and 0, Integers are 32 bits. - * For Revision 2 and above, Integers are 64 bits. Yes, this + * of the DSDT. For Revision 1 and 0, Integers are 32 bits. + * For Revision 2 and above, Integers are 64 bits. Yes, this * makes a difference. * ******************************************************************************/ @@ -768,7 +768,7 @@ AcpiUtValidAcpiChar ( * * RETURN: TRUE if the name is valid, FALSE otherwise * - * DESCRIPTION: Check for a valid ACPI name. Each character must be one of: + * DESCRIPTION: Check for a valid ACPI name. Each character must be one of: * 1) Upper case alpha * 2) numeric * 3) underscore @@ -825,11 +825,14 @@ AcpiUtRepairName ( { UINT32 i; BOOLEAN FoundBadChar = FALSE; + UINT32 OriginalName; ACPI_FUNCTION_NAME (UtRepairName); + ACPI_MOVE_NAME (&OriginalName, Name); + /* Check each character in the name */ for (i = 0; i < ACPI_NAME_SIZE; i++) @@ -855,12 +858,14 @@ AcpiUtRepairName ( if (!AcpiGbl_EnableInterpreterSlack) { ACPI_WARNING ((AE_INFO, - "Found bad character(s) in name, repaired: [%4.4s]\n", Name)); + "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]", + OriginalName, Name)); } else { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Found bad character(s) in name, repaired: [%4.4s]\n", Name)); + "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]", + OriginalName, Name)); } } } @@ -1167,10 +1172,10 @@ AcpiUtWalkPackageTree ( /* * Check for: - * 1) An uninitialized package element. It is completely + * 1) An uninitialized package element. It is completely * legal to declare a package and leave it uninitialized * 2) Not an internal object - can be a namespace node instead - * 3) Any type other than a package. Packages are handled in else + * 3) Any type other than a package. Packages are handled in else * case below. */ if ((!ThisSourceObj) || @@ -1189,7 +1194,7 @@ AcpiUtWalkPackageTree ( { /* * We've handled all of the objects at this level, This means - * that we have just completed a package. That package may + * that we have just completed a package. That package may * have contained one or more packages itself. * * Delete this state and pop the previous state (package). diff --git a/source/components/utilities/utmutex.c b/source/components/utilities/utmutex.c index f1cdb018..3ea056d 100644 --- a/source/components/utilities/utmutex.c +++ b/source/components/utilities/utmutex.c @@ -225,6 +225,8 @@ AcpiUtDeleteMutex ( AcpiGbl_MutexInfo[MutexId].Mutex = NULL; AcpiGbl_MutexInfo[MutexId].ThreadId = ACPI_MUTEX_NOT_ACQUIRED; + + return_VOID; } @@ -264,9 +266,9 @@ AcpiUtAcquireMutex ( /* * Mutex debug code, for internal debugging only. * - * Deadlock prevention. Check if this thread owns any mutexes of value - * greater than or equal to this one. If so, the thread has violated - * the mutex ordering rule. This indicates a coding error somewhere in + * Deadlock prevention. Check if this thread owns any mutexes of value + * greater than or equal to this one. If so, the thread has violated + * the mutex ordering rule. This indicates a coding error somewhere in * the ACPI subsystem code. */ for (i = MutexId; i < ACPI_NUM_MUTEX; i++) @@ -337,6 +339,7 @@ AcpiUtReleaseMutex ( { ACPI_FUNCTION_NAME (UtReleaseMutex); + ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u releasing Mutex [%s]\n", (UINT32) AcpiOsGetThreadId (), AcpiUtGetMutexName (MutexId))); @@ -362,9 +365,9 @@ AcpiUtReleaseMutex ( /* * Mutex debug code, for internal debugging only. * - * Deadlock prevention. Check if this thread owns any mutexes of value - * greater than this one. If so, the thread has violated the mutex - * ordering rule. This indicates a coding error somewhere in + * Deadlock prevention. Check if this thread owns any mutexes of value + * greater than this one. If so, the thread has violated the mutex + * ordering rule. This indicates a coding error somewhere in * the ACPI subsystem code. */ for (i = MutexId; i < ACPI_NUM_MUTEX; i++) @@ -393,5 +396,3 @@ AcpiUtReleaseMutex ( AcpiOsReleaseMutex (AcpiGbl_MutexInfo[MutexId].Mutex); return (AE_OK); } - - diff --git a/source/components/utilities/utobject.c b/source/components/utilities/utobject.c index 03fa9dc..2841541 100644 --- a/source/components/utilities/utobject.c +++ b/source/components/utilities/utobject.c @@ -86,7 +86,7 @@ AcpiUtGetElementLength ( * * NOTE: We always allocate the worst-case object descriptor because * these objects are cached, and we want them to be - * one-size-satisifies-any-request. This in itself may not be + * one-size-satisifies-any-request. This in itself may not be * the most memory efficient, but the efficiency of the object * cache should more than make up for this! * @@ -415,9 +415,9 @@ AcpiUtValidInternalObject ( * LineNumber - Caller's line number (for error output) * ComponentId - Caller's component ID (for error output) * - * RETURN: Pointer to newly allocated object descriptor. Null on error + * RETURN: Pointer to newly allocated object descriptor. Null on error * - * DESCRIPTION: Allocate a new object descriptor. Gracefully handle + * DESCRIPTION: Allocate a new object descriptor. Gracefully handle * error conditions. * ******************************************************************************/ @@ -620,7 +620,7 @@ AcpiUtGetSimpleObjectSize ( /* * Account for the space required by the object rounded up to the next - * multiple of the machine word size. This keeps each object aligned + * multiple of the machine word size. This keeps each object aligned * on a machine word boundary. (preventing alignment faults on some * machines.) */ @@ -783,5 +783,3 @@ AcpiUtGetObjectSize ( return (Status); } - - diff --git a/source/components/utilities/utresrc.c b/source/components/utilities/utresrc.c index 9855af5..a1a6c5b 100644 --- a/source/components/utilities/utresrc.c +++ b/source/components/utilities/utresrc.c @@ -919,5 +919,3 @@ AcpiUtGetResourceEndTag ( return_ACPI_STATUS (Status); } - - diff --git a/source/components/utilities/utstate.c b/source/components/utilities/utstate.c index 62a1aef..f144bca 100644 --- a/source/components/utilities/utstate.c +++ b/source/components/utilities/utstate.c @@ -163,7 +163,7 @@ AcpiUtPopGenericState ( * * RETURN: The new state object. NULL on failure. * - * DESCRIPTION: Create a generic state object. Attempt to obtain one from + * DESCRIPTION: Create a generic state object. Attempt to obtain one from * the global state cache; If none available, create a new one. * ******************************************************************************/ @@ -394,5 +394,3 @@ AcpiUtDeleteGenericState ( } return_VOID; } - - diff --git a/source/components/utilities/uttrack.c b/source/components/utilities/uttrack.c index 7d58f5c..2e37aeb 100644 --- a/source/components/utilities/uttrack.c +++ b/source/components/utilities/uttrack.c @@ -45,9 +45,9 @@ * These procedures are used for tracking memory leaks in the subsystem, and * they get compiled out when the ACPI_DBG_TRACK_ALLOCATIONS is not set. * - * Each memory allocation is tracked via a doubly linked list. Each + * Each memory allocation is tracked via a doubly linked list. Each * element contains the caller's component, module name, function name, and - * line number. AcpiUtAllocate and AcpiUtAllocateZeroed call + * line number. AcpiUtAllocate and AcpiUtAllocateZeroed call * AcpiUtTrackAllocation to add an element to the list; deletion * occurs in the body of AcpiUtFree. */ @@ -62,11 +62,12 @@ #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("uttrack") + /* Local prototypes */ static ACPI_DEBUG_MEM_BLOCK * AcpiUtFindAllocation ( - void *Allocation); + ACPI_DEBUG_MEM_BLOCK *Allocation); static ACPI_STATUS AcpiUtTrackAllocation ( @@ -296,29 +297,52 @@ AcpiUtFreeAndTrack ( * * PARAMETERS: Allocation - Address of allocated memory * - * RETURN: A list element if found; NULL otherwise. + * RETURN: Three cases: + * 1) List is empty, NULL is returned. + * 2) Element was found. Returns Allocation parameter. + * 3) Element was not found. Returns position where it should be + * inserted into the list. * * DESCRIPTION: Searches for an element in the global allocation tracking list. + * If the element is not found, returns the location within the + * list where the element should be inserted. + * + * Note: The list is ordered by larger-to-smaller addresses. + * + * This global list is used to detect memory leaks in ACPICA as + * well as other issues such as an attempt to release the same + * internal object more than once. Although expensive as far + * as cpu time, this list is much more helpful for finding these + * types of issues than using memory leak detectors outside of + * the ACPICA code. * ******************************************************************************/ static ACPI_DEBUG_MEM_BLOCK * AcpiUtFindAllocation ( - void *Allocation) + ACPI_DEBUG_MEM_BLOCK *Allocation) { ACPI_DEBUG_MEM_BLOCK *Element; - ACPI_FUNCTION_ENTRY (); - - Element = AcpiGbl_GlobalList->ListHead; + if (!Element) + { + return (NULL); + } - /* Search for the address. */ - - while (Element) + /* + * Search for the address. + * + * Note: List is ordered by larger-to-smaller addresses, on the + * assumption that a new allocation usually has a larger address + * than previous allocations. + */ + while (Element > Allocation) { - if (Element == Allocation) + /* Check for end-of-list */ + + if (!Element->Next) { return (Element); } @@ -326,7 +350,12 @@ AcpiUtFindAllocation ( Element = Element->Next; } - return (NULL); + if (Element == Allocation) + { + return (Element); + } + + return (Element->Previous); } @@ -341,7 +370,7 @@ AcpiUtFindAllocation ( * Module - Source file name of caller * Line - Line number of caller * - * RETURN: None. + * RETURN: Status * * DESCRIPTION: Inserts an element into the global allocation tracking list. * @@ -377,23 +406,19 @@ AcpiUtTrackAllocation ( } /* - * Search list for this address to make sure it is not already on the list. - * This will catch several kinds of problems. + * Search the global list for this address to make sure it is not + * already present. This will catch several kinds of problems. */ Element = AcpiUtFindAllocation (Allocation); - if (Element) + if (Element == Allocation) { ACPI_ERROR ((AE_INFO, - "UtTrackAllocation: Allocation already present in list! (%p)", + "UtTrackAllocation: Allocation (%p) already present in global list!", Allocation)); - - ACPI_ERROR ((AE_INFO, "Element %p Address %p", - Element, Allocation)); - goto UnlockAndExit; } - /* Fill in the instance data. */ + /* Fill in the instance data */ Allocation->Size = (UINT32) Size; Allocation->AllocType = AllocType; @@ -403,17 +428,34 @@ AcpiUtTrackAllocation ( ACPI_STRNCPY (Allocation->Module, Module, ACPI_MAX_MODULE_NAME); Allocation->Module[ACPI_MAX_MODULE_NAME-1] = 0; - /* Insert at list head */ - - if (MemList->ListHead) + if (!Element) { - ((ACPI_DEBUG_MEM_BLOCK *)(MemList->ListHead))->Previous = Allocation; + /* Insert at list head */ + + if (MemList->ListHead) + { + ((ACPI_DEBUG_MEM_BLOCK *)(MemList->ListHead))->Previous = Allocation; + } + + Allocation->Next = MemList->ListHead; + Allocation->Previous = NULL; + + MemList->ListHead = Allocation; } + else + { + /* Insert after element */ - Allocation->Next = MemList->ListHead; - Allocation->Previous = NULL; + Allocation->Next = Element->Next; + Allocation->Previous = Element; - MemList->ListHead = Allocation; + if (Element->Next) + { + (Element->Next)->Previous = Allocation; + } + + Element->Next = Allocation; + } UnlockAndExit: @@ -431,7 +473,7 @@ UnlockAndExit: * Module - Source file name of caller * Line - Line number of caller * - * RETURN: + * RETURN: Status * * DESCRIPTION: Deletes an element from the global allocation tracking list. * @@ -505,7 +547,7 @@ AcpiUtRemoveAllocation ( * * FUNCTION: AcpiUtDumpAllocationInfo * - * PARAMETERS: + * PARAMETERS: None * * RETURN: None * @@ -566,7 +608,7 @@ AcpiUtDumpAllocationInfo ( * FUNCTION: AcpiUtDumpAllocations * * PARAMETERS: Component - Component(s) to dump info for. - * Module - Module to dump info for. NULL means all. + * Module - Module to dump info for. NULL means all. * * RETURN: None * @@ -590,7 +632,7 @@ AcpiUtDumpAllocations ( if (AcpiGbl_DisableMemTracking) { - return; + return_VOID; } /* @@ -598,7 +640,7 @@ AcpiUtDumpAllocations ( */ if (ACPI_FAILURE (AcpiUtAcquireMutex (ACPI_MTX_MEMORY))) { - return; + return_VOID; } Element = AcpiGbl_GlobalList->ListHead; @@ -708,4 +750,3 @@ AcpiUtDumpAllocations ( } #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ - diff --git a/source/components/utilities/utxface.c b/source/components/utilities/utxface.c index 38f7195..9574c26 100644 --- a/source/components/utilities/utxface.c +++ b/source/components/utilities/utxface.c @@ -160,7 +160,7 @@ ACPI_EXPORT_SYMBOL (AcpiSubsystemStatus) * RETURN: Status - the status of the call * * DESCRIPTION: This function is called to get information about the current - * state of the ACPI subsystem. It will return system information + * state of the ACPI subsystem. It will return system information * in the OutBuffer. * * If the function fails an appropriate status will be returned @@ -310,7 +310,7 @@ AcpiInstallInitializationHandler ( } AcpiGbl_InitHandler = Handler; - return AE_OK; + return (AE_OK); } ACPI_EXPORT_SYMBOL (AcpiInstallInitializationHandler) @@ -334,10 +334,12 @@ AcpiPurgeCachedObjects ( { ACPI_FUNCTION_TRACE (AcpiPurgeCachedObjects); + (void) AcpiOsPurgeCache (AcpiGbl_StateCache); (void) AcpiOsPurgeCache (AcpiGbl_OperandCache); (void) AcpiOsPurgeCache (AcpiGbl_PsNodeCache); (void) AcpiOsPurgeCache (AcpiGbl_PsNodeExtCache); + return_ACPI_STATUS (AE_OK); } diff --git a/source/components/utilities/utxferror.c b/source/components/utilities/utxferror.c index beeb7c7..dcf52f1 100644 --- a/source/components/utilities/utxferror.c +++ b/source/components/utilities/utxferror.c @@ -472,7 +472,7 @@ AcpiUtNamespaceError ( /* There is a non-ascii character in the name */ ACPI_MOVE_32_TO_32 (&BadName, ACPI_CAST_PTR (UINT32, InternalName)); - AcpiOsPrintf ("[0x%4.4X] (NON-ASCII)", BadName); + AcpiOsPrintf ("[0x%.8X] (NON-ASCII)", BadName); } else { diff --git a/source/include/acapps.h b/source/include/acapps.h index 0382ca8..c0b171b 100644 --- a/source/include/acapps.h +++ b/source/include/acapps.h @@ -214,4 +214,3 @@ AdWriteTable ( char *OemTableId); #endif /* _ACAPPS */ - diff --git a/source/include/acconfig.h b/source/include/acconfig.h index 7880516..b414383 100644 --- a/source/include/acconfig.h +++ b/source/include/acconfig.h @@ -53,8 +53,8 @@ /* * ACPI_DEBUG_OUTPUT - This switch enables all the debug facilities of the - * ACPI subsystem. This includes the DEBUG_PRINT output - * statements. When disabled, all DEBUG_PRINT + * ACPI subsystem. This includes the DEBUG_PRINT output + * statements. When disabled, all DEBUG_PRINT * statements are compiled out. * * ACPI_APPLICATION - Use this switch if the subsystem is going to be run @@ -63,12 +63,12 @@ */ /* - * OS name, used for the _OS object. The _OS object is essentially obsolete, + * OS name, used for the _OS object. The _OS object is essentially obsolete, * but there is a large base of ASL/AML code in existing machines that check - * for the string below. The use of this string usually guarantees that - * the ASL will execute down the most tested code path. Also, there is some + * for the string below. The use of this string usually guarantees that + * the ASL will execute down the most tested code path. Also, there is some * code that will not execute the _OSI method unless _OS matches the string - * below. Therefore, change this string at your own risk. + * below. Therefore, change this string at your own risk. */ #define ACPI_OS_NAME "Microsoft Windows NT" @@ -195,7 +195,7 @@ #define ACPI_MAX_ADDRESS_SPACE 255 -/* Array sizes. Used for range checking also */ +/* Array sizes. Used for range checking also */ #define ACPI_MAX_MATCH_OPCODE 5 @@ -230,4 +230,3 @@ #endif /* _ACCONFIG_H */ - diff --git a/source/include/acexcep.h b/source/include/acexcep.h index 856a359..072ddf9 100644 --- a/source/include/acexcep.h +++ b/source/include/acexcep.h @@ -127,7 +127,7 @@ /* - * AML exceptions. These are caused by problems with + * AML exceptions. These are caused by problems with * the actual AML byte stream */ #define AE_AML_BAD_OPCODE (ACPI_STATUS) (0x0001 | AE_CODE_AML) diff --git a/source/include/acglobal.h b/source/include/acglobal.h index 1fc2bc6..42c6234 100644 --- a/source/include/acglobal.h +++ b/source/include/acglobal.h @@ -72,7 +72,7 @@ /* * Enable "slack" in the AML interpreter? Default is FALSE, and the - * interpreter strictly follows the ACPI specification. Setting to TRUE + * interpreter strictly follows the ACPI specification. Setting to TRUE * allows the interpreter to ignore certain errors and/or bad AML constructs. * * Currently, these features are enabled by this flag: diff --git a/source/include/aclocal.h b/source/include/aclocal.h index 8a35147..d54455f 100644 --- a/source/include/aclocal.h +++ b/source/include/aclocal.h @@ -305,7 +305,7 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) ( /* - * Bitmapped ACPI types. Used internally only + * Bitmapped ACPI types. Used internally only */ #define ACPI_BTYPE_ANY 0x00000000 #define ACPI_BTYPE_INTEGER 0x00000001 @@ -689,7 +689,7 @@ typedef struct acpi_pscope_state /* - * Thread state - one per thread across multiple walk states. Multiple walk + * Thread state - one per thread across multiple walk states. Multiple walk * states are created when there are nested control methods executing. */ typedef struct acpi_thread_state diff --git a/source/include/acmacros.h b/source/include/acmacros.h index 92cd7a2..8a0e384 100644 --- a/source/include/acmacros.h +++ b/source/include/acmacros.h @@ -464,7 +464,7 @@ #define ACPI_DUMP_OPERANDS(a, b ,c) AcpiExDumpOperands(a, b, c) #define ACPI_DUMP_ENTRY(a, b) AcpiNsDumpEntry (a, b) #define ACPI_DUMP_PATHNAME(a, b, c, d) AcpiNsDumpPathname(a, b, c, d) -#define ACPI_DUMP_BUFFER(a, b) AcpiUtDumpBuffer((UINT8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT) +#define ACPI_DUMP_BUFFER(a, b) AcpiUtDebugDumpBuffer((UINT8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT) #else /* diff --git a/source/include/acnames.h b/source/include/acnames.h index e56f3cd..1987b16 100644 --- a/source/include/acnames.h +++ b/source/include/acnames.h @@ -50,6 +50,7 @@ #define METHOD_NAME__HID "_HID" #define METHOD_NAME__CID "_CID" #define METHOD_NAME__UID "_UID" +#define METHOD_NAME__SUB "_SUB" #define METHOD_NAME__ADR "_ADR" #define METHOD_NAME__INI "_INI" #define METHOD_NAME__STA "_STA" @@ -81,5 +82,3 @@ #define ACPI_NS_ROOT_PATH "\\" #endif /* __ACNAMES_H__ */ - - diff --git a/source/include/acobject.h b/source/include/acobject.h index daf1aff..2f17375 100644 --- a/source/include/acobject.h +++ b/source/include/acobject.h @@ -1,4 +1,3 @@ - /****************************************************************************** * * Name: acobject.h - Definition of ACPI_OPERAND_OBJECT (Internal object only) @@ -238,7 +237,7 @@ typedef struct acpi_object_method /****************************************************************************** * - * Objects that can be notified. All share a common NotifyInfo area. + * Objects that can be notified. All share a common NotifyInfo area. * *****************************************************************************/ @@ -301,7 +300,7 @@ typedef struct acpi_object_thermal_zone /****************************************************************************** * - * Fields. All share a common header/info field. + * Fields. All share a common header/info field. * *****************************************************************************/ diff --git a/source/include/acopcode.h b/source/include/acopcode.h index e182a07..edd1349 100644 --- a/source/include/acopcode.h +++ b/source/include/acopcode.h @@ -54,7 +54,7 @@ #define _UNK 0x6B /* - * Reserved ASCII characters. Do not use any of these for + * Reserved ASCII characters. Do not use any of these for * internal opcodes, since they are used to differentiate * name strings from AML opcodes */ @@ -64,7 +64,7 @@ /* - * All AML opcodes and the parse-time arguments for each. Used by the AML + * All AML opcodes and the parse-time arguments for each. Used by the AML * parser Each list is compressed into a 32-bit number and stored in the * master opcode table (in psopcode.c). */ @@ -195,7 +195,7 @@ /* - * All AML opcodes and the runtime arguments for each. Used by the AML + * All AML opcodes and the runtime arguments for each. Used by the AML * interpreter Each list is compressed into a 32-bit number and stored * in the master opcode table (in psopcode.c). * diff --git a/source/include/acpiosxf.h b/source/include/acpiosxf.h index fc9c8f0..6fcda9e 100644 --- a/source/include/acpiosxf.h +++ b/source/include/acpiosxf.h @@ -1,7 +1,6 @@ - /****************************************************************************** * - * Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These + * Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These * interfaces must be implemented by OSL to interface the * ACPI components to the host operating system. * @@ -122,9 +121,11 @@ AcpiOsPhysicalTableOverride ( /* * Spinlock primitives */ +#ifndef AcpiOsCreateLock ACPI_STATUS AcpiOsCreateLock ( ACPI_SPINLOCK *OutHandle); +#endif void AcpiOsDeleteLock ( diff --git a/source/include/acpixf.h b/source/include/acpixf.h index cd04e26..dfc3165 100644 --- a/source/include/acpixf.h +++ b/source/include/acpixf.h @@ -1,4 +1,3 @@ - /****************************************************************************** * * Name: acpixf.h - External interfaces to the ACPI subsystem @@ -48,7 +47,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20120913 +#define ACPI_CA_VERSION 0x20121018 #include "acconfig.h" #include "actypes.h" diff --git a/source/include/acrestyp.h b/source/include/acrestyp.h index b927c9c..c2ce4f08 100644 --- a/source/include/acrestyp.h +++ b/source/include/acrestyp.h @@ -689,4 +689,3 @@ typedef struct acpi_pci_routing_table } ACPI_PCI_ROUTING_TABLE; #endif /* __ACRESTYP_H__ */ - diff --git a/source/include/acstruct.h b/source/include/acstruct.h index b3927ca..ff01e86 100644 --- a/source/include/acstruct.h +++ b/source/include/acstruct.h @@ -54,7 +54,7 @@ /* - * Walk state - current state of a parse tree walk. Used for both a leisurely + * Walk state - current state of a parse tree walk. Used for both a leisurely * stroll through the tree (for whatever reason), and for control method * execution. */ diff --git a/source/include/actbl2.h b/source/include/actbl2.h index 44f7de3..2d2d5ca 100644 --- a/source/include/actbl2.h +++ b/source/include/actbl2.h @@ -1334,4 +1334,3 @@ typedef struct acpi_table_wdrt #pragma pack() #endif /* __ACTBL2_H__ */ - diff --git a/source/include/actbl3.h b/source/include/actbl3.h index ce0b158..874e348 100644 --- a/source/include/actbl3.h +++ b/source/include/actbl3.h @@ -319,10 +319,10 @@ typedef struct acpi_table_gtdt ******************************************************************************/ #define ACPI_MPST_CHANNEL_INFO \ - UINT16 Reserved1; \ UINT8 ChannelId; \ - UINT8 Reserved2; \ - UINT16 PowerNodeCount; + UINT8 Reserved1[3]; \ + UINT16 PowerNodeCount; \ + UINT16 Reserved2; /* Main table */ @@ -353,9 +353,8 @@ typedef struct acpi_mpst_power_node UINT32 Length; UINT64 RangeAddress; UINT64 RangeLength; - UINT8 NumPowerStates; - UINT8 NumPhysicalComponents; - UINT16 Reserved2; + UINT32 NumPowerStates; + UINT32 NumPhysicalComponents; } ACPI_MPST_POWER_NODE; @@ -390,12 +389,13 @@ typedef struct acpi_mpst_component typedef struct acpi_mpst_data_hdr { UINT16 CharacteristicsCount; + UINT16 Reserved; } ACPI_MPST_DATA_HDR; typedef struct acpi_mpst_power_data { - UINT8 Revision; + UINT8 StructureId; UINT8 Flags; UINT16 Reserved1; UINT32 AveragePower; @@ -419,10 +419,10 @@ typedef struct acpi_mpst_shared UINT32 Signature; UINT16 PccCommand; UINT16 PccStatus; - UINT16 CommandRegister; - UINT16 StatusRegister; - UINT16 PowerStateId; - UINT16 PowerNodeId; + UINT32 CommandRegister; + UINT32 StatusRegister; + UINT32 PowerStateId; + UINT32 PowerNodeId; UINT64 EnergyConsumed; UINT64 AveragePower; diff --git a/source/include/actypes.h b/source/include/actypes.h index eef510a..611c418 100644 --- a/source/include/actypes.h +++ b/source/include/actypes.h @@ -454,10 +454,14 @@ typedef UINT64 ACPI_INTEGER; #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) +/* Optimizations for 4-character (32-bit) ACPI_NAME manipulation */ + #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (UINT32, (a)) == *ACPI_CAST_PTR (UINT32, (b))) +#define ACPI_MOVE_NAME(dest,src) (*ACPI_CAST_PTR (UINT32, (dest)) = *ACPI_CAST_PTR (UINT32, (src))) #else #define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) +#define ACPI_MOVE_NAME(dest,src) (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) #endif @@ -1105,22 +1109,22 @@ UINT32 (*ACPI_INTERFACE_HANDLER) ( #define ACPI_UUID_LENGTH 16 -/* Structures used for device/processor HID, UID, CID */ +/* Structures used for device/processor HID, UID, CID, and SUB */ -typedef struct acpi_device_id +typedef struct acpi_pnp_device_id { UINT32 Length; /* Length of string + null */ char *String; -} ACPI_DEVICE_ID; +} ACPI_PNP_DEVICE_ID; -typedef struct acpi_device_id_list +typedef struct acpi_pnp_device_id_list { UINT32 Count; /* Number of IDs in Ids array */ UINT32 ListSize; /* Size of list, including ID strings */ - ACPI_DEVICE_ID Ids[1]; /* ID array */ + ACPI_PNP_DEVICE_ID Ids[1]; /* ID array */ -} ACPI_DEVICE_ID_LIST; +} ACPI_PNP_DEVICE_ID_LIST; /* * Structure returned from AcpiGetObjectInfo. @@ -1138,9 +1142,10 @@ typedef struct acpi_device_info UINT8 LowestDstates[5]; /* _SxW values: 0xFF indicates not valid */ UINT32 CurrentStatus; /* _STA value */ UINT64 Address; /* _ADR value */ - ACPI_DEVICE_ID HardwareId; /* _HID value */ - ACPI_DEVICE_ID UniqueId; /* _UID value */ - ACPI_DEVICE_ID_LIST CompatibleIdList; /* _CID list <must be last> */ + ACPI_PNP_DEVICE_ID HardwareId; /* _HID value */ + ACPI_PNP_DEVICE_ID UniqueId; /* _UID value */ + ACPI_PNP_DEVICE_ID SubsystemId; /* _SUB value */ + ACPI_PNP_DEVICE_ID_LIST CompatibleIdList; /* _CID list <must be last> */ } ACPI_DEVICE_INFO; @@ -1154,11 +1159,12 @@ typedef struct acpi_device_info #define ACPI_VALID_ADR 0x02 #define ACPI_VALID_HID 0x04 #define ACPI_VALID_UID 0x08 -#define ACPI_VALID_CID 0x10 -#define ACPI_VALID_SXDS 0x20 -#define ACPI_VALID_SXWS 0x40 +#define ACPI_VALID_SUB 0x10 +#define ACPI_VALID_CID 0x20 +#define ACPI_VALID_SXDS 0x40 +#define ACPI_VALID_SXWS 0x80 -/* Flags for _STA method */ +/* Flags for _STA return value (CurrentStatus above) */ #define ACPI_STA_DEVICE_PRESENT 0x01 #define ACPI_STA_DEVICE_ENABLED 0x02 diff --git a/source/include/acutils.h b/source/include/acutils.h index d720fcc..2391260 100644 --- a/source/include/acutils.h +++ b/source/include/acutils.h @@ -425,17 +425,18 @@ AcpiUtPtrExit ( UINT8 *Ptr); void -AcpiUtDumpBuffer ( +AcpiUtDebugDumpBuffer ( UINT8 *Buffer, UINT32 Count, UINT32 Display, UINT32 ComponentId); void -AcpiUtDumpBuffer2 ( +AcpiUtDumpBuffer ( UINT8 *Buffer, UINT32 Count, - UINT32 Display); + UINT32 Display, + UINT32 Offset); void AcpiUtReportError ( @@ -511,17 +512,22 @@ AcpiUtExecutePowerMethods ( ACPI_STATUS AcpiUtExecute_HID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID **ReturnId); + ACPI_PNP_DEVICE_ID **ReturnId); ACPI_STATUS AcpiUtExecute_UID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID **ReturnId); + ACPI_PNP_DEVICE_ID **ReturnId); + +ACPI_STATUS +AcpiUtExecute_SUB ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_PNP_DEVICE_ID **ReturnId); ACPI_STATUS AcpiUtExecute_CID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID_LIST **ReturnCidList); + ACPI_PNP_DEVICE_ID_LIST **ReturnCidList); /* diff --git a/source/include/amlresrc.h b/source/include/amlresrc.h index 6d85b8a..2202bb9 100644 --- a/source/include/amlresrc.h +++ b/source/include/amlresrc.h @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: amlresrc.h - AML resource descriptors @@ -576,4 +575,3 @@ typedef union aml_resource } AML_RESOURCE; #endif - diff --git a/source/include/platform/acenv.h b/source/include/platform/acenv.h index 8dfc143..dc18e86 100644 --- a/source/include/platform/acenv.h +++ b/source/include/platform/acenv.h @@ -367,7 +367,7 @@ typedef char *va_list; #define _Bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) #define va_arg(ap, T) (*(T *)(((ap) += (_Bnd (T, _AUPBND))) - (_Bnd (T,_ADNBND)))) -#define va_end(ap) (void) 0 +#define va_end(ap) (ap = (va_list) NULL) #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_Bnd (A,_AUPBND)))) #endif /* va_arg */ diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h index edfff15..45c73f4 100644 --- a/source/include/platform/aclinux.h +++ b/source/include/platform/aclinux.h @@ -55,11 +55,9 @@ #include <linux/string.h> #include <linux/kernel.h> -#include <linux/module.h> #include <linux/ctype.h> #include <linux/sched.h> -#include <asm/system.h> -#include <asm/atomic.h> +#include <linux/atomic.h> #include <asm/div64.h> #include <asm/acpi.h> #include <linux/slab.h> @@ -87,18 +85,17 @@ /* Host-dependent types and defines for user-space ACPICA */ #define ACPI_FLUSH_CPU_CACHE() +#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (pthread)) #if defined(__ia64__) || defined(__x86_64__) #define ACPI_MACHINE_WIDTH 64 #define COMPILER_DEPENDENT_INT64 long #define COMPILER_DEPENDENT_UINT64 unsigned long -#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (pthread)) #else #define ACPI_MACHINE_WIDTH 32 #define COMPILER_DEPENDENT_INT64 long long #define COMPILER_DEPENDENT_UINT64 unsigned long long #define ACPI_USE_NATIVE_DIVIDE -#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (UINT32) (void *) (pthread)) #endif #ifndef __cdecl @@ -113,12 +110,13 @@ #ifdef __KERNEL__ +#include <acpi/actypes.h> /* * Overrides for in-kernel ACPICA */ static inline acpi_thread_id acpi_os_get_thread_id(void) { - return current; + return (ACPI_THREAD_ID) (unsigned long) current; } /* @@ -127,7 +125,6 @@ static inline acpi_thread_id acpi_os_get_thread_id(void) * However, boot has (system_state != SYSTEM_RUNNING) * to quiet __might_sleep() in kmalloc() and resume does not. */ -#include <acpi/actypes.h> static inline void *acpi_os_allocate(acpi_size size) { return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); @@ -148,13 +145,35 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache) #define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a) #define ACPI_FREE(a) kfree(a) -/* Used within ACPICA to show where it is safe to preempt execution */ - +#ifndef CONFIG_PREEMPT +/* + * Used within ACPICA to show where it is safe to preempt execution + * when CONFIG_PREEMPT=n + */ #define ACPI_PREEMPTION_POINT() \ do { \ if (!irqs_disabled()) \ cond_resched(); \ } while (0) +#endif + +/* + * When lockdep is enabled, the spin_lock_init() macro stringifies it's + * argument and uses that as a name for the lock in debugging. + * By executing spin_lock_init() in a macro the key changes from "lock" for + * all locks to the name of the argument of acpi_os_create_lock(), which + * prevents lockdep from reporting false positives for ACPICA locks. + */ +#define AcpiOsCreateLock(__handle) \ +({ \ + spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \ + \ + if (lock) { \ + *(__handle) = lock; \ + spin_lock_init(*(__handle)); \ + } \ + lock ? AE_OK : AE_NO_MEMORY; \ +}) #endif /* __KERNEL__ */ diff --git a/source/os_specific/service_layers/osunixdir.c b/source/os_specific/service_layers/osunixdir.c index 20b153c..7916c03 100644 --- a/source/os_specific/service_layers/osunixdir.c +++ b/source/os_specific/service_layers/osunixdir.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: osunixdir - Unix directory access interfaces @@ -60,7 +59,7 @@ typedef struct ExternalFindInfo { char *DirPathname; DIR *DirPtr; - char temp_buffer[128]; + char temp_buffer[256]; char *WildcardSpec; char RequestedFileType; @@ -93,7 +92,7 @@ AcpiOsOpenDirectory ( /* Allocate the info struct that will be returned to the caller */ - ExternalInfo = calloc (sizeof (EXTERNAL_FIND_INFO), 1); + ExternalInfo = calloc (1, sizeof (EXTERNAL_FIND_INFO)); if (!ExternalInfo) { return (NULL); diff --git a/source/os_specific/service_layers/oswindir.c b/source/os_specific/service_layers/oswindir.c index 2cdcb94..ab2d810 100644 --- a/source/os_specific/service_layers/oswindir.c +++ b/source/os_specific/service_layers/oswindir.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: oswindir - Windows directory access interfaces @@ -248,4 +247,3 @@ AcpiOsCloseDirectory ( free (SearchInfo->FullWildcardSpec); free (DirHandle); } - diff --git a/source/os_specific/service_layers/oswintbl.c b/source/os_specific/service_layers/oswintbl.c index db34966..2158b05 100644 --- a/source/os_specific/service_layers/oswintbl.c +++ b/source/os_specific/service_layers/oswintbl.c @@ -219,4 +219,3 @@ Cleanup: RegCloseKey (Handle); return (ReturnTable); } - diff --git a/source/os_specific/service_layers/oswinxf.c b/source/os_specific/service_layers/oswinxf.c index 68629a2..b8b3e37 100644 --- a/source/os_specific/service_layers/oswinxf.c +++ b/source/os_specific/service_layers/oswinxf.c @@ -268,8 +268,8 @@ AcpiOsTableOverride ( /* Construct a null-terminated string from table signature */ + ACPI_MOVE_NAME (TableName, ExistingTable->Signature); TableName[ACPI_NAME_SIZE] = 0; - ACPI_STRNCPY (TableName, ExistingTable->Signature, ACPI_NAME_SIZE); *NewTable = OsGetTable (TableName); if (*NewTable) @@ -1503,4 +1503,3 @@ AcpiOsWaitEventsComplete ( { return; } - diff --git a/source/tools/acpibin/abcompare.c b/source/tools/acpibin/abcompare.c index 4612227..a0b241f 100644 --- a/source/tools/acpibin/abcompare.c +++ b/source/tools/acpibin/abcompare.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: abcompare - compare AML files @@ -158,10 +157,10 @@ AbValidateHeader ( if (!AcpiUtValidAcpiName (* (UINT32 *) &Header->Signature)) { printf ("Header signature is invalid\n"); - return FALSE; + return (FALSE); } - return TRUE; + return (TRUE); } @@ -398,14 +397,14 @@ AbCompareAmlFiles ( if (!File1) { printf ("Could not open file %s\n", File1Path); - return -1; + return (-1); } File2 = fopen (File2Path, "rb"); if (!File2) { printf ("Could not open file %s\n", File2Path); - return -1; + return (-1); } /* Read the ACPI header from each file */ @@ -414,20 +413,20 @@ AbCompareAmlFiles ( if (Actual1 < sizeof (ACPI_TABLE_HEADER)) { printf ("File %s does not contain an ACPI table header\n", File1Path); - return -1; + return (-1); } Actual2 = fread (&Header2, 1, sizeof (ACPI_TABLE_HEADER), File2); if (Actual2 < sizeof (ACPI_TABLE_HEADER)) { printf ("File %s does not contain an ACPI table header\n", File2Path); - return -1; + return (-1); } if ((!AbValidateHeader (&Header1)) || (!AbValidateHeader (&Header2))) { - return -1; + return (-1); } /* Table signatures must match */ @@ -435,7 +434,7 @@ AbCompareAmlFiles ( if (*((UINT32 *) Header1.Signature) != *((UINT32 *) Header2.Signature)) { printf ("Table signatures do not match\n"); - return -1; + return (-1); } if (!Gbl_TerseMode) @@ -446,7 +445,7 @@ AbCompareAmlFiles ( AbPrintHeaderInfo (&Header2); } - if (memcmp (Header1.Signature, Header2.Signature, sizeof (ACPI_TABLE_HEADER))) + if (memcmp (&Header1, &Header2, sizeof (ACPI_TABLE_HEADER))) { printf ("Headers do not match exactly\n"); HeaderMismatch = TRUE; @@ -468,7 +467,7 @@ AbCompareAmlFiles ( if (Mismatches > 100) { printf ("100 Mismatches: Too many mismatches\n"); - return -1; + return (-1); } } @@ -500,7 +499,7 @@ AbCompareAmlFiles ( } printf ("%u Mismatches found\n", Mismatches); - return 0; + return (0); } @@ -528,7 +527,7 @@ AbGetFile ( if (!FileHandle) { printf ("Could not open %s\n", Filename); - return NULL; + return (NULL); } /* Need file size to allocate a buffer */ @@ -596,12 +595,12 @@ AbDumpAmlFile ( if (!FileOutHandle) { printf ("Could not open %s\n", File2Path); - return -1; + return (-1); } if (!AbValidateHeader ((ACPI_TABLE_HEADER *) FileBuffer)) { - return -1; + return (-1); } /* Convert binary AML to text, using common dump buffer routine */ @@ -611,10 +610,10 @@ AbDumpAmlFile ( AcpiOsPrintf ("%4.4s\n", ((ACPI_TABLE_HEADER *) FileBuffer)->Signature); AcpiDbgLevel = ACPI_UINT32_MAX; - AcpiUtDumpBuffer ((UINT8 *) FileBuffer, FileSize, + AcpiUtDebugDumpBuffer ((UINT8 *) FileBuffer, FileSize, DB_BYTE_DISPLAY, ACPI_UINT32_MAX); - return 0; + return (0); } @@ -648,14 +647,14 @@ AbExtractAmlFile ( if (!FileHandle) { printf ("Could not open %s\n", File1Path); - return -1; + return (-1); } FileOutHandle = fopen (File2Path, "w+b"); if (!FileOutHandle) { printf ("Could not open %s\n", File2Path); - return -1; + return (-1); } /* Force input table sig to uppercase */ @@ -672,7 +671,7 @@ AbExtractAmlFile ( { /* The 4-char ACPI signature appears at the beginning of a line */ - if (!strncmp (Buffer, TableSig, 4)) + if (ACPI_COMPARE_NAME (Buffer, TableSig)) { printf ("Found table [%4.4s]\n", TableSig); @@ -710,7 +709,12 @@ AbExtractAmlFile ( /* Write the converted (binary) byte */ - fwrite (&Value, 1, 1, FileOutHandle); + if (fwrite (&Value, 1, 1, FileOutHandle) < 1) + { + printf ("Error writing byte %u to output file: %s\n", + Count, File2Path); + goto Exit; + } Count++; } } @@ -725,13 +729,13 @@ AbExtractAmlFile ( printf ("Could not match table signature\n"); fclose (FileHandle); - return -1; + return (-1); Exit: printf ("%u (0x%X) bytes written to %s\n", Count, Count, File2Path); fclose (FileHandle); fclose (FileOutHandle); - return 0; + return (0); } @@ -747,7 +751,7 @@ ACPI_PHYSICAL_ADDRESS AeLocalGetRootPointer ( void) { - return AE_OK; + return (AE_OK); } ACPI_THREAD_ID diff --git a/source/tools/acpibin/abmain.c b/source/tools/acpibin/abmain.c index cb9c329..b09ab84 100644 --- a/source/tools/acpibin/abmain.c +++ b/source/tools/acpibin/abmain.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: abmain - Main module for the acpi binary utility @@ -109,7 +108,7 @@ main ( if (argc < 2) { AbDisplayUsage (0); - return 0; + return (0); } /* Command line options */ @@ -121,7 +120,7 @@ main ( if (argc < 4) { AbDisplayUsage (2); - return -1; + return (-1); } Status = AbCompareAmlFiles (AcpiGbl_Optarg, argv[AcpiGbl_Optind]); @@ -132,7 +131,7 @@ main ( if (argc < 4) { AbDisplayUsage (2); - return -1; + return (-1); } Status = AbDumpAmlFile (AcpiGbl_Optarg, argv[AcpiGbl_Optind]); @@ -143,7 +142,7 @@ main ( if (argc < 5) { AbDisplayUsage (3); - return -1; + return (-1); } Status = AbExtractAmlFile (AcpiGbl_Optarg, argv[AcpiGbl_Optind], @@ -155,7 +154,7 @@ main ( if (argc < 3) { AbDisplayUsage (1); - return -1; + return (-1); } AbDisplayHeader (AcpiGbl_Optarg); @@ -166,7 +165,7 @@ main ( if (argc < 3) { AbDisplayUsage (1); - return -1; + return (-1); } AbComputeChecksum (AcpiGbl_Optarg); @@ -179,7 +178,7 @@ main ( default: AbDisplayUsage (0); - return -1; + return (-1); } return Status; diff --git a/source/tools/acpibin/acpibin.h b/source/tools/acpibin/acpibin.h index 63109cc..e831f51 100644 --- a/source/tools/acpibin/acpibin.h +++ b/source/tools/acpibin/acpibin.h @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: acpibinh - Include file for AcpiBin utility @@ -67,7 +66,7 @@ #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 /* - * Global variables. Defined in main.c only, externed in all other files + * Global variables. Defined in main.c only, externed in all other files */ #ifdef _DECLARE_GLOBALS @@ -110,4 +109,3 @@ AbComputeChecksum ( void AbDisplayHeader ( char *File1Path); - diff --git a/source/tools/acpiexec/aecommon.h b/source/tools/acpiexec/aecommon.h index 66995e7..111e995 100644 --- a/source/tools/acpiexec/aecommon.h +++ b/source/tools/acpiexec/aecommon.h @@ -197,4 +197,3 @@ AeGlobalEventHandler ( void *Context); #endif /* _AECOMMON */ - diff --git a/source/tools/acpiexec/aeexec.c b/source/tools/acpiexec/aeexec.c index 6bc1381..8c0ec26 100644 --- a/source/tools/acpiexec/aeexec.c +++ b/source/tools/acpiexec/aeexec.c @@ -770,4 +770,3 @@ AeMiscellaneousTests ( #endif /* !ACPI_REDUCED_HARDWARE */ } - diff --git a/source/tools/acpiexec/aehandlers.c b/source/tools/acpiexec/aehandlers.c index 84ed57e..d830d80 100644 --- a/source/tools/acpiexec/aehandlers.c +++ b/source/tools/acpiexec/aehandlers.c @@ -167,7 +167,7 @@ static ACPI_CONNECTION_INFO AeMyContext; * * RETURN: none * - * DESCRIPTION: Control-C handler. Abort running control method if any. + * DESCRIPTION: Control-C handler. Abort running control method if any. * *****************************************************************************/ @@ -299,7 +299,7 @@ AeCommonNotifyHandler ( * * RETURN: Status * - * DESCRIPTION: System notify handler for AcpiExec utility. Used by the ASL + * DESCRIPTION: System notify handler for AcpiExec utility. Used by the ASL * test suite(s) to communicate errors and other information to * this utility via the Notify() operator. * @@ -332,7 +332,7 @@ AeSystemNotifyHandler ( * * RETURN: Status * - * DESCRIPTION: Device notify handler for AcpiExec utility. Used by the ASL + * DESCRIPTION: Device notify handler for AcpiExec utility. Used by the ASL * test suite(s) to communicate errors and other information to * this utility via the Notify() operator. * @@ -1366,5 +1366,3 @@ DoFunction: return (AE_OK); } - - diff --git a/source/tools/acpiexec/aetables.c b/source/tools/acpiexec/aetables.c index afada0d..fb530e1 100644 --- a/source/tools/acpiexec/aetables.c +++ b/source/tools/acpiexec/aetables.c @@ -173,7 +173,7 @@ AeBuildLocalTables ( } ACPI_MEMSET (LocalXSDT, 0, XsdtSize); - ACPI_STRNCPY (LocalXSDT->Header.Signature, ACPI_SIG_XSDT, 4); + ACPI_MOVE_NAME (LocalXSDT->Header.Signature, ACPI_SIG_XSDT); LocalXSDT->Header.Length = XsdtSize; LocalXSDT->Header.Revision = 1; @@ -307,7 +307,7 @@ AeBuildLocalTables ( * Build a local FADT so we can test the hardware/event init */ ACPI_MEMSET (&LocalFADT, 0, sizeof (ACPI_TABLE_FADT)); - ACPI_STRNCPY (LocalFADT.Header.Signature, ACPI_SIG_FADT, 4); + ACPI_MOVE_NAME (LocalFADT.Header.Signature, ACPI_SIG_FADT); /* Setup FADT header and DSDT/FACS addresses */ @@ -358,7 +358,7 @@ AeBuildLocalTables ( /* Build a FACS */ ACPI_MEMSET (&LocalFACS, 0, sizeof (ACPI_TABLE_FACS)); - ACPI_STRNCPY (LocalFACS.Signature, ACPI_SIG_FACS, 4); + ACPI_MOVE_NAME (LocalFACS.Signature, ACPI_SIG_FACS); LocalFACS.Length = sizeof (ACPI_TABLE_FACS); LocalFACS.GlobalLock = 0x11AA0011; @@ -368,7 +368,7 @@ AeBuildLocalTables ( * ACPICA core ignores it */ ACPI_MEMSET (&LocalTEST, 0, sizeof (ACPI_TABLE_HEADER)); - ACPI_STRNCPY (LocalTEST.Signature, "TEST", 4); + ACPI_MOVE_NAME (LocalTEST.Signature, "TEST"); LocalTEST.Revision = 1; LocalTEST.Length = sizeof (ACPI_TABLE_HEADER); @@ -380,7 +380,7 @@ AeBuildLocalTables ( * sure that the ACPICA core ignores it */ ACPI_MEMSET (&LocalBADTABLE, 0, sizeof (ACPI_TABLE_HEADER)); - ACPI_STRNCPY (LocalBADTABLE.Signature, "BAD!", 4); + ACPI_MOVE_NAME (LocalBADTABLE.Signature, "BAD!"); LocalBADTABLE.Revision = 1; LocalBADTABLE.Length = sizeof (ACPI_TABLE_HEADER); diff --git a/source/tools/acpinames/acpinames.h b/source/tools/acpinames/acpinames.h index 260124a..3439f8f 100644 --- a/source/tools/acpinames/acpinames.h +++ b/source/tools/acpinames/acpinames.h @@ -54,4 +54,3 @@ #define ACPI_MAX_INIT_TABLES (32) #endif - diff --git a/source/tools/acpinames/anmain.c b/source/tools/acpinames/anmain.c index 682cc5f..5fb51ba 100644 --- a/source/tools/acpinames/anmain.c +++ b/source/tools/acpinames/anmain.c @@ -272,4 +272,3 @@ main ( */ return (NsDumpEntireNamespace (argv[AcpiGbl_Optind])); } - diff --git a/source/tools/acpinames/anstubs.c b/source/tools/acpinames/anstubs.c index a69c425..b823f32 100644 --- a/source/tools/acpinames/anstubs.c +++ b/source/tools/acpinames/anstubs.c @@ -77,7 +77,7 @@ AcpiUtExecute_STA ( ACPI_STATUS AcpiUtExecute_HID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID **ReturnId) + ACPI_PNP_DEVICE_ID **ReturnId) { return (AE_NOT_IMPLEMENTED); } @@ -85,7 +85,7 @@ AcpiUtExecute_HID ( ACPI_STATUS AcpiUtExecute_CID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID_LIST **ReturnCidList) + ACPI_PNP_DEVICE_ID_LIST **ReturnCidList) { return (AE_NOT_IMPLEMENTED); } @@ -93,7 +93,15 @@ AcpiUtExecute_CID ( ACPI_STATUS AcpiUtExecute_UID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID **ReturnId) + ACPI_PNP_DEVICE_ID **ReturnId) +{ + return (AE_NOT_IMPLEMENTED); +} + +ACPI_STATUS +AcpiUtExecute_SUB ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_PNP_DEVICE_ID **ReturnId) { return (AE_NOT_IMPLEMENTED); } diff --git a/source/tools/acpinames/antables.c b/source/tools/acpinames/antables.c index 37fa24a..c6545b8 100644 --- a/source/tools/acpinames/antables.c +++ b/source/tools/acpinames/antables.c @@ -129,7 +129,7 @@ AeBuildLocalTables ( } ACPI_MEMSET (LocalXSDT, 0, XsdtSize); - ACPI_STRNCPY (LocalXSDT->Header.Signature, ACPI_SIG_XSDT, 4); + ACPI_MOVE_NAME (LocalXSDT->Header.Signature, ACPI_SIG_XSDT); LocalXSDT->Header.Length = XsdtSize; LocalXSDT->Header.Revision = 1; @@ -222,7 +222,7 @@ AeBuildLocalTables ( * Build a local FADT so we can test the hardware/event init */ ACPI_MEMSET (&LocalFADT, 0, sizeof (ACPI_TABLE_FADT)); - ACPI_STRNCPY (LocalFADT.Header.Signature, ACPI_SIG_FADT, 4); + ACPI_MOVE_NAME (LocalFADT.Header.Signature, ACPI_SIG_FADT); /* Setup FADT header and DSDT/FACS addresses */ @@ -273,7 +273,7 @@ AeBuildLocalTables ( /* Build a FACS */ ACPI_MEMSET (&LocalFACS, 0, sizeof (ACPI_TABLE_FACS)); - ACPI_STRNCPY (LocalFACS.Signature, ACPI_SIG_FACS, 4); + ACPI_MOVE_NAME (LocalFACS.Signature, ACPI_SIG_FACS); LocalFACS.Length = sizeof (ACPI_TABLE_FACS); LocalFACS.GlobalLock = 0x11AA0011; diff --git a/source/tools/acpisrc/acpisrc.h b/source/tools/acpisrc/acpisrc.h index bc3f497..1d2e8dc 100644 --- a/source/tools/acpisrc/acpisrc.h +++ b/source/tools/acpisrc/acpisrc.h @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: acpisrc.h - Include file for AcpiSrc utility @@ -135,6 +134,7 @@ extern BOOLEAN Gbl_Overwrite; extern BOOLEAN Gbl_WidenDeclarations; extern BOOLEAN Gbl_IgnoreLoneLineFeeds; extern BOOLEAN Gbl_HasLoneLineFeeds; +extern BOOLEAN Gbl_Cleanup; extern void *Gbl_StructDefs; #define PARAM_LIST(pl) pl @@ -367,6 +367,16 @@ AsCheckForDirectory ( char **SourcePath, char **TargetPath); +void +AsRemoveExtraLines ( + char *FileBuffer, + char *Filename); + +void +AsRemoveSpacesAfterPeriod ( + char *FileBuffer, + char *Filename); + BOOLEAN AsMatchExactWord ( char *Word, @@ -402,5 +412,3 @@ AsInsertCarriageReturns ( void AsConvertToLineFeeds ( char *Buffer); - - diff --git a/source/tools/acpisrc/ascase.c b/source/tools/acpisrc/ascase.c index 7e115b7..96e1269 100644 --- a/source/tools/acpisrc/ascase.c +++ b/source/tools/acpisrc/ascase.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: ascase - Source conversion - lower/upper case utilities @@ -57,7 +56,7 @@ AsUppercaseTokens ( * FUNCTION: AsLowerCaseString * * DESCRIPTION: LowerCase all instances of a target string with a replacement - * string. Returns count of the strings replaced. + * string. Returns count of the strings replaced. * ******************************************************************************/ @@ -86,7 +85,7 @@ AsLowerCaseString ( SubString1 = strstr (SubBuffer, Target); if (!SubString1) { - return LowerCaseCount; + return (LowerCaseCount); } /* @@ -105,7 +104,7 @@ AsLowerCaseString ( { /* Didn't find terminator */ - return LowerCaseCount; + return (LowerCaseCount); } /* Move buffer to end of escape block and continue */ @@ -142,7 +141,7 @@ AsLowerCaseString ( } } - return LowerCaseCount; + return (LowerCaseCount); } @@ -465,7 +464,7 @@ AsMixedCaseToUnderscores ( * * FUNCTION: AsLowerCaseIdentifiers * - * DESCRIPTION: Converts mixed case identifiers to lower case. Leaves comments, + * DESCRIPTION: Converts mixed case identifiers to lower case. Leaves comments, * quoted strings, and all-upper-case macros alone. * ******************************************************************************/ diff --git a/source/tools/acpisrc/asconvrt.c b/source/tools/acpisrc/asconvrt.c index 1669f9d..ff2804d 100644 --- a/source/tools/acpisrc/asconvrt.c +++ b/source/tools/acpisrc/asconvrt.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: asconvrt - Source conversion code @@ -63,6 +62,89 @@ char *HeaderBegin = "/*************************************************** /****************************************************************************** * + * FUNCTION: AsRemoveExtraLines + * + * DESCRIPTION: Remove all extra lines at the start and end of the file. + * + ******************************************************************************/ + +void +AsRemoveExtraLines ( + char *FileBuffer, + char *Filename) +{ + char *FileEnd; + int Length; + + + /* Remove any extra lines at the start of the file */ + + while (*FileBuffer == '\n') + { + printf ("Removing extra line at start of file: %s\n", Filename); + AsRemoveData (FileBuffer, FileBuffer + 1); + } + + /* Remove any extra lines at the end of the file */ + + Length = strlen (FileBuffer); + FileEnd = FileBuffer + (Length - 2); + + while (*FileEnd == '\n') + { + printf ("Removing extra line at end of file: %s\n", Filename); + AsRemoveData (FileEnd, FileEnd + 1); + FileEnd--; + } +} + + +/****************************************************************************** + * + * FUNCTION: AsRemoveSpacesAfterPeriod + * + * DESCRIPTION: Remove an extra space after a period. + * + ******************************************************************************/ + +void +AsRemoveSpacesAfterPeriod ( + char *FileBuffer, + char *Filename) +{ + int ReplaceCount = 0; + char *Possible; + + + Possible = FileBuffer; + while (Possible) + { + Possible = strstr (Possible, ". "); + if (Possible) + { + if ((*(Possible -1) == '.') || + (*(Possible -1) == '\"') || + (*(Possible -1) == '\n')) + { + Possible += 3; + continue; + } + + Possible = AsReplaceData (Possible, 3, ". ", 2); + ReplaceCount++; + } + } + + if (ReplaceCount) + { + printf ("Removed %d extra blanks after a period: %s\n", + ReplaceCount, Filename); + } +} + + +/****************************************************************************** + * * FUNCTION: AsMatchExactWord * * DESCRIPTION: Check previous and next characters for whitespace @@ -146,7 +228,7 @@ AsCheckAndSkipLiterals ( if (!LiteralEnd) { - return SubBuffer; + return (SubBuffer); } while (SubBuffer < LiteralEnd) @@ -170,7 +252,7 @@ AsCheckAndSkipLiterals ( LiteralEnd = AsSkipPastChar (SubBuffer, '\"'); if (!LiteralEnd) { - return SubBuffer; + return (SubBuffer); } } @@ -178,7 +260,7 @@ AsCheckAndSkipLiterals ( { (*TotalLines) += NewLines; } - return SubBuffer; + return (SubBuffer); } @@ -278,7 +360,7 @@ AsCheckForBraces ( * * FUNCTION: AsTrimLines * - * DESCRIPTION: Remove extra blanks from the end of source lines. Does not + * DESCRIPTION: Remove extra blanks from the end of source lines. Does not * check for tabs. * ******************************************************************************/ @@ -404,7 +486,7 @@ AsReplaceHeader ( * FUNCTION: AsReplaceString * * DESCRIPTION: Replace all instances of a target string with a replacement - * string. Returns count of the strings replaced. + * string. Returns count of the strings replaced. * ******************************************************************************/ @@ -436,7 +518,7 @@ AsReplaceString ( SubString1 = strstr (SubBuffer, Target); if (!SubString1) { - return ReplaceCount; + return (ReplaceCount); } /* @@ -455,7 +537,7 @@ AsReplaceString ( { /* Didn't find terminator */ - return ReplaceCount; + return (ReplaceCount); } /* Move buffer to end of escape block and continue */ @@ -488,7 +570,7 @@ AsReplaceString ( } } - return ReplaceCount; + return (ReplaceCount); } @@ -725,7 +807,7 @@ AsBracesOnSameLine ( * * FUNCTION: AsTabify4 * - * DESCRIPTION: Convert the text to tabbed text. Alignment of text is + * DESCRIPTION: Convert the text to tabbed text. Alignment of text is * preserved. * ******************************************************************************/ @@ -815,7 +897,7 @@ AsTabify4 ( * * FUNCTION: AsTabify8 * - * DESCRIPTION: Convert the text to tabbed text. Alignment of text is + * DESCRIPTION: Convert the text to tabbed text. Alignment of text is * preserved. * ******************************************************************************/ @@ -863,7 +945,7 @@ AsTabify8 ( /* * This mechanism limits the difference in tab counts from - * line to line. It helps avoid the situation where a second + * line to line. It helps avoid the situation where a second * continuation line (which was indented correctly for tabs=4) would * get indented off the screen if we just blindly converted to tabs. */ @@ -1015,7 +1097,7 @@ AsTabify8 ( * * FUNCTION: AsCountLines * - * DESCRIPTION: Count the number of lines in the input buffer. Also count + * DESCRIPTION: Count the number of lines in the input buffer. Also count * the number of long lines (lines longer than 80 chars). * ******************************************************************************/ @@ -1037,7 +1119,7 @@ AsCountLines ( if (!EndOfLine) { Gbl_TotalLines += LineCount; - return LineCount; + return (LineCount); } if ((EndOfLine - SubBuffer) > 80) @@ -1057,7 +1139,7 @@ AsCountLines ( } Gbl_TotalLines += LineCount; - return LineCount; + return (LineCount); } @@ -1100,7 +1182,7 @@ AsCountTabs ( * * FUNCTION: AsCountNonAnsiComments * - * DESCRIPTION: Count the number of "//" comments. This type of comment is + * DESCRIPTION: Count the number of "//" comments. This type of comment is * non-ANSI C. * ******************************************************************************/ @@ -1136,7 +1218,7 @@ AsCountNonAnsiComments ( * * FUNCTION: AsCountSourceLines * - * DESCRIPTION: Count the number of C source lines. Defined by 1) not a + * DESCRIPTION: Count the number of C source lines. Defined by 1) not a * comment, and 2) not a blank line. * ******************************************************************************/ @@ -1444,5 +1526,3 @@ Exit: } } #endif - - diff --git a/source/tools/acpisrc/asfile.c b/source/tools/acpisrc/asfile.c index d325738..70be229 100644 --- a/source/tools/acpisrc/asfile.c +++ b/source/tools/acpisrc/asfile.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: asfile - Main module for the acpi source processor utility @@ -159,7 +158,7 @@ AsDoWildcard ( * * FUNCTION: AsProcessTree * - * DESCRIPTION: Process the directory tree. Files with the extension ".C" and + * DESCRIPTION: Process the directory tree. Files with the extension ".C" and * ".H" are processed as the tree is traversed. * ******************************************************************************/ @@ -188,7 +187,7 @@ AsProcessTree ( if (errno != EEXIST) { printf ("Could not create target directory\n"); - return -1; + return (-1); } } } @@ -223,7 +222,7 @@ AsProcessTree ( AsDoWildcard (ConversionTable, SourcePath, TargetPath, MaxPathLength, FILE_TYPE_DIRECTORY, "*"); - return 0; + return (0); } @@ -247,7 +246,7 @@ AsDetectLoneLineFeeds ( if (!Buffer[0]) { - return FALSE; + return (FALSE); } while (Buffer[i]) @@ -277,7 +276,7 @@ AsDetectLoneLineFeeds ( { printf ("%s: %u lone linefeeds in file\n", Filename, LfCount); } - return TRUE; + return (TRUE); } return (FALSE); @@ -340,6 +339,12 @@ AsConvertFile ( VERBOSE_PRINT (("Processing %u bytes\n", (unsigned int) strlen (FileBuffer))); + if (Gbl_Cleanup) + { + AsRemoveExtraLines (FileBuffer, Filename); + AsRemoveSpacesAfterPeriod (FileBuffer, Filename); + } + if (ConversionTable->LowerCaseTable) { for (i = 0; ConversionTable->LowerCaseTable[i].Identifier; i++) @@ -514,7 +519,7 @@ AsConvertFile ( * * FUNCTION: AsProcessOneFile * - * DESCRIPTION: Process one source file. The file is opened, read entirely + * DESCRIPTION: Process one source file. The file is opened, read entirely * into a buffer, converted, then written to a new file. * ******************************************************************************/ @@ -538,7 +543,7 @@ AsProcessOneFile ( if (!Pathname) { printf ("Could not allocate buffer for file pathnames\n"); - return -1; + return (-1); } Gbl_FileType = FileType; @@ -555,7 +560,7 @@ AsProcessOneFile ( if (AsGetFile (Pathname, &Gbl_FileBuffer, &Gbl_FileSize)) { - return -1; + return (-1); } Gbl_HeaderSize = 0; @@ -597,7 +602,7 @@ AsProcessOneFile ( if (!OutPathname) { printf ("Could not allocate buffer for file pathnames\n"); - return -1; + return (-1); } strcpy (OutPathname, TargetPath); @@ -618,7 +623,7 @@ AsProcessOneFile ( free (OutPathname); } - return 0; + return (0); } @@ -626,7 +631,7 @@ AsProcessOneFile ( * * FUNCTION: AsCheckForDirectory * - * DESCRIPTION: Check if the current file is a valid directory. If not, + * DESCRIPTION: Check if the current file is a valid directory. If not, * construct the full pathname for the source and target paths. * Checks for the dot and dot-dot files (they are ignored) * @@ -647,14 +652,14 @@ AsCheckForDirectory ( if (!(strcmp (Filename, ".")) || !(strcmp (Filename, ".."))) { - return -1; + return (-1); } SrcPath = calloc (strlen (SourceDirPath) + strlen (Filename) + 2, 1); if (!SrcPath) { printf ("Could not allocate buffer for directory source pathname\n"); - return -1; + return (-1); } TgtPath = calloc (strlen (TargetDirPath) + strlen (Filename) + 2, 1); @@ -662,7 +667,7 @@ AsCheckForDirectory ( { printf ("Could not allocate buffer for directory target pathname\n"); free (SrcPath); - return -1; + return (-1); } strcpy (SrcPath, SourceDirPath); @@ -675,7 +680,7 @@ AsCheckForDirectory ( *SourcePath = SrcPath; *TargetPath = TgtPath; - return 0; + return (0); } @@ -705,7 +710,7 @@ AsGetFile ( if (!FileHandle) { printf ("Could not open %s\n", Filename); - return -1; + return (-1); } if (fstat (FileHandle, &Gbl_StatBuf)) @@ -745,7 +750,7 @@ AsGetFile ( Gbl_HasLoneLineFeeds = AsDetectLoneLineFeeds (Filename, Buffer); /* - * Convert all CR/LF pairs to LF only. We do this locally so that + * Convert all CR/LF pairs to LF only. We do this locally so that * this code is portable across operating systems. */ AsConvertToLineFeeds (Buffer); @@ -753,13 +758,13 @@ AsGetFile ( *FileBuffer = Buffer; *FileSize = Size; - return 0; + return (0); ErrorExit: close (FileHandle); - return -1; + return (-1); } @@ -768,7 +773,7 @@ ErrorExit: * FUNCTION: AsPutFile * * DESCRIPTION: Create a new output file and write the entire contents of the - * buffer to the new file. Buffer must be a zero terminated string + * buffer to the new file. Buffer must be a zero terminated string * ******************************************************************************/ @@ -799,7 +804,7 @@ AsPutFile ( { perror ("Could not create destination file"); printf ("Could not create destination file \"%s\"\n", Pathname); - return -1; + return (-1); } /* Write the buffer to the file */ @@ -809,7 +814,5 @@ AsPutFile ( close (DestHandle); - return 0; + return (0); } - - diff --git a/source/tools/acpisrc/asmain.c b/source/tools/acpisrc/asmain.c index e36855b..2e38e34 100644 --- a/source/tools/acpisrc/asmain.c +++ b/source/tools/acpisrc/asmain.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: asmain - Main module for the acpi source processor utility @@ -97,6 +96,7 @@ BOOLEAN Gbl_Overwrite = FALSE; BOOLEAN Gbl_WidenDeclarations = FALSE; BOOLEAN Gbl_IgnoreLoneLineFeeds = FALSE; BOOLEAN Gbl_HasLoneLineFeeds = FALSE; +BOOLEAN Gbl_Cleanup = FALSE; /****************************************************************************** @@ -154,7 +154,7 @@ AsExaminePaths ( if (Status) { printf ("Source path \"%s\" does not exist\n", Source); - return -1; + return (-1); } /* Return the filetype -- file or a directory */ @@ -171,7 +171,7 @@ AsExaminePaths ( if ((ConversionTable->Flags & FLG_NO_FILE_OUTPUT) || (Gbl_BatchMode)) { - return 0; + return (0); } if (!AsStricmp (Source, Target)) @@ -183,7 +183,7 @@ AsExaminePaths ( if (Response != 'y') { - return -1; + return (-1); } Gbl_Overwrite = TRUE; @@ -200,12 +200,12 @@ AsExaminePaths ( if (Response != 'y') { - return -1; + return (-1); } } } - return 0; + return (0); } @@ -325,7 +325,7 @@ main ( if (argc < 2) { AsDisplayUsage (); - return 0; + return (0); } /* Command line options */ @@ -346,6 +346,7 @@ main ( printf ("Code cleanup\n"); ConversionTable = &CleanupConversionTable; + Gbl_Cleanup = TRUE; break; case 'h': @@ -393,7 +394,7 @@ main ( default: AsDisplayUsage (); - return -1; + return (-1); } @@ -402,14 +403,14 @@ main ( { printf ("Missing source path\n"); AsDisplayUsage (); - return -1; + return (-1); } TargetPath = argv[AcpiGbl_Optind+1]; if (!ConversionTable) { - /* Just generate statistics. Ignore target path */ + /* Just generate statistics. Ignore target path */ TargetPath = SourcePath; @@ -430,7 +431,7 @@ main ( if (AsExaminePaths (ConversionTable, SourcePath, TargetPath, &FileType)) { - return -1; + return (-1); } /* Source/target can be either directories or a files */ @@ -461,5 +462,5 @@ main ( AsDisplayStats (); - return 0; + return (0); } diff --git a/source/tools/acpisrc/asremove.c b/source/tools/acpisrc/asremove.c index 8fe29e1..54da0af 100644 --- a/source/tools/acpisrc/asremove.c +++ b/source/tools/acpisrc/asremove.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: asremove - Source conversion - removal functions @@ -59,7 +58,7 @@ AsRemoveStatement ( * * DESCRIPTION: Remove all statements that contain the given keyword. * Limitations: Removes text from the start of the line that - * contains the keyword to the next semicolon. Currently + * contains the keyword to the next semicolon. Currently * doesn't ignore comments. * ******************************************************************************/ @@ -297,7 +296,7 @@ AsRemoveConditionalCompile ( * * FUNCTION: AsRemoveMacro * - * DESCRIPTION: Remove every line that contains the keyword. Does not + * DESCRIPTION: Remove every line that contains the keyword. Does not * skip comments. * ******************************************************************************/ @@ -368,7 +367,7 @@ AsRemoveMacro ( * * FUNCTION: AsRemoveLine * - * DESCRIPTION: Remove every line that contains the keyword. Does not + * DESCRIPTION: Remove every line that contains the keyword. Does not * skip comments. * ******************************************************************************/ @@ -459,7 +458,7 @@ AsReduceTypedefs ( } SubString++; - /* Find the closing brace. Handles nested braces */ + /* Find the closing brace. Handles nested braces */ NestLevel = 1; while (*SubString) @@ -505,7 +504,7 @@ AsReduceTypedefs ( * * FUNCTION: AsRemoveEmptyBlocks * - * DESCRIPTION: Remove any C blocks (e.g., if {}) that contain no code. This + * DESCRIPTION: Remove any C blocks (e.g., if {}) that contain no code. This * can happen as a result of removing lines such as DEBUG_PRINT. * ******************************************************************************/ @@ -612,5 +611,3 @@ AsRemoveDebugMacros ( AsReplaceString ("return_acpi_status", "return", REPLACE_WHOLE_WORD, Buffer); AsReplaceString ("return_VALUE", "return", REPLACE_WHOLE_WORD, Buffer); } - - diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c index 3159b44..fa04e8b 100644 --- a/source/tools/acpisrc/astable.c +++ b/source/tools/acpisrc/astable.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: astable - Tables used for source conversion @@ -206,8 +205,6 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_DEBUG_MEM_HEADER", SRC_TYPE_STRUCT}, {"ACPI_DEBUG_PRINT_INFO", SRC_TYPE_STRUCT}, {"ACPI_DESCRIPTOR", SRC_TYPE_UNION}, - {"ACPI_DEVICE_ID", SRC_TYPE_STRUCT}, - {"ACPI_DEVICE_ID_LIST", SRC_TYPE_STRUCT}, {"ACPI_DEVICE_INFO", SRC_TYPE_STRUCT}, {"ACPI_DEVICE_WALK_INFO", SRC_TYPE_STRUCT}, {"ACPI_DMTABLE_DATA", SRC_TYPE_STRUCT}, @@ -331,6 +328,8 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_PKG_INFO", SRC_TYPE_STRUCT}, {"ACPI_PKG_STATE", SRC_TYPE_STRUCT}, {"ACPI_PMTT_HEADER", SRC_TYPE_STRUCT}, + {"ACPI_PNP_DEVICE_ID", SRC_TYPE_STRUCT}, + {"ACPI_PNP_DEVICE_ID_LIST", SRC_TYPE_STRUCT}, {"ACPI_POINTER", SRC_TYPE_STRUCT}, {"ACPI_POINTERS", SRC_TYPE_UNION}, {"ACPI_PORT_INFO", SRC_TYPE_STRUCT}, @@ -818,10 +817,12 @@ ACPI_CONVERSION_TABLE LicenseConversionTable = { ACPI_STRING_TABLE CustomReplacements[] = { - {"(c) 1999 - 2012", "(c) 1999 - 2012", REPLACE_WHOLE_WORD}, /* Main ACPICA source */ - {"(c) 2006 - 2012", "(c) 2006 - 2012", REPLACE_WHOLE_WORD}, /* Test suites */ - #if 0 + {"SUPPORT, ASSISTANCE", "SUPPORT, ASSISTANCE", REPLACE_WHOLE_WORD}, /* Fix intel header */ + + {"(c) 1999 - 2012", "(c) 1999 - 2012", REPLACE_WHOLE_WORD}, /* Main ACPICA source */ + {"(c) 2006 - 2012", "(c) 2006 - 2012", REPLACE_WHOLE_WORD}, /* Test suites */ + {"(ACPI_INTEGER)", "(UINT64)", REPLACE_WHOLE_WORD}, {"ACPI_INTEGER ", "UINT64 ", REPLACE_WHOLE_WORD}, {"ACPI_INTEGER", "UINT64", REPLACE_WHOLE_WORD}, @@ -894,4 +895,3 @@ ACPI_CONVERSION_TABLE CustomConversionTable = { (CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES | CVT_TRIM_LINES | CVT_TRIM_WHITESPACE), }; - diff --git a/source/tools/acpisrc/asutils.c b/source/tools/acpisrc/asutils.c index a596ea8..f3d9350 100644 --- a/source/tools/acpisrc/asutils.c +++ b/source/tools/acpisrc/asutils.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: asutils - common utilities @@ -63,7 +62,7 @@ AsSkipUntilChar ( { if (!*Buffer) { - return NULL; + return (NULL); } Buffer++; @@ -92,7 +91,7 @@ AsSkipPastChar ( { if (!*Buffer) { - return NULL; + return (NULL); } Buffer++; @@ -110,7 +109,7 @@ AsSkipPastChar ( * * DESCRIPTION: This function inserts and removes data from the file buffer. * if more data is inserted than is removed, the data in the buffer - * is moved to make room. If less data is inserted than is removed, + * is moved to make room. If less data is inserted than is removed, * the remaining data is moved to close the hole. * ******************************************************************************/ @@ -163,7 +162,7 @@ AsReplaceData ( * * DESCRIPTION: This function inserts and removes data from the file buffer. * if more data is inserted than is removed, the data in the buffer - * is moved to make room. If less data is inserted than is removed, + * is moved to make room. If less data is inserted than is removed, * the remaining data is moved to close the hole. * ******************************************************************************/ @@ -208,7 +207,7 @@ AsInsertData ( * * DESCRIPTION: This function inserts and removes data from the file buffer. * if more data is inserted than is removed, the data in the buffer - * is moved to make room. If less data is inserted than is removed, + * is moved to make room. If less data is inserted than is removed, * the remaining data is moved to close the hole. * ******************************************************************************/ @@ -231,4 +230,3 @@ AsRemoveData ( return (StartPointer); } - diff --git a/source/tools/acpixtract/acpixtract.c b/source/tools/acpixtract/acpixtract.c index 85ce346..ef5b28a 100644 --- a/source/tools/acpixtract/acpixtract.c +++ b/source/tools/acpixtract/acpixtract.c @@ -352,7 +352,7 @@ AxCountTableInstances ( } AxNormalizeSignature (InstanceBuffer); - if (!strncmp (InstanceBuffer, Signature, 4)) + if (ACPI_COMPARE_NAME (InstanceBuffer, Signature)) { Instances++; } @@ -527,13 +527,13 @@ AxExtractTables ( } AxNormalizeSignature (LineBuffer); - strncpy (ThisSignature, LineBuffer, 4); + ACPI_MOVE_NAME (ThisSignature, LineBuffer); if (Signature) { /* Ignore signatures that don't match */ - if (strncmp (ThisSignature, Signature, 4)) + if (!ACPI_COMPARE_NAME (ThisSignature, Signature)) { continue; } @@ -716,7 +716,7 @@ AxListTables ( /* FACS has only signature and length */ - if (!strncmp (TableHeader->Signature, "FACS", 4)) + if (ACPI_COMPARE_NAME (TableHeader->Signature, "FACS")) { printf ("\n"); continue; |