From owner-svn-src-user@FreeBSD.ORG Sun Aug 22 21:54:40 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABB2E1065695; Sun, 22 Aug 2010 21:54:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99AB08FC14; Sun, 22 Aug 2010 21:54:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7MLseNN017853; Sun, 22 Aug 2010 21:54:40 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7MLseJA017844; Sun, 22 Aug 2010 21:54:40 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008222154.o7MLseJA017844@svn.freebsd.org> From: Warner Losh Date: Sun, 22 Aug 2010 21:54:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211660 - in user/imp/tbemd/sys/contrib/dev/acpica: . common X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 21:54:40 -0000 Author: imp Date: Sun Aug 22 21:54:40 2010 New Revision: 211660 URL: http://svn.freebsd.org/changeset/base/211660 Log: Merge to head @211636 -- with hand tweaks [given up] hoping for the best Modified: user/imp/tbemd/sys/contrib/dev/acpica/acpica_prep.sh user/imp/tbemd/sys/contrib/dev/acpica/changes.txt user/imp/tbemd/sys/contrib/dev/acpica/common/adisasm.c user/imp/tbemd/sys/contrib/dev/acpica/common/adwalk.c user/imp/tbemd/sys/contrib/dev/acpica/common/dmextern.c user/imp/tbemd/sys/contrib/dev/acpica/common/dmrestag.c user/imp/tbemd/sys/contrib/dev/acpica/common/dmtable.c user/imp/tbemd/sys/contrib/dev/acpica/common/dmtbdump.c user/imp/tbemd/sys/contrib/dev/acpica/common/dmtbinfo.c Modified: user/imp/tbemd/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- user/imp/tbemd/sys/contrib/dev/acpica/acpica_prep.sh Sun Aug 22 21:54:08 2010 (r211659) +++ user/imp/tbemd/sys/contrib/dev/acpica/acpica_prep.sh Sun Aug 22 21:54:40 2010 (r211660) @@ -33,7 +33,8 @@ src_headers="acapps.h accommon.h acconfi acresrc.h acrestyp.h acstruct.h actables.h actbl.h actbl1.h \ actbl2.h actypes.h acutils.h amlcode.h amlresrc.h \ platform/acenv.h platform/acfreebsd.h platform/acgcc.h" -comp_headers="aslcompiler.h asldefine.h aslglobal.h asltypes.h" +comp_headers="aslcompiler.h asldefine.h aslglobal.h asltypes.h \ + dtcompiler.h dttemplate.h" platform_headers="acfreebsd.h acgcc.h" # pre-clean @@ -49,7 +50,7 @@ tar -x -z -f ${src} -C ${wrk} # strip files echo strip for i in ${stripdirs}; do - find ${wrk} -name ${i} -type d | xargs rm -r + find ${wrk} -name ${i} -type d -print | xargs rm -r done for i in ${stripfiles}; do find ${wrk} -name ${i} -type f -delete @@ -58,22 +59,22 @@ done # copy files echo copying full dirs for i in ${fulldirs}; do - find ${wrk} -name ${i} -type d | xargs -J % mv % ${dst} + find ${wrk} -name ${i} -type d -print | xargs -J % mv % ${dst} done echo copying remaining files -find ${wrk} -type f | xargs -J % mv % ${dst} +find ${wrk} -type f -print | xargs -J % mv % ${dst} # canonify include paths for H in ${src_headers}; do - find ${dst} -name "*.[chy]" -type f | \ + find ${dst} -name "*.[chy]" -type f -print | \ xargs sed -i "" -e "s|[\"<]$H[\">]|\|g" done for H in ${comp_headers}; do - find ${dst}/compiler -name "*.[chly]" -type f | \ + find ${dst}/common ${dst}/compiler -name "*.[chly]" -type f | \ xargs sed -i "" -e "s|[\"<]$H[\">]|\|g" done for H in ${platform_headers}; do - find ${dst}/include/platform -name "*.h" -type f | \ + find ${dst}/include/platform -name "*.h" -type f -print | \ xargs sed -i "" -e "s|[\"<]$H[\">]|\|g" done Modified: user/imp/tbemd/sys/contrib/dev/acpica/changes.txt ============================================================================== --- user/imp/tbemd/sys/contrib/dev/acpica/changes.txt Sun Aug 22 21:54:08 2010 (r211659) +++ user/imp/tbemd/sys/contrib/dev/acpica/changes.txt Sun Aug 22 21:54:40 2010 (r211660) @@ -1,4 +1,226 @@ ---------------------------------------- +06 August 2010. Summary of changes for version 20100806: + +1) ACPI CA Core Subsystem: + +Designed and implemented a new host interface to the _OSI support code. This +will allow the host to dynamically add or remove multiple _OSI strings, as +well as install an optional handler that is called for each _OSI invocation. +Also added a new AML debugger command, 'osi' to display and modify the global +_OSI string table, and test support in the AcpiExec utility. See the ACPICA +reference manual for full details. Lin Ming, Bob Moore. ACPICA BZ 836. +New Functions: + AcpiInstallInterface - Add an _OSI string. + AcpiRemoveInterface - Delete an _OSI string. + AcpiInstallInterfaceHandler - Install optional _OSI handler. +Obsolete Functions: + AcpiOsValidateInterface - no longer used. +New Files: + source/components/utilities/utosi.c + +Re-introduced the support to enable multi-byte transfers for Embedded +Controller (EC) operation regions. A reported problem was found to be a bug +in the host OS, not in the multi-byte support. Previously, the maximum data +size passed to the EC operation region handler was a single byte. There are +often EC Fields larger than one byte that need to be transferred, and it is +useful for the EC driver to lock these as a single transaction. This change +enables single transfers larger than 8 bits. This effectively changes the +access to the EC space from ByteAcc to AnyAcc, and will probably require +changes to the host OS Embedded Controller driver to enable 16/32/64/256-bit +transfers in addition to 8-bit transfers. Alexey Starikovskiy, Lin Ming. + +Fixed a problem with the prototype for AcpiOsReadPciConfiguration. The +prototype in acpiosxf.h had the output value pointer as a (void *). +It should be a (UINT64 *). This may affect some host OSL code. + +Fixed a couple problems with the recently modified Linux makefiles for iASL +and AcpiExec. These new makefiles place the generated object files in the +local directory so that there can be no collisions between the files that are +shared between them that are compiled with different options. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 88.3K Code, 18.8K Data, 107.1K Total + Debug Version: 164.0K Code, 51.5K Data, 215.5K Total + Current Release: + Non-Debug Version: 89.1K Code, 19.0K Data, 108.1K Total + Debug Version: 165.1K Code, 51.9K Data, 217.0K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL/Disassembler: Added a new option (-da, "disassemble all") to load the +namespace from and disassemble an entire group of AML files. Useful for +loading all of the AML tables for a given machine (DSDT, SSDT1...SSDTn) and +disassembling with one simple command. ACPICA BZ 865. Lin Ming. + +iASL: Allow multiple invocations of -e option. This change allows multiple +uses of -e on the command line: "-e ssdt1.dat -e ssdt2.dat". ACPICA BZ 834. +Lin Ming. + +---------------------------------------- +02 July 2010. Summary of changes for version 20100702: + +1) ACPI CA Core Subsystem: + +Implemented several updates to the recently added GPE reference count +support. The model for "wake" GPEs is changing to give the host OS complete +control of these GPEs. Eventually, the ACPICA core will not execute any _PRW +methods, since the host already must execute them. Also, additional changes +were made to help ensure that the reference counts are kept in proper +synchronization with reality. Rafael J. Wysocki. + +1) Ensure that GPEs are not enabled twice during initialization. +2) Ensure that GPE enable masks stay in sync with the reference count. +3) Do not inadvertently enable GPEs when writing GPE registers. +4) Remove the internal wake reference counter and add new AcpiGpeWakeup +interface. This interface will set or clear individual GPEs for wakeup. +5) Remove GpeType argument from AcpiEnable and AcpiDisable. These interfaces +are now used for "runtime" GPEs only. + +Changed the behavior of the GPE install/remove handler interfaces. The GPE is +no longer disabled during this process, as it was found to cause problems on +some machines. Rafael J. Wysocki. + +Reverted a change introduced in version 20100528 to enable Embedded +Controller multi-byte transfers. This change was found to cause problems with +Index Fields and possibly Bank Fields. It will be reintroduced when these +problems have been resolved. + +Fixed a problem with references to Alias objects within Package Objects. A +reference to an Alias within the definition of a Package was not always +resolved properly. Aliases to objects like Processors, Thermal zones, etc. +were resolved to the actual object instead of a reference to the object as it +should be. Package objects are only allowed to contain integer, string, +buffer, package, and reference objects. Redhat bugzilla 608648. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 88.3K Code, 18.8K Data, 107.1K Total + Debug Version: 164.1K Code, 51.5K Data, 215.6K Total + Current Release: + Non-Debug Version: 88.3K Code, 18.8K Data, 107.1K Total + Debug Version: 164.0K Code, 51.5K Data, 215.5K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented a new compiler subsystem to allow definition and +compilation of the non-AML ACPI tables such as FADT, MADT, SRAT, etc. These +are called "ACPI Data Tables", and the new compiler is the "Data Table +Compiler". This compiler is intended to simplify the existing error-prone +process of creating these tables for the BIOS, as well as allowing the +disassembly, modification, recompilation, and override of existing ACPI data +tables. See the iASL User Guide for detailed information. + +iASL: Implemented a new Template Generator option in support of the new Data +Table Compiler. This option will create examples of all known ACPI tables +that can be used as the basis for table development. See the iASL +documentation and the -T option. + +Disassembler and headers: Added support for the WDDT ACPI table (Watchdog +Descriptor Table). + +Updated the Linux makefiles for iASL and AcpiExec to place the generated +object files in the local directory so that there can be no collisions +between the shared files between them that are generated with different +options. + +Added support for Mac OS X in the Unix OSL used for iASL and AcpiExec. Use +the #define __APPLE__ to enable this support. + +---------------------------------------- +28 May 2010. Summary of changes for version 20100528: + +Note: The ACPI 4.0a specification was released on April 5, 2010 and is +available at www.acpi.info. This is primarily an errata release. + +1) ACPI CA Core Subsystem: + +Undefined ACPI tables: We are looking for the definitions for the following +ACPI tables that have been seen in the field: ATKG, IEIT, GSCI. + +Implemented support to enable multi-byte transfers for Embedded Controller +(EC) operation regions. Previously, the maximum data size passed to the EC +operation region handler was a single byte. There are often EC Fields larger +than one byte that need to be transferred, and it is useful for the EC driver +to lock these as a single transaction. This change enables single transfers +larger than 8 bits. This effectively changes the access to the EC space from +ByteAcc to AnyAcc, and will probably require changes to the host OS Embedded +Controller driver to enable 16/32/64/256-bit transfers in addition to 8-bit +transfers. Alexey Starikovskiy, Lin Ming + +Implemented a performance enhancement for namespace search and access. This +change enhances the performance of namespace searches and walks by adding a +backpointer to the parent in each namespace node. On large namespaces, this +change can improve overall ACPI performance by up to 9X. Adding a pointer to +each namespace node increases the overall size of the internal namespace by +about 5%, since each namespace entry usually consists of both a namespace +node and an ACPI operand object. However, this is the first growth of the +namespace in ten years. ACPICA bugzilla 817. Alexey Starikovskiy. + +Implemented a performance optimization that reduces the number of namespace +walks. On control method exit, only walk the namespace if the method is known +to have created namespace objects outside of its local scope. Previously, the +entire namespace was traversed on each control method exit. This change can +improve overall ACPI performance by up to 3X. Alexey Starikovskiy, Bob Moore. + +Added support to truncate I/O addresses to 16 bits for Windows compatibility. +Some ASL code has been seen in the field that inadvertently has bits set +above bit 15. This feature is optional and is enabled if the BIOS requests +any Windows OSI strings. It can also be enabled by the host OS. Matthew +Garrett, Bob Moore. + +Added support to limit the maximum time for the ASL Sleep() operator. To +prevent accidental deep sleeps, limit the maximum time that Sleep() will +actually sleep. Configurable, the default maximum is two seconds. ACPICA +bugzilla 854. + +Added run-time validation support for the _WDG and_WED Microsoft predefined +methods. These objects are defined by "Windows Instrumentation", and are not +part of the ACPI spec. ACPICA BZ 860. + +Expanded all statistic counters used during namespace and device +initialization from 16 to 32 bits in order to support very large namespaces. + +Replaced all instances of %d in printf format specifiers with %u since nearly +all integers in ACPICA are unsigned. + +Fixed the exception namestring for AE_WAKE_ONLY_GPE. Was incorrectly returned +as AE_NO_HANDLER. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 88.4K Code, 18.8K Data, 107.2K Total + Debug Version: 164.2K Code, 51.5K Data, 215.7K Total + Current Release: + Non-Debug Version: 88.3K Code, 18.8K Data, 107.1K Total + Debug Version: 164.1K Code, 51.5K Data, 215.6K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Added compiler support for the _WDG and_WED Microsoft predefined +methods. These objects are defined by "Windows Instrumentation", and are not +part of the ACPI spec. ACPICA BZ 860. + +AcpiExec: added option to disable the memory tracking mechanism. The -dt +option will disable the tracking mechanism, which improves performance +considerably. + +AcpiExec: Restructured the command line options into -d (disable) and -e +(enable) options. + +---------------------------------------- 28 April 2010. Summary of changes for version 20100428: 1) ACPI CA Core Subsystem: Modified: user/imp/tbemd/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- user/imp/tbemd/sys/contrib/dev/acpica/common/adisasm.c Sun Aug 22 21:54:08 2010 (r211659) +++ user/imp/tbemd/sys/contrib/dev/acpica/common/adisasm.c Sun Aug 22 21:54:40 2010 (r211660) @@ -134,7 +134,6 @@ extern int AslCompilerdebug; -extern char *Gbl_ExternalFilename; ACPI_STATUS @@ -153,10 +152,6 @@ AdCreateTableHeader ( char *Filename, ACPI_TABLE_HEADER *Table); -void -AdDisassemblerHeader ( - char *Filename); - ACPI_STATUS AdDeferredParse ( ACPI_PARSE_OBJECT *Op, @@ -317,6 +312,7 @@ AdAmlDisassemble ( ACPI_STATUS Status; char *DisasmFilename = NULL; char *ExternalFilename; + ACPI_EXTERNAL_FILE *ExternalFileList = AcpiGbl_ExternalFileList; FILE *File = NULL; ACPI_TABLE_HEADER *Table = NULL; ACPI_TABLE_HEADER *ExternalTable; @@ -339,46 +335,54 @@ AdAmlDisassemble ( * External filenames separated by commas * Example: iasl -e file1,file2,file3 -d xxx.aml */ - if (Gbl_ExternalFilename) + while (ExternalFileList) { - ExternalFilename = strtok (Gbl_ExternalFilename, ","); + ExternalFilename = ExternalFileList->Path; + if (!ACPI_STRCMP (ExternalFilename, Filename)) + { + /* Next external file */ + + ExternalFileList = ExternalFileList->Next; + + continue; + } + + Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable); + if (ACPI_FAILURE (Status)) + { + return Status; + } + + /* Load external table for symbol resolution */ - while (ExternalFilename) + if (ExternalTable) { - Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable); + Status = AdParseTable (ExternalTable, &OwnerId, TRUE, TRUE); if (ACPI_FAILURE (Status)) { + AcpiOsPrintf ("Could not parse external ACPI tables, %s\n", + AcpiFormatException (Status)); return Status; } - /* Load external table for symbol resolution */ - - if (ExternalTable) - { - Status = AdParseTable (ExternalTable, &OwnerId, TRUE, TRUE); - if (ACPI_FAILURE (Status)) - { - AcpiOsPrintf ("Could not parse external ACPI tables, %s\n", - AcpiFormatException (Status)); - return Status; - } - - /* - * Load namespace from names created within control methods - * Set owner id of nodes in external table - */ - AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot, - AcpiGbl_RootNode, OwnerId); - AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot); - } + /* + * Load namespace from names created within control methods + * Set owner id of nodes in external table + */ + AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot, + AcpiGbl_RootNode, OwnerId); + AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot); + } - /* Next external file name */ + /* Next external file */ - ExternalFilename = strtok (NULL, ","); - } + ExternalFileList = ExternalFileList->Next; + } - /* Clear external list generated by Scope in external tables */ + /* Clear external list generated by Scope in external tables */ + if (AcpiGbl_ExternalFileList) + { AcpiDmClearExternalList (); } } @@ -502,7 +506,7 @@ AdAmlDisassemble ( if (AcpiDmGetExternalMethodCount ()) { fprintf (stderr, - "\nFound %d external control methods, reparsing with new information\n", + "\nFound %u external control methods, reparsing with new information\n", AcpiDmGetExternalMethodCount ()); /* @@ -515,10 +519,11 @@ AdAmlDisassemble ( AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME; AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED; AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE; + AcpiGbl_RootNodeStruct.Parent = NULL; AcpiGbl_RootNodeStruct.Child = NULL; AcpiGbl_RootNodeStruct.Peer = NULL; AcpiGbl_RootNodeStruct.Object = NULL; - AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST; + AcpiGbl_RootNodeStruct.Flags = 0; Status = AcpiNsRootInitialize (); AcpiDmAddExternalsToNamespace (); @@ -643,7 +648,7 @@ AdCreateTableHeader ( */ AdDisassemblerHeader (Filename); - AcpiOsPrintf (" *\n * Original Table Header:\n"); + AcpiOsPrintf (" * Original Table Header:\n"); AcpiOsPrintf (" * Signature \"%4.4s\"\n", Table->Signature); AcpiOsPrintf (" * Length 0x%8.8X (%u)\n", Table->Length, Table->Length); @@ -688,7 +693,7 @@ AdCreateTableHeader ( AcpiOsPrintf (" * OEM Revision 0x%8.8X (%u)\n", Table->OemRevision, Table->OemRevision); AcpiOsPrintf (" * Compiler ID \"%.4s\"\n", Table->AslCompilerId); AcpiOsPrintf (" * Compiler Version 0x%8.8X (%u)\n", Table->AslCompilerRevision, Table->AslCompilerRevision); - AcpiOsPrintf (" */\n"); + AcpiOsPrintf (" */\n\n"); /* Create AML output filename based on input filename */ @@ -706,7 +711,7 @@ AdCreateTableHeader ( /* Open the ASL definition block */ AcpiOsPrintf ( - "DefinitionBlock (\"%s\", \"%4.4s\", %hd, \"%.6s\", \"%.8s\", 0x%8.8X)\n", + "DefinitionBlock (\"%s\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n", NewFilename, Table->Signature, Table->Revision, Table->OemId, Table->OemTableId, Table->OemRevision); @@ -1018,7 +1023,7 @@ AdGetLocalTables ( * is architecture-dependent. */ NumTables = (NewTable->Length - sizeof (ACPI_TABLE_HEADER)) / PointerSize; - AcpiOsPrintf ("There are %d tables defined in the %4.4s\n\n", + AcpiOsPrintf ("There are %u tables defined in the %4.4s\n\n", NumTables, NewTable->Signature); /* Get the FADT */ Modified: user/imp/tbemd/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- user/imp/tbemd/sys/contrib/dev/acpica/common/adwalk.c Sun Aug 22 21:54:08 2010 (r211659) +++ user/imp/tbemd/sys/contrib/dev/acpica/common/adwalk.c Sun Aug 22 21:54:40 2010 (r211660) @@ -537,7 +537,7 @@ AcpiDmFindOrphanDescending ( } ArgCount = AcpiDmInspectPossibleArgs (3, 1, NextOp); - AcpiOsPrintf ("/* A-CHILDREN: %d Actual %d */\n", ArgCount, AcpiDmCountChildren (Op)); + AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n", ArgCount, AcpiDmCountChildren (Op)); if (ArgCount < 1) { Modified: user/imp/tbemd/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- user/imp/tbemd/sys/contrib/dev/acpica/common/dmextern.c Sun Aug 22 21:54:08 2010 (r211659) +++ user/imp/tbemd/sys/contrib/dev/acpica/common/dmextern.c Sun Aug 22 21:54:40 2010 (r211660) @@ -252,7 +252,7 @@ AcpiDmNormalizeParentPrefix ( Node = Op->Common.Node; while (Node && (*Path == (UINT8) AML_PARENT_PREFIX)) { - Node = AcpiNsGetParentNode (Node); + Node = Node->Parent; Path++; } @@ -312,6 +312,95 @@ Cleanup: /******************************************************************************* * + * FUNCTION: AcpiDmAddToExternalFileList + * + * PARAMETERS: PathList - Single path or list separated by comma + * + * RETURN: None + * + * DESCRIPTION: Add external files to global list + * + ******************************************************************************/ + +ACPI_STATUS +AcpiDmAddToExternalFileList ( + char *PathList) +{ + ACPI_EXTERNAL_FILE *ExternalFile; + char *Path; + char *TmpPath; + + + if (!PathList) + { + return (AE_OK); + } + + Path = strtok (PathList, ","); + + while (Path) + { + TmpPath = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (Path) + 1); + if (!TmpPath) + { + return (AE_NO_MEMORY); + } + + ACPI_STRCPY (TmpPath, Path); + + ExternalFile = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_FILE)); + if (!ExternalFile) + { + ACPI_FREE (TmpPath); + return (AE_NO_MEMORY); + } + + ExternalFile->Path = TmpPath; + + if (AcpiGbl_ExternalFileList) + { + ExternalFile->Next = AcpiGbl_ExternalFileList; + } + + AcpiGbl_ExternalFileList = ExternalFile; + Path = strtok (NULL, ","); + } + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmClearExternalFileList + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Clear the external file list + * + ******************************************************************************/ + +void +AcpiDmClearExternalFileList ( + void) +{ + ACPI_EXTERNAL_FILE *NextExternal; + + + while (AcpiGbl_ExternalFileList) + { + NextExternal = AcpiGbl_ExternalFileList->Next; + ACPI_FREE (AcpiGbl_ExternalFileList->Path); + ACPI_FREE (AcpiGbl_ExternalFileList); + AcpiGbl_ExternalFileList = NextExternal; + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmAddToExternalList * * PARAMETERS: Op - Current parser Op @@ -629,7 +718,7 @@ AcpiDmEmitExternals ( if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD) { - AcpiOsPrintf (") // %d Arguments\n", + AcpiOsPrintf (") // %u Arguments\n", AcpiGbl_ExternalList->Value); } else Modified: user/imp/tbemd/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- user/imp/tbemd/sys/contrib/dev/acpica/common/dmrestag.c Sun Aug 22 21:54:08 2010 (r211659) +++ user/imp/tbemd/sys/contrib/dev/acpica/common/dmrestag.c Sun Aug 22 21:54:40 2010 (r211660) @@ -549,13 +549,6 @@ AcpiDmGetResourceNode ( return (Node); } - /* List is circular, this flag marks the end */ - - if (Node->Flags & ANOBJ_END_OF_PEER_LIST) - { - return (NULL); - } - Node = Node->Peer; } Modified: user/imp/tbemd/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- user/imp/tbemd/sys/contrib/dev/acpica/common/dmtable.c Sun Aug 22 21:54:08 2010 (r211659) +++ user/imp/tbemd/sys/contrib/dev/acpica/common/dmtable.c Sun Aug 22 21:54:40 2010 (r211660) @@ -117,6 +117,8 @@ #include #include #include +#include +#include /* This module used for application-level code only */ @@ -125,20 +127,12 @@ /* Local Prototypes */ -static ACPI_DMTABLE_DATA * -AcpiDmGetTableData ( - char *Signature); - static void AcpiDmCheckAscii ( UINT8 *Target, char *RepairedName, UINT32 Count); -UINT8 -AcpiTbGenerateChecksum ( - ACPI_TABLE_HEADER *Table); - /* These tables map a subtable type to a description string */ @@ -161,6 +155,74 @@ static const char *AcpiDmDmarS "Unknown SubTable Type" /* Reserved */ }; +static const char *AcpiDmEinjActions[] = +{ + "Begin Operation", + "Get Trigger Table", + "Set Error Type", + "Get Error Type", + "End Operation", + "Execute Operation", + "Check Busy Status", + "Get Command Status", + "Unknown Action" +}; + +static const char *AcpiDmEinjInstructions[] = +{ + "Read Register", + "Read Register Value", + "Write Register", + "Write Register Value", + "Noop", + "Unknown Instruction" +}; + +static const char *AcpiDmErstActions[] = +{ + "Begin Write Operation", + "Begin Read Operation", + "Begin Clear Operation", + "End Operation", + "Set Record Offset", + "Execute Operation", + "Check Busy Status", + "Get Command Status", + "Get Record Identifier", + "Set Record Identifier", + "Get Record Count", + "Begin Dummy Write", + "Unused/Unknown Action", + "Get Error Address Range", + "Get Error Address Length", + "Get Error Attributes", + "Unknown Action" +}; + +static const char *AcpiDmErstInstructions[] = +{ + "Read Register", + "Read Register Value", + "Write Register", + "Write Register Value", + "Noop", + "Load Var1", + "Load Var2", + "Store Var1", + "Add", + "Subtract", + "Add Value", + "Subtract Value", + "Stall", + "Stall While True", + "Skip Next If True", + "GoTo", + "Set Source Address", + "Set Destination Address", + "Move Data", + "Unknown Instruction" +}; + static const char *AcpiDmHestSubnames[] = { "IA-32 Machine Check Exception", @@ -237,56 +299,59 @@ static const char *AcpiDmFadtP * * ACPI Table Data, indexed by signature. * - * Each entry contains: Signature, Table Info, Handler, Description + * Each entry contains: Signature, Table Info, Handler, DtHandler, + * Template, Description * - * Simple tables have only a TableInfo structure, complex tables have a handler. - * This table must be NULL terminated. RSDP and FACS are special-cased - * elsewhere. + * Simple tables have only a TableInfo structure, complex tables have a + * handler. This table must be NULL terminated. RSDP and FACS are + * special-cased elsewhere. * ******************************************************************************/ -static ACPI_DMTABLE_DATA AcpiDmTableData[] = +ACPI_DMTABLE_DATA AcpiDmTableData[] = { - {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, "Alert Standard Format table"}, - {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, "Simple Boot Flag Table"}, - {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, "Boot Error Record Table"}, - {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, "Corrected Platform Error Polling table"}, - {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, "Debug Port table"}, - {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, "DMA Remapping table"}, - {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, "Embedded Controller Boot Resources Table"}, - {ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, "Error Injection table"}, - {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, "Error Record Serialization Table"}, - {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, "Fixed ACPI Description Table"}, - {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, "Hardware Error Source Table"}, - {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, "High Precision Event Timer table"}, - {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, "I/O Virtualization Reporting Structure"}, - {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, "Multiple APIC Description Table"}, - {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, "Memory Mapped Configuration table"}, - {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, "Management Controller Host Interface table"}, - {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, "Maximum System Characteristics Table"}, - {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, "Root System Description Table"}, - {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, "Smart Battery Specification Table"}, - {ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, "Software Licensing Description Table"}, - {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, "System Locality Information Table"}, - {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, "Serial Port Console Redirection table"}, - {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, "Server Platform Management Interface table"}, - {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, "System Resource Affinity Table"}, - {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, "Trusted Computing Platform Alliance table"}, - {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, "UEFI Boot Optimization Table"}, - {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, "Windows ACPI Emulated Devices Table"}, - {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, "Watchdog Action Table"}, - {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, "Watchdog Resource Table"}, - {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, "Extended System Description Table"}, - {NULL, NULL, NULL, NULL} + {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf, "Alert Standard Format table"}, + {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot, "Simple Boot Flag Table"}, + {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert, "Boot Error Record Table"}, + {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep, "Corrected Platform Error Polling table"}, + {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp, "Debug Port table"}, + {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar, "DMA Remapping table"}, + {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt, "Embedded Controller Boot Resources Table"}, + {ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj, "Error Injection table"}, + {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"}, + {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table"}, + {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"}, + {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"}, + {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"}, + {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table"}, + {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg, "Memory Mapped Configuration table"}, + {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"}, + {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"}, + {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt, "Root System Description Table"}, + {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst, "Smart Battery Specification Table"}, + {ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, NULL, NULL, "Software Licensing Description Table"}, + {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit, "System Locality Information Table"}, + {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr, "Serial Port Console Redirection table"}, + {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi, "Server Platform Management Interface table"}, + {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat, "System Resource Affinity Table"}, + {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, NULL, TemplateTcpa, "Trusted Computing Platform Alliance table"}, + {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, NULL, TemplateUefi, "UEFI Boot Optimization Table"}, + {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet, "Windows ACPI Emulated Devices Table"}, + {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, TemplateWdat, "Watchdog Action Table"}, + {ACPI_SIG_WDDT, AcpiDmTableInfoWddt, NULL, NULL, TemplateWddt, "Watchdog Description Table"}, + {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, TemplateWdrt, "Watchdog Resource Table"}, + {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, TemplateXsdt, "Extended System Description Table"}, + {NULL, NULL, NULL, NULL, NULL, NULL} }; /******************************************************************************* * - * FUNCTION: AcpiTbGenerateChecksum + * FUNCTION: AcpiDmGenerateChecksum * - * PARAMETERS: Table - Pointer to a valid ACPI table (with a - * standard ACPI header) + * PARAMETERS: Table - Pointer to table to be checksummed + * Length - Length of the table + * OriginalChecksum - Value of the checksum field * * RETURN: 8 bit checksum of buffer * @@ -295,19 +360,21 @@ static ACPI_DMTABLE_DATA AcpiDmTableD ******************************************************************************/ UINT8 -AcpiTbGenerateChecksum ( - ACPI_TABLE_HEADER *Table) +AcpiDmGenerateChecksum ( + void *Table, + UINT32 Length, + UINT8 OriginalChecksum) { UINT8 Checksum; /* Sum the entire table as-is */ - Checksum = AcpiTbChecksum ((UINT8 *) Table, Table->Length); + Checksum = AcpiTbChecksum ((UINT8 *) Table, Length); /* Subtract off the existing checksum value in the table */ - Checksum = (UINT8) (Checksum - Table->Checksum); + Checksum = (UINT8) (Checksum - OriginalChecksum); /* Compute the final checksum */ @@ -328,7 +395,7 @@ AcpiTbGenerateChecksum ( * ******************************************************************************/ -static ACPI_DMTABLE_DATA * +ACPI_DMTABLE_DATA * AcpiDmGetTableData ( char *Signature) { @@ -432,10 +499,13 @@ AcpiDmDumpDataTable ( } } - /* Always dump the raw table data */ + if (!Gbl_DoTemplates || Gbl_VerboseTemplates) + { + /* Dump the raw table data */ - AcpiOsPrintf ("\nRaw Table Data\n\n"); - AcpiUtDumpBuffer2 (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY); + AcpiOsPrintf ("\nRaw Table Data\n\n"); + AcpiUtDumpBuffer2 (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY); + } } @@ -463,15 +533,31 @@ AcpiDmLineHeader ( char *Name) { - if (ByteLength) + if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */ { - AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %28s : ", - Offset, Offset, ByteLength, Name); + if (ByteLength) + { + AcpiOsPrintf ("[%.3d] %34s : ", + ByteLength, Name); + } + else + { + AcpiOsPrintf ("%40s : ", + Name); + } } - else + else /* Normal disassembler or verbose template */ { - AcpiOsPrintf ("%43s : ", - Name); + if (ByteLength) + { + AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %28s : ", + Offset, Offset, ByteLength, Name); + } + else + { + AcpiOsPrintf ("%43s : ", + Name); + } } } @@ -483,15 +569,31 @@ AcpiDmLineHeader2 ( UINT32 Value) { - if (ByteLength) + if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */ { - AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %24s % 3d : ", - Offset, Offset, ByteLength, Name, Value); + if (ByteLength) + { + AcpiOsPrintf ("[%.3d] %30s % 3d : ", + ByteLength, Name, Value); + } + else + { + AcpiOsPrintf ("%36s % 3d : ", + Name, Value); + } } - else + else /* Normal disassembler or verbose template */ { - AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s % 3d : ", - Offset, Offset, Name, Value); + if (ByteLength) + { + AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %24s % 3d : ", + Offset, Offset, ByteLength, Name, Value); + } + else + { + AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s % 3d : ", + Offset, Offset, Name, Value); + } } } @@ -511,6 +613,8 @@ AcpiDmLineHeader2 ( * * DESCRIPTION: Display ACPI table contents by walking the Info table. * + * Note: This function must remain in sync with DtGetFieldLength. + * ******************************************************************************/ ACPI_STATUS @@ -571,6 +675,10 @@ AcpiDmDumpTable ( case ACPI_DMT_ASF: case ACPI_DMT_HESTNTYP: case ACPI_DMT_FADTPM: + case ACPI_DMT_EINJACT: + case ACPI_DMT_EINJINST: + case ACPI_DMT_ERSTACT: + case ACPI_DMT_ERSTINST: ByteLength = 1; break; case ACPI_DMT_UINT16: @@ -705,7 +813,11 @@ AcpiDmDumpTable ( for (Temp8 = 0; Temp8 < 16; Temp8++) { - AcpiOsPrintf ("%2.2X,", Target[Temp8]); + AcpiOsPrintf ("%2.2X", Target[Temp8]); + if ((Temp8 + 1) < 16) + { + AcpiOsPrintf (","); + } } AcpiOsPrintf ("\n"); break; @@ -754,7 +866,9 @@ AcpiDmDumpTable ( /* Checksum, display and validate */ AcpiOsPrintf ("%2.2X", *Target); - Temp8 = AcpiTbGenerateChecksum (Table); + Temp8 = AcpiDmGenerateChecksum (Table, + ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length, + ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum); if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum) { AcpiOsPrintf ( @@ -807,6 +921,58 @@ AcpiDmDumpTable ( AcpiOsPrintf ("%4.4X <%s>\n", ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]); break; + case ACPI_DMT_EINJACT: + + /* EINJ Action types */ + + Temp8 = *Target; + if (Temp8 > ACPI_EINJ_ACTION_RESERVED) + { + Temp8 = ACPI_EINJ_ACTION_RESERVED; + } + + AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmEinjActions[Temp8]); + break; + + case ACPI_DMT_EINJINST: + + /* EINJ Instruction types */ + + Temp8 = *Target; + if (Temp8 > ACPI_EINJ_INSTRUCTION_RESERVED) + { + Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED; + } + + AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmEinjInstructions[Temp8]); + break; + + case ACPI_DMT_ERSTACT: *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***