From owner-svn-src-all@freebsd.org Thu Jun 1 00:01:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09C76BED63A; Thu, 1 Jun 2017 00:01:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A87F271B76; Thu, 1 Jun 2017 00:01:21 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5101KJ0014303; Thu, 1 Jun 2017 00:01:20 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5101JtX014290; Thu, 1 Jun 2017 00:01:19 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201706010001.v5101JtX014290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 1 Jun 2017 00:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319365 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 00:01:22 -0000 Author: jkim Date: Thu Jun 1 00:01:19 2017 New Revision: 319365 URL: https://svnweb.freebsd.org/changeset/base/319365 Log: Merge ACPICA 20170531. Added: head/sys/contrib/dev/acpica/common/dmswitch.c - copied, changed from r319363, vendor-sys/acpica/dist/source/common/dmswitch.c head/sys/contrib/dev/acpica/components/utilities/utresdecode.c - copied, changed from r319363, vendor-sys/acpica/dist/source/components/utilities/utresdecode.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/acfileio.c head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/ahids.c head/sys/contrib/dev/acpica/common/ahpredef.c head/sys/contrib/dev/acpica/common/ahtable.c head/sys/contrib/dev/acpica/common/ahuuids.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/compiler/aslascii.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslexternal.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/aslhelp.c head/sys/contrib/dev/acpica/compiler/aslhelpers.y head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmap.c head/sys/contrib/dev/acpica/compiler/asloffset.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/aslparser.y head/sys/contrib/dev/acpica/compiler/aslresource.c head/sys/contrib/dev/acpica/compiler/aslresources.y head/sys/contrib/dev/acpica/compiler/aslrestype2s.c head/sys/contrib/dev/acpica/compiler/aslrules.y head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/asltokens.y head/sys/contrib/dev/acpica/compiler/asltree.c head/sys/contrib/dev/acpica/compiler/asltypes.y head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/compiler/cvcompiler.c head/sys/contrib/dev/acpica/compiler/cvdisasm.c head/sys/contrib/dev/acpica/compiler/cvparser.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtfield.c head/sys/contrib/dev/acpica/compiler/dttable1.c head/sys/contrib/dev/acpica/compiler/dttable2.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/compiler/dtutils.c head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbobject.c head/sys/contrib/dev/acpica/components/debugger/dbxface.c head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c head/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c head/sys/contrib/dev/acpica/components/dispatcher/dsargs.c head/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c head/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c head/sys/contrib/dev/acpica/components/dispatcher/dswexec.c head/sys/contrib/dev/acpica/components/dispatcher/dswload.c head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c head/sys/contrib/dev/acpica/components/events/evxfevnt.c head/sys/contrib/dev/acpica/components/executer/exdebug.c head/sys/contrib/dev/acpica/components/executer/exdump.c head/sys/contrib/dev/acpica/components/executer/exoparg1.c head/sys/contrib/dev/acpica/components/executer/exresolv.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/namespace/nsnames.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/parser/psopcode.c head/sys/contrib/dev/acpica/components/parser/psparse.c head/sys/contrib/dev/acpica/components/resources/rscalc.c head/sys/contrib/dev/acpica/components/resources/rsdump.c head/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c head/sys/contrib/dev/acpica/components/resources/rsinfo.c head/sys/contrib/dev/acpica/components/resources/rsmisc.c head/sys/contrib/dev/acpica/components/resources/rsserial.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/tables/tbutils.c head/sys/contrib/dev/acpica/components/utilities/utdecode.c head/sys/contrib/dev/acpica/components/utilities/utownerid.c head/sys/contrib/dev/acpica/components/utilities/utresrc.c head/sys/contrib/dev/acpica/components/utilities/utxfmutex.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acopcode.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acpredef.h head/sys/contrib/dev/acpica/include/acresrc.h head/sys/contrib/dev/acpica/include/acrestyp.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actbl3.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/include/acuuid.h head/sys/contrib/dev/acpica/include/amlcode.h head/sys/contrib/dev/acpica/include/amlresrc.h head/sys/contrib/dev/acpica/include/platform/acgcc.h head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed May 31 22:41:07 2017 (r319364) +++ head/sys/conf/files Thu Jun 1 00:01:19 2017 (r319365) @@ -488,6 +488,7 @@ contrib/dev/acpica/components/utilities/utobject.c opt contrib/dev/acpica/components/utilities/utosi.c optional acpi contrib/dev/acpica/components/utilities/utownerid.c optional acpi contrib/dev/acpica/components/utilities/utpredef.c optional acpi +contrib/dev/acpica/components/utilities/utresdecode.c optional acpi acpi_debug contrib/dev/acpica/components/utilities/utresrc.c optional acpi contrib/dev/acpica/components/utilities/utstate.c optional acpi contrib/dev/acpica/components/utilities/utstring.c optional acpi Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Thu Jun 1 00:01:19 2017 (r319365) @@ -21,9 +21,10 @@ stripdirs="generate libraries parsers preprocessor tes stripfiles="Makefile README accygwin.h acdragonfly.h acdragonflyex.h \ acefi.h acefiex.h achaiku.h acintel.h aclinux.h aclinuxex.h \ acmacosx.h acmsvc.h acmsvcex.h acnetbsd.h acos2.h acqnx.h \ - acwin.h acwin64.h acwinex.h new_table.txt osbsdtbl.c osefitbl.c \ - osefixf.c osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c \ - oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c utprint.c" + acwin.h acwin64.h acwinex.h dspkginit.c new_table.txt \ + osbsdtbl.c osefitbl.c osefixf.c osfreebsdtbl.c oslinuxtbl.c \ + osunixdir.c osunixmap.c oswindir.c oswintbl.c oswinxf.c \ + readme.txt utclib.c utprint.c" # include files to canonify src_headers="acapps.h acbuffer.h acclib.h accommon.h acconfig.h \ Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/changes.txt Thu Jun 1 00:01:19 2017 (r319365) @@ -1,4 +1,134 @@ ---------------------------------------- +31 May 2017. Summary of changes for version 20170531: + + +0) ACPI 6.2 support: + +The ACPI specification version 6.2 has been released and is available at +http://uefi.org/specifications + +This version of ACPICA fully supports the ACPI 6.2 specification. Changes +are summarized below. + +New ACPI tables (Table Compiler/Disassembler/Templates): + HMAT (Heterogeneous Memory Attributes Table) + WSMT (Windows SMM Security Mitigation Table) + PPTT (Processor Properties Topology Table) + +New subtables for existing ACPI tables: + HEST (New subtable, Arch-deferred machine check) + SRAT (New subtable, Arch-specific affinity structure) + PCCT (New subtables, Extended PCC subspaces (types 3 and 4)) + +Simple updates for existing ACPI tables: + BGRT (two new flag bits) + HEST (New bit defined for several subtables, GHES_ASSIST) + +New Resource Descriptors and Resource macros (Compiler/Disassembler): + PinConfig() + PinFunction() + PinGroup() + PinGroupConfig() + PinGroupFunction() + New type for hardware error notification (section 18.3.2.9) + +New predefined names/methods (Compiler/Interpreter): + _HMA (Heterogeneous Memory Attributes) + _LSI (Label Storage Information) + _LSR (Label Storage Read) + _LSW (Label Storage Write) + +ASL grammar/macro changes (Compiler): + For() ASL macro, implemented with the AML while operator + Extensions to Concatenate operator + Support for multiple definition blocks in same ASL file + Clarification for Buffer operator + Allow executable AML code underneath all scopes (Devices, etc.) + Clarification/change for the _OSI return value + ASL grammar update for reference operators + Allow a zero-length string for AML filename in DefinitionBlock + +Miscellaneous: + New device object notification value + Remove a notify value (0x0C) for graceful shutdown + New UUIDs for processor/cache properties and + physical package property + New _HID, ACPI0014 (Wireless Power Calibration Device) + + +1) ACPICA kernel-resident subsystem: + +Added support to disable ACPI events on hardware-reduced platforms. +Eliminates error messages of the form "Could not enable fixed event". Lv +Zheng + +Fixed a problem using Device/Thermal objects with the ObjectType and +DerefOf ASL operators. This support had not been fully/properly +implemented. + +Fixed a problem where if a Buffer object containing a resource template +was longer than the actual resource template, an error was generated -- +even though the AML is legal. This case has been seen in the field. + +Fixed a problem with the header definition of the MADT PCAT_COMPAT flag. +The values for DUAL_PIC and MULTIPLE_APIC were reversed. + +Added header file changes for the TPM2 ACPI table. Update to new version +of the TCG specification. Adds a new TPM2 subtable for ARM SMC. + +Exported the external interfaces AcpiAcquireMutex and AcpiReleaseMutex. +These interfaces are intended to be used only in conjunction with the +predefined _DLM method (Device Lock Method). "This object appears in a +device scope when AML access to the device must be synchronized with the +OS environment". + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.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. + + Current Release: + Non-Debug Version: 143.1K Code, 60.0K Data, 203.1K Total + Debug Version: 204.0K Code, 84.3K Data, 288.3K Total + Previous Release: + Non-Debug Version: 141.7K Code, 58.5K Data, 200.2K Total + Debug Version: 207.5K Code, 82.7K Data, 290.2K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a problem where an External() declaration could not refer to +a Field Unit. Erik Schmauss. + +Disassembler: Improved support for the Switch/Case operators. This +feature will disassemble AML code back to the original Switch operators +when possible, instead of an If..Else sequence. David Box + +iASL and disassembler: Improved the handling of multiple extraneous +parentheses for both ASL input and disassembled ASL output. + +Improved the behavior of the iASL compiler and disassembler to detect +improper use of external declarations + +Disassembler: Now aborts immediately upon detection of an unknown AML +opcode. The AML parser has no real way to recover from this, and can +result in the creation of an ill-formed parse tree that causes errors +later during the disassembly. + +All tools: Fixed a problem where the Unix application OSL did not handle +control-c correctly. For example, a control-c could incorrectly wake the +debugger. + +AcpiExec: Improved the Control-C handling and added a handler for +segmentation faults (SIGSEGV). Supports both Windows and Unix-like +environments. + +Reduced the verbosity of the generic unix makefiles. Previously, each +compilation displayed the full set of compiler options. This has been +eliminated as the options are easily inspected within the makefiles. Each +compilation now results in a single line of output. + +---------------------------------------- 03 March 2017. Summary of changes for version 20170303: Modified: head/sys/contrib/dev/acpica/common/acfileio.c ============================================================================== --- head/sys/contrib/dev/acpica/common/acfileio.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/acfileio.c Thu Jun 1 00:01:19 2017 (r319365) @@ -531,8 +531,6 @@ AcValidateTableHeader ( if (!AcpiUtValidNameseg (TableHeader.Signature)) { - fprintf (stderr, "Invalid table signature: 0x%8.8X\n", - *ACPI_CAST_PTR (UINT32, TableHeader.Signature)); return (AE_BAD_SIGNATURE); } Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/adfile.c Thu Jun 1 00:01:19 2017 (r319365) @@ -316,11 +316,6 @@ FlGenerateFilename ( */ NewFilename = UtStringCacheCalloc ((ACPI_SIZE) strlen (InputFilename) + strlen (Suffix) + 2); - if (!NewFilename) - { - return (NULL); - } - strcpy (NewFilename, InputFilename); /* Try to find the last dot in the filename */ @@ -364,11 +359,6 @@ FlStrdup ( NewString = UtStringCacheCalloc ((ACPI_SIZE) strlen (String) + 1); - if (!NewString) - { - return (NULL); - } - strcpy (NewString, String); return (NewString); } Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/adisasm.c Thu Jun 1 00:01:19 2017 (r319365) @@ -537,7 +537,7 @@ AdDisassembleOneTable ( * the entire tree with the new information (namely, the * number of arguments per method) */ - if (AcpiDmGetExternalMethodCount ()) + if (AcpiDmGetUnresolvedExternalMethodCount ()) { Status = AdReparseOneTable (Table, File, OwnerId); if (ACPI_FAILURE (Status)) @@ -553,7 +553,7 @@ AdDisassembleOneTable ( * 1) Convert fixed-offset references to resource descriptors * to symbolic references (Note: modifies namespace) */ - AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode); + AcpiDmConvertParseObjects (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode); /* Optional displays */ @@ -616,7 +616,7 @@ AdReparseOneTable ( fprintf (stderr, "\nFound %u external control methods, " "reparsing with new information\n", - AcpiDmGetExternalMethodCount ()); + AcpiDmGetUnresolvedExternalMethodCount ()); /* Reparse, rebuild namespace */ @@ -642,7 +642,7 @@ AdReparseOneTable ( /* New namespace, add the external definitions first */ - AcpiDmAddExternalsToNamespace (); + AcpiDmAddExternalListToNamespace (); /* For -ca option: clear the list of comment addresses. */ Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/adwalk.c Thu Jun 1 00:01:19 2017 (r319365) @@ -208,11 +208,16 @@ AcpiDmInspectPossibleArgs ( ACPI_PARSE_OBJECT *Op); static ACPI_STATUS -AcpiDmResourceDescendingOp ( +AcpiDmCommonDescendingOp ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context); +static ACPI_STATUS +AcpiDmProcessResourceDescriptors ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context); /******************************************************************************* * @@ -395,21 +400,21 @@ AcpiDmCrossReferenceNamespace ( /******************************************************************************* * - * FUNCTION: AcpiDmConvertResourceIndexes + * FUNCTION: AcpiDmConvertParseObjects * * PARAMETERS: ParseTreeRoot - Root of the parse tree * NamespaceRoot - Root of the internal namespace * * RETURN: None * - * DESCRIPTION: Convert fixed-offset references to resource descriptors to - * symbolic references. Should only be called after namespace has - * been cross referenced. + * DESCRIPTION: Begin parse tree walk to perform conversions needed for + * disassembly. These include resource descriptors and switch/case + * operations. * ******************************************************************************/ void -AcpiDmConvertResourceIndexes ( +AcpiDmConvertParseObjects ( ACPI_PARSE_OBJECT *ParseTreeRoot, ACPI_NAMESPACE_NODE *NamespaceRoot) { @@ -443,9 +448,14 @@ AcpiDmConvertResourceIndexes ( Info.Level = 0; Info.WalkState = WalkState; - AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmResourceDescendingOp, + AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmCommonDescendingOp, AcpiDmCommonAscendingOp, &Info); ACPI_FREE (WalkState); + + if (AcpiGbl_TempListHead) { + AcpiDmClearTempList(); + } + return; } @@ -737,7 +747,6 @@ AcpiDmLoadDescendingOp ( WalkState = Info->WalkState; OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - ObjectType = OpInfo->ObjectType; ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); /* Only interested in operators that create new names */ @@ -754,7 +763,7 @@ AcpiDmLoadDescendingOp ( { /* For all named operators, get the new name */ - Path = (char *) Op->Named.Path; + Path = Op->Named.Path; if (!Path && Op->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP) { @@ -875,7 +884,6 @@ AcpiDmXrefDescendingOp ( WalkState = Info->WalkState; OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - ObjectType = OpInfo->ObjectType; ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); if ((!(OpInfo->Flags & AML_NAMED)) && @@ -885,26 +893,7 @@ AcpiDmXrefDescendingOp ( { goto Exit; } - else if (Op->Common.Parent && - Op->Common.Parent->Common.AmlOpcode == AML_EXTERNAL_OP) - { - /* External() NamePath */ - Path = Op->Common.Value.String; - ObjectType = (ACPI_OBJECT_TYPE) Op->Common.Next->Common.Value.Integer; - if (ObjectType == ACPI_TYPE_METHOD) - { - ParamCount = (UINT32) - Op->Common.Next->Common.Next->Common.Value.Integer; - } - - Flags |= ACPI_EXT_RESOLVED_REFERENCE | ACPI_EXT_ORIGIN_FROM_OPCODE; - AcpiDmAddOpToExternalList (Op, Path, - (UINT8) ObjectType, ParamCount, Flags); - - goto Exit; - } - /* Get the NamePath from the appropriate place */ if (OpInfo->Flags & AML_NAMED) @@ -924,9 +913,10 @@ AcpiDmXrefDescendingOp ( Path = NextOp->Common.Value.String; } } - else if (Op->Common.AmlOpcode == AML_SCOPE_OP) + else if (Op->Common.AmlOpcode == AML_SCOPE_OP || + Op->Common.AmlOpcode == AML_EXTERNAL_OP) { - Path = (char *) Op->Named.Path; + Path = Op->Named.Path; } } else if (OpInfo->Flags & AML_CREATE) @@ -1060,21 +1050,59 @@ Exit: return (AE_OK); } +/******************************************************************************* + * + * FUNCTION: AcpiDmCommonDescendingOp + * + * PARAMETERS: ASL_WALK_CALLBACK + * + * RETURN: ACPI_STATUS + * + * DESCRIPTION: Perform parse tree preprocessing before main disassembly walk. + * + ******************************************************************************/ +static ACPI_STATUS +AcpiDmCommonDescendingOp ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context) +{ + ACPI_STATUS Status; + + /* Resource descriptor conversion */ + + Status = AcpiDmProcessResourceDescriptors (Op, Level, Context); + + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Switch/Case conversion */ + + Status = AcpiDmProcessSwitch (Op); + + return (AE_OK); +} + + /******************************************************************************* * - * FUNCTION: AcpiDmResourceDescendingOp + * FUNCTION: AcpiDmProcessResourceDescriptors * * PARAMETERS: ASL_WALK_CALLBACK * - * RETURN: None + * RETURN: ACPI_STATUS * - * DESCRIPTION: Process one parse op during symbolic resource index conversion. + * DESCRIPTION: Convert fixed-offset references to resource descriptors to + * symbolic references. Should only be called after namespace has + * been cross referenced. * ******************************************************************************/ static ACPI_STATUS -AcpiDmResourceDescendingOp ( +AcpiDmProcessResourceDescriptors ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context) @@ -1085,7 +1113,6 @@ AcpiDmResourceDescendingOp ( ACPI_OBJECT_TYPE ObjectType; ACPI_STATUS Status; - WalkState = Info->WalkState; OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); @@ -1111,10 +1138,10 @@ AcpiDmResourceDescendingOp ( * If so, convert the reference into a symbolic reference. */ AcpiDmCheckResourceReference (Op, WalkState); + return (AE_OK); } - /******************************************************************************* * * FUNCTION: AcpiDmCommonAscendingOp @@ -1135,14 +1162,11 @@ AcpiDmCommonAscendingOp ( void *Context) { ACPI_OP_WALK_INFO *Info = Context; - const ACPI_OPCODE_INFO *OpInfo; ACPI_OBJECT_TYPE ObjectType; /* Close scope if necessary */ - OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - ObjectType = OpInfo->ObjectType; ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); if (AcpiNsOpensScope (ObjectType)) @@ -1152,7 +1176,6 @@ AcpiDmCommonAscendingOp ( return (AE_OK); } - /******************************************************************************* * Modified: head/sys/contrib/dev/acpica/common/ahids.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahids.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/ahids.c Thu Jun 1 00:01:19 2017 (r319365) @@ -187,6 +187,7 @@ const AH_DEVICE_ID AslDeviceIds[] = {"ACPI0011", "Generic Buttons Device"}, {"ACPI0012", "NVDIMM Root Device"}, {"ACPI0013", "Generic Event Device"}, + {"ACPI0014", "Wireless Power Calibration Device"}, {"ADMA0F28", "Intel Audio DMA"}, {"AMCR0F28", "Intel Audio Machine Driver"}, {"ATK4001", "Asus Radio Control Button"}, Modified: head/sys/contrib/dev/acpica/common/ahpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahpredef.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/ahpredef.c Thu Jun 1 00:01:19 2017 (r319365) @@ -254,6 +254,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_FPS", "Fan Performance States", "Returns a list of supported fan performance states"), AH_PREDEF ("_FSL", "Fan Set Level", "Control method that sets the fan device's speed level (performance state)"), AH_PREDEF ("_FST", "Fan Status", "Returns current status information for a fan device"), + AH_PREDEF ("_FUN", "Function Number", "Resource descriptor field"), AH_PREDEF ("_GAI", "Get Averaging Interval", "Returns the power meter averaging interval"), AH_PREDEF ("_GCP", "Get Capabilities", "Get device time capabilities"), AH_PREDEF ("_GHL", "Get Hardware Limit", "Returns the hardware limit enforced by the power meter"), @@ -270,6 +271,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_GWS", "Get Wake Status", "Return status of wake alarms"), AH_PREDEF ("_HE_", "High-Edge", "Interrupt triggering, Resource Descriptor field"), AH_PREDEF ("_HID", "Hardware ID", "Returns a device's Plug and Play Hardware ID"), + AH_PREDEF ("_HMA", "Heterogeneous Memory Attributes", "Returns a list of HMAT structures."), AH_PREDEF ("_HOT", "Hot Temperature", "Returns the critical temperature for sleep (entry to S4)"), AH_PREDEF ("_HPP", "Hot Plug Parameters", "Returns a list of hot-plug information for a PCI device"), AH_PREDEF ("_HPX", "Hot Plug Parameter Extensions", "Returns a list of hot-plug information for a PCI device. Supersedes _HPP"), @@ -287,6 +289,9 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_LL_", "Low Level", "Interrupt polarity, Resource Descriptor field"), AH_PREDEF ("_LPD", "Low Power Dependencies", "Returns a list of dependencies for low power idle entry"), AH_PREDEF ("_LPI", "Low Power Idle States", "Returns a list of supported low power idle states"), + AH_PREDEF ("_LSI", "Label Storage Information", "Returns information about the Label Storage Area associated with the NVDIMM object."), + AH_PREDEF ("_LSR", "Label Storage Read", "Returns label data from the Label Storage Area of the NVDIMM object."), + AH_PREDEF ("_LSW", "Label Storage Write", "Writes label data in to the Label Storage Area of the NVDIMM object."), AH_PREDEF ("_MAF", "Maximum Address Fixed", "Resource Descriptor field"), AH_PREDEF ("_MAT", "Multiple APIC Table Entry", "Returns a list of MADT APIC structure entries"), AH_PREDEF ("_MAX", "Maximum Base Address", "Resource Descriptor field"), @@ -439,6 +444,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_UPC", "USB Port Capabilities", "Returns a list of USB port capabilities"), AH_PREDEF ("_UPD", "User Presence Detect", "Returns user detection information"), AH_PREDEF ("_UPP", "User Presence Polling", "Returns the recommended user presence polling interval"), + AH_PREDEF ("_VAL", "Pin Configuration Value", "Resource Descriptor field"), AH_PREDEF ("_VEN", "Vendor Data", "Resource Descriptor field"), AH_PREDEF ("_VPO", "Video Post Options", "Returns the implemented video post options"), AH_PREDEF ("_Wxx", "Wake Event", "Method executed as a result of a wake event"), Modified: head/sys/contrib/dev/acpica/common/ahtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahtable.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/ahtable.c Thu Jun 1 00:01:19 2017 (r319365) @@ -218,6 +218,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_FPDT, "Firmware Performance Data Table"}, {ACPI_SIG_GTDT, "Generic Timer Description Table"}, {ACPI_SIG_HEST, "Hardware Error Source Table"}, + {ACPI_SIG_HMAT, "Heterogeneous Memory Attributes Table"}, {ACPI_SIG_HPET, "High Precision Event Timer table"}, {ACPI_SIG_IORT, "IO Remapping Table"}, {ACPI_SIG_IVRS, "I/O Virtualization Reporting Structure"}, @@ -232,6 +233,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_NFIT, "NVDIMM Firmware Interface Table"}, {ACPI_SIG_PCCT, "Platform Communications Channel Table"}, {ACPI_SIG_PMTT, "Platform Memory Topology Table"}, + {ACPI_SIG_PPTT, "Processor Properties Topology Table"}, {ACPI_SIG_RASF, "RAS Features Table"}, {ACPI_RSDP_NAME,"Root System Description Pointer"}, {ACPI_SIG_RSDT, "Root System Description Table"}, @@ -253,6 +255,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_WDDT, "Watchdog Description Table"}, {ACPI_SIG_WDRT, "Watchdog Resource Table"}, {ACPI_SIG_WPBT, "Windows Platform Binary Table"}, + {ACPI_SIG_WSMT, "Windows SMM Security Migrations Table"}, {ACPI_SIG_XENV, "Xen Environment table"}, {ACPI_SIG_XSDT, "Extended System Description Table"}, {NULL, NULL} Modified: head/sys/contrib/dev/acpica/common/ahuuids.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahuuids.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/ahuuids.c Thu Jun 1 00:01:19 2017 (r319365) @@ -186,6 +186,10 @@ const AH_UUID Gbl_AcpiUuids[] = {"Persistent Virtual Disk", UUID_PERSISTENT_VIRTUAL_DISK}, {"Persistent Virtual CD", UUID_PERSISTENT_VIRTUAL_CD}, + {"[Processor Properties]", NULL}, + {"Cache Properties", UUID_CACHE_PROPERTIES}, + {"Physical Package Property", UUID_PHYSICAL_PROPERTY}, + {"[Miscellaneous]", NULL}, {"Platform-wide Capabilities", UUID_PLATFORM_CAPABILITIES}, {"Dynamic Enumeration", UUID_DYNAMIC_ENUMERATION}, Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Wed May 31 22:41:07 2017 (r319364) +++ head/sys/contrib/dev/acpica/common/dmextern.c Thu Jun 1 00:01:19 2017 (r319365) @@ -199,7 +199,10 @@ static const char *AcpiGbl_DmTypeNames[] = #define METHOD_SEPARATORS " \t,()\n" +static const char *ExternalConflictMessage = + " // Conflicts with a later declaration"; + /* Local prototypes */ static const char * @@ -211,6 +214,16 @@ AcpiDmNormalizeParentPrefix ( ACPI_PARSE_OBJECT *Op, char *Path); +static ACPI_STATUS +AcpiDmGetExternalAndInternalPath ( + ACPI_NAMESPACE_NODE *Node, + char **ExternalPath, + char **InternalPath); + +static ACPI_STATUS +AcpiDmRemoveRootPrefix ( + char **Path); + static void AcpiDmAddPathToExternalList ( char *Path, @@ -226,7 +239,22 @@ AcpiDmCreateNewExternal ( UINT32 Value, UINT16 Flags); +static void +AcpiDmCheckForExternalConflict ( + char *Path); +static ACPI_STATUS +AcpiDmResolveExternal ( + char *Path, + UINT8 Type, + ACPI_NAMESPACE_NODE **Node); + + +static void +AcpiDmConflictingDeclaration ( + char *Path); + + /******************************************************************************* * * FUNCTION: AcpiDmGetObjectTypeName @@ -582,7 +610,7 @@ AcpiDmGetExternalsFromFile ( { /* Add the external(s) to the namespace */ - AcpiDmAddExternalsToNamespace (); + AcpiDmAddExternalListToNamespace (); AcpiOsPrintf ("%s: Imported %u external method definitions\n", Gbl_ExternalRefFilename, ImportCount); @@ -698,6 +726,86 @@ AcpiDmAddOpToExternalList ( /******************************************************************************* * + * FUNCTION: AcpiDmGetExternalAndInternalPath + * + * PARAMETERS: Node - Namespace node for object to be added + * ExternalPath - Will contain the external path of the node + * InternalPath - Will contain the internal path of the node + * + * RETURN: None + * + * DESCRIPTION: Get the External and Internal path from the given node. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDmGetExternalAndInternalPath ( + ACPI_NAMESPACE_NODE *Node, + char **ExternalPath, + char **InternalPath) +{ + ACPI_STATUS Status; + + + if (!Node) + { + return (AE_BAD_PARAMETER); + } + + /* Get the full external and internal pathnames to the node */ + + *ExternalPath = AcpiNsGetExternalPathname (Node); + if (!*ExternalPath) + { + return (AE_BAD_PATHNAME); + } + + Status = AcpiNsInternalizeName (*ExternalPath, InternalPath); + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (*ExternalPath); + return (Status); + } + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmRemoveRootPrefix + * + * PARAMETERS: Path - Remove Root prefix from this Path + * + * RETURN: None + * + * DESCRIPTION: Remove the root prefix character '\' from Path. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDmRemoveRootPrefix ( + char **Path) +{ + char *InputPath = *Path; + + + if ((*InputPath == AML_ROOT_PREFIX) && (InputPath[1])) + { + if (!memmove(InputPath, InputPath+1, strlen(InputPath))) + { + return (AE_ERROR); + } + + *Path = InputPath; + } + + return (AE_OK); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmAddNodeToExternalList * * PARAMETERS: Node - Namespace node for object to be added @@ -727,46 +835,27 @@ AcpiDmAddNodeToExternalList ( { char *ExternalPath; char *InternalPath; - char *Temp; ACPI_STATUS Status; ACPI_FUNCTION_TRACE (DmAddNodeToExternalList); - - if (!Node) - { - return_VOID; - } - /* Get the full external and internal pathnames to the node */ - ExternalPath = AcpiNsGetExternalPathname (Node); - if (!ExternalPath) - { - return_VOID; - } - - Status = AcpiNsInternalizeName (ExternalPath, &InternalPath); + Status = AcpiDmGetExternalAndInternalPath (Node, &ExternalPath, &InternalPath); if (ACPI_FAILURE (Status)) { - ACPI_FREE (ExternalPath); return_VOID; } /* Remove the root backslash */ - if ((*ExternalPath == AML_ROOT_PREFIX) && (ExternalPath[1])) + Status = AcpiDmRemoveRootPrefix (&ExternalPath); + if (ACPI_FAILURE (Status)) { - Temp = ACPI_ALLOCATE_ZEROED (strlen (ExternalPath) + 1); - if (!Temp) - { - return_VOID; - } - - strcpy (Temp, &ExternalPath[1]); ACPI_FREE (ExternalPath); - ExternalPath = Temp; + ACPI_FREE (InternalPath); + return_VOID; } /* Create the new External() declaration node */ @@ -1013,68 +1102,171 @@ AcpiDmCreateNewExternal ( /******************************************************************************* * - * FUNCTION: AcpiDmAddExternalsToNamespace + * FUNCTION: AcpiDmResolveExternal * - * PARAMETERS: None + * PARAMETERS: Path - Path of the external + * Type - Type of the external + * Node - Input node for AcpiNsLookup * + * RETURN: Status + * + * DESCRIPTION: Resolve the external within the namespace by AcpiNsLookup. + * If the returned node is an external and has the same type + * we assume that it was either an existing external or a + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDmResolveExternal ( + char *Path, + UINT8 Type, + ACPI_NAMESPACE_NODE **Node) +{ + ACPI_STATUS Status; + + + Status = AcpiNsLookup (NULL, Path, Type, + ACPI_IMODE_LOAD_PASS1, + ACPI_NS_ERROR_IF_FOUND | ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, + NULL, Node); + + if (!Node) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "while adding external to namespace [%s]", Path)); + } + + /* Note the asl code "external(a) external(a)" is acceptable ASL */ + + else if ((*Node)->Type == Type && + (*Node)->Flags & ANOBJ_IS_EXTERNAL) + { + return (AE_OK); + } + else + { + ACPI_EXCEPTION ((AE_INFO, AE_ERROR, + "[%s] has conflicting declarations", Path)); + } + + return (AE_ERROR); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmCreateSubobjectForExternal + * + * PARAMETERS: Type - Type of the external + * Node - Namespace node from AcpiNsLookup + * ParamCount - Value to be used for Method + * * RETURN: None * - * DESCRIPTION: Add all externals to the namespace. Allows externals to be + * DESCRIPTION: Add one external to the namespace. Allows external to be * "resolved". * ******************************************************************************/ void -AcpiDmAddExternalsToNamespace ( - void) +AcpiDmCreateSubobjectForExternal ( + UINT8 Type, + ACPI_NAMESPACE_NODE **Node, + UINT32 ParamCount) { - ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *Node; ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; - while (External) + switch (Type) { - /* Add the external name (object) into the namespace */ + case ACPI_TYPE_METHOD: - Status = AcpiNsLookup (NULL, External->InternalPath, External->Type, - ACPI_IMODE_LOAD_PASS1, - ACPI_NS_ERROR_IF_FOUND | ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, - NULL, &Node); + /* For methods, we need to save the argument count */ - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, - "while adding external to namespace [%s]", - External->Path)); - } + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); + ObjDesc->Method.ParamCount = (UINT8) ParamCount; + (*Node)->Object = ObjDesc; + break; - else switch (External->Type) - { - case ACPI_TYPE_METHOD: + case ACPI_TYPE_REGION: - /* For methods, we need to save the argument count */ + /* Regions require a region sub-object */ - ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); - ObjDesc->Method.ParamCount = (UINT8) External->Value; - Node->Object = ObjDesc; - break; + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION); + ObjDesc->Region.Node = *Node; + (*Node)->Object = ObjDesc; + break; - case ACPI_TYPE_REGION: + default: - /* Regions require a region sub-object */ + break; + } +} - ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION); - ObjDesc->Region.Node = Node; - Node->Object = ObjDesc; - break; - default: +/******************************************************************************* + * + * FUNCTION: AcpiDmAddOneExternalToNamespace + * + * PARAMETERS: Path - External parse object + * Type - Type of parse object + * ParamCount - External method parameter count + * + * RETURN: None + * + * DESCRIPTION: Add one external to the namespace by resolvign the external + * (by performing a namespace lookup) and annotating the resulting + * namespace node with the approperiate information if the type + * is ACPI_TYPE_REGION or ACPI_TYPE_METHOD. + * + ******************************************************************************/ - break; - } +void +AcpiDmAddOneExternalToNamespace ( + char *Path, + UINT8 Type, + UINT32 ParamCount) +{ + ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *Node; + + Status = AcpiDmResolveExternal (Path, Type, &Node); + + if (ACPI_FAILURE (Status)) + { + return; + } + + AcpiDmCreateSubobjectForExternal (Type, &Node, ParamCount); + +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmAddExternalListToNamespace + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Add all externals within AcpiGbl_ExternalList to the namespace. + * Allows externals to be "resolved". + * + ******************************************************************************/ + +void +AcpiDmAddExternalListToNamespace ( + void) +{ + ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; + + + while (External) + { + AcpiDmAddOneExternalToNamespace (External->InternalPath, + External->Type, External->Value); External = External->Next; } } @@ -1082,23 +1274,28 @@ AcpiDmAddExternalsToNamespace ( /******************************************************************************* * - * FUNCTION: AcpiDmGetExternalMethodCount + * FUNCTION: AcpiDmGetUnresolvedExternalMethodCount * * PARAMETERS: None * - * RETURN: The number of control method externals in the external list + * RETURN: The number of unresolved control method externals in the + * external list * - * DESCRIPTION: Return the number of method externals that have been generated. - * If any control method externals have been found, we must - * re-parse the entire definition block with the new information - * (number of arguments for the methods.) This is limitation of - * AML, we don't know the number of arguments from the control - * method invocation itself. + * DESCRIPTION: Return the number of unresolved external methods that have been + * generated. If any unresolved control method externals have been + * found, we must re-parse the entire definition block with the new + * information (number of arguments for the methods.) + * This is limitation of AML, we don't know the number of arguments + * from the control method invocation itself. * + * Note: resolved external control methods are external control + * methods encoded with the AML_EXTERNAL_OP bytecode within the + * AML being disassembled. + * ******************************************************************************/ *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***