diff --git a/sys/contrib/dev/acpica/changes.txt b/sys/contrib/dev/acpica/changes.txt index 3c60c27d366b..e7cc572a0cc3 100644 --- a/sys/contrib/dev/acpica/changes.txt +++ b/sys/contrib/dev/acpica/changes.txt @@ -1,6 +1,94 @@ ---------------------------------------- +13 November 2020. Summary of changes for version 20201113: + +This release is available at https://acpica.org/downloads + + +1) ACPICA kernel-resident subsystem: + +Interpreter: fixed a memory leak by using use existing buffer in _HID +repair. There was a memory leak that occurred when a _CID object is +defined as a package containing string objects. When _CID is checked for +any possible repairs, it calls a helper function to repair _HID (because +_CID basically contains multiple _HID entries). The _HID repair function +assumes that string objects are standalone objects that are not contained +inside of any packages. The _HID repair function replaced the string +object with a brand new object and attempted to delete the old object by +decrementing the reference count of the old object. Strings inside of +packages have a reference count of 2 so the _HID repair function leaves +this object in a dangling state and causes a memory leak. Instead of +allocating a brand new object and removing the old object, use the +existing object when repairing the _HID object. + +Added function trace macros to improve namespace debugging. The namespace +repair mechanism does not have function tracing macros. Add several trace +macros to improve debuggability. + +Handle "orphan" _REG methods for GPIO OpRegions. Before this change +AcpiEvExecuteRegMethods() had special handling to handle "orphan" (no +matching OpRegion declared) _REG methods for EC nodes. On Intel Cherry +Trail devices there are 2 possible ACPI OpRegions for accessing GPIOs. +The standard GeneralPurposeIo OpRegion and the Cherry Trail - specific +UserDefined 0x9X OpRegions. Having 2 different types of OpRegions leads +to potential issues with checks for OpRegion availability, or in other +words checks if _REG has been called for the OpRegion which the ACPI code +wants to use. Except for the "orphan" EC handling, ACPICA core does not +call _REG on an ACPI node which does not define an OpRegion matching the +type being registered; and the reference design DSDT, from which most +Cherry Trail DSDTs are derived, does not define GeneralPurposeIo, nor +UserDefined(0x93) OpRegions for the GPO2 (UID 3) device, because no pins +were assigned ACPI controlled functions in the reference design. Together +this leads to the perfect storm, at least on the Cherry Trail based +Medion Akayo E1239T. This design does use a GPO2 pin from its ACPI code +and has added the Cherry Trail specific UserDefined(0x93) opregion to its +GPO2 ACPI node to access this pin. But it uses a "has _REG been called" +availability check for the standard GeneralPurposeIo OpRegion. This +clearly is a bug in the DSDT, but this does work under Windows. This +issue leads to the intel vbtn driver reporting the device always being in +tablet-mode at boot, even if it is in laptop mode. Which in turn causes +userspace to ignore touchpad events. So in other words, this issue causes +the touchpad to not work at boot. This change fixes this by extending the +"orphan" _REG method handling to also apply to GPIO address-space +handlers. + + +2) iASL Compiler/Disassembler and ACPICA tools: + +iASL: Added more info to namespace dump file (-ln option). In a separate +section of the dump file (after the main namespace dump), emit the full +pathname for each namespace node, its type, and the ASL filename and line +number where it is declared. + +AcpiHelp: Added an option to display/decode iASL exceptions. Option is: - +x [Hex Value] where "Hex Value" is the iASL exception code. If Hex Value +is omitted, all iASL exceptions are displayed. + +iASL: Use StringLiteral instead of StringData for some ASL macros. The +use of the stringData rule allows for some "string" oriented opcodes +(Such as ToString, ToHexString, etc.) None of which make sense with the +macros in question. This change modifies the StringData part of the rule +for these macros to a simple string literal - thus disallowing the use +of ToString, ToHexString, etc. +The following ASL operators (macros) are affected: +EisaId +Fprintf +Printf +ToUuid +Unicode +Note: The MS compiler requires the use of string literals for these +operators also. + +iASL: Added a remark for an unknown UUID: ASL_MSG_UUID_NOT_FOUND. Search +the list of "known" UUIDs for the input to the ToUUID macro. + +Added 5 new UUIDs to the known UUID table. All related to NVDIMM and the +NFIT table. + + +---------------------------------------- + 25 September 2020. Summary of changes for version 20200925: This release is available at https://acpica.org/downloads @@ -41,7 +129,7 @@ names: _SBT _SBW -AML Disassembler: Added a new command, "All ". This command will evaluate all objects in the current namespace whose NameString contains the input NameSeg as the last element of the NameString. Useful for debugging. @@ -55,6 +143,11 @@ with lengths that exceed the initializer list. iASL: added more detail to external resolution error message when compiling multiple definition blocks. +iASL: added a remark for an attempt to create a nameseg or namestring +containing lower-case letters. This should prevent declaring multiple +namesegs or namestrings in an attempt to refer to different objects (with +different cases), but actually refer to the same object(s). + iASL: improve alias analysis by saving object type. If the alias is a method type, the parameter count is also recorded. @@ -3702,7 +3795,7 @@ iASL compiler, all ACPICA utilities, and the test suites. Events: Introduce ACPI_GPE_DISPATCH_RAW_HANDLER to fix GPE storm issues. A raw gpe handling mechanism was created to allow better handling of GPE storms that aren't easily managed by the normal handler. The raw handler -allows disabling/renabling of the the GPE so that interrupt storms can be +allows disabling/renabling of the GPE so that interrupt storms can be avoided in cases where events cannot be timely serviced. In this scenario, handlers should use the AcpiSetGpe() API to disable/enable the GPE. This API will leave the reference counts undisturbed, thereby diff --git a/sys/contrib/dev/acpica/common/ahuuids.c b/sys/contrib/dev/acpica/common/ahuuids.c index 2a7455cd2391..19c881c964fa 100644 --- a/sys/contrib/dev/acpica/common/ahuuids.c +++ b/sys/contrib/dev/acpica/common/ahuuids.c @@ -181,6 +181,7 @@ const AH_UUID Gbl_AcpiUuids[] = {"Physical Presence Interface", UUID_PHYSICAL_PRESENCE}, {"[Non-volatile DIMM and NFIT table]", NULL}, + {"NVDIMM Device", UUID_NFIT_DIMM}, {"Volatile Memory Region", UUID_VOLATILE_MEMORY}, {"Persistent Memory Region", UUID_PERSISTENT_MEMORY}, {"NVDIMM Control Region", UUID_CONTROL_REGION}, @@ -189,6 +190,10 @@ const AH_UUID Gbl_AcpiUuids[] = {"Volatile Virtual CD", UUID_VOLATILE_VIRTUAL_CD}, {"Persistent Virtual Disk", UUID_PERSISTENT_VIRTUAL_DISK}, {"Persistent Virtual CD", UUID_PERSISTENT_VIRTUAL_CD}, + {"Microsoft NVDIMM Command set",UUID_NFIT_DIMM_N_MSFT}, + {"HP NDIMM HPE1", UUID_NFIT_DIMM_N_HPE1}, + {"HP NDIMM HPE2", UUID_NFIT_DIMM_N_HPE2}, + {"Virtual NVDIMM", UUID_NFIT_DIMM_N_HYPERV}, {"[Processor Properties]", NULL}, {"Cache Properties", UUID_CACHE_PROPERTIES}, diff --git a/sys/contrib/dev/acpica/compiler/aslbtypes.c b/sys/contrib/dev/acpica/compiler/aslbtypes.c index 8d364de9728c..03a4794448c5 100644 --- a/sys/contrib/dev/acpica/compiler/aslbtypes.c +++ b/sys/contrib/dev/acpica/compiler/aslbtypes.c @@ -672,7 +672,7 @@ AnMapObjTypeToBtype ( * * PARAMETERS: Btype - Bitfield of ACPI types * - * RETURN: The Etype corresponding the the Btype + * RETURN: The Etype corresponding the Btype * * DESCRIPTION: Convert a bitfield type to an encoded type * diff --git a/sys/contrib/dev/acpica/compiler/aslcodegen.c b/sys/contrib/dev/acpica/compiler/aslcodegen.c index 9a3b755414ed..6ea0d70803d5 100644 --- a/sys/contrib/dev/acpica/compiler/aslcodegen.c +++ b/sys/contrib/dev/acpica/compiler/aslcodegen.c @@ -700,7 +700,7 @@ CgUpdateHeader ( Checksum = (UINT8) (0 - Sum); - /* Re-write the the checksum byte */ + /* Re-write the checksum byte */ FlSeekFile (ASL_FILE_AML_OUTPUT, Op->Asl.FinalAmlOffset + ACPI_OFFSET (ACPI_TABLE_HEADER, Checksum)); diff --git a/sys/contrib/dev/acpica/compiler/aslmap.c b/sys/contrib/dev/acpica/compiler/aslmap.c index 8593be667c5d..682fc778fc1d 100644 --- a/sys/contrib/dev/acpica/compiler/aslmap.c +++ b/sys/contrib/dev/acpica/compiler/aslmap.c @@ -538,7 +538,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* TYPE_TRANSLATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* UART_SERIALBUS */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* UART_SERIALBUSV2 */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), -/* UNICODE */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, OP_AML_PACKAGE, 0), +/* UNICODE */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_BUFFER), /* UNLOAD */ OP_TABLE_ENTRY (AML_UNLOAD_OP, 0, 0, 0), /* UPDATERULE_ONES */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_UPDATE_WRITE_AS_ONES, 0, 0), /* UPDATERULE_PRESERVE */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_UPDATE_PRESERVE, 0, 0), diff --git a/sys/contrib/dev/acpica/compiler/aslmessages.c b/sys/contrib/dev/acpica/compiler/aslmessages.c index 1c0eec06bea6..0233d2ec4995 100644 --- a/sys/contrib/dev/acpica/compiler/aslmessages.c +++ b/sys/contrib/dev/acpica/compiler/aslmessages.c @@ -384,6 +384,7 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_EXTERNAL_FOUND_HERE */ "External declaration below ", /* ASL_MSG_LOWER_CASE_NAMESEG */ "At least one lower case letter found in NameSeg, ASL is case insensitive - converting to upper case", /* ASL_MSG_LOWER_CASE_NAMEPATH */ "At least one lower case letter found in NamePath, ASL is case insensitive - converting to upper case", +/* ASL_MSG_UUID_NOT_FOUND */ "Unknown UUID string" }; /* Table compiler */ @@ -457,7 +458,7 @@ AeDecodeMessageId ( if (Index >= ACPI_ARRAY_LENGTH (AslCompilerMsgs)) { - return ("[Unknown ASL Compiler exception ID]"); + return ("[Unknown iASL Compiler exception ID]"); } } @@ -470,7 +471,7 @@ AeDecodeMessageId ( if (Index >= ACPI_ARRAY_LENGTH (AslTableCompilerMsgs)) { - return ("[Unknown Table Compiler exception ID]"); + return ("[Unknown iASL Table Compiler exception ID]"); } } @@ -483,7 +484,7 @@ AeDecodeMessageId ( if (Index >= ACPI_ARRAY_LENGTH (AslPreprocessorMsgs)) { - return ("[Unknown Preprocessor exception ID]"); + return ("[Unknown iASL Preprocessor exception ID]"); } } @@ -491,7 +492,7 @@ AeDecodeMessageId ( else { - return ("[Unknown exception/component ID]"); + return ("[Unknown iASL exception ID]"); } return (MessageTable[Index]); @@ -559,3 +560,79 @@ AeBuildFullExceptionCode ( */ return (((Level + 1) * 1000) + MessageId); } + + +#ifdef ACPI_HELP_APP +/******************************************************************************* + * + * FUNCTION: AhDecodeAslException + * + * PARAMETERS: HexString - iASL status string from command line, in + * hex. If null, display all exceptions. + * + * RETURN: None + * + * DESCRIPTION: Decode and display an iASL exception code. Note1: a + * NULL string for HexString displays all known iASL exceptions. Note2: + * implements the -x option for AcpiHelp. + * + ******************************************************************************/ + +#define AH_DISPLAY_ASL_EXCEPTION_TEXT(Status, Exception) \ + printf ("%.4X: %s\n", Status, Exception) + +#define AH_DISPLAY_EXCEPTION(Status, Name) \ + printf ("%.4X: %s\n", Status, Name) + + +void +AhDecodeAslException ( + char *HexString) +{ + UINT32 i; + UINT32 MessageId; + const char *OneException; + UINT32 Index = 1; + + + /* + * A null input string means to decode and display all known + * exception codes. + */ + if (!HexString) + { + printf ("All defined iASL exception codes:\n\n"); + printf ("Main iASL exceptions:\n\n"); + AH_DISPLAY_EXCEPTION (0, + "AE_OK (No error occurred)"); + + /* Display codes in each block of exception types */ + + for (i = 1; Index < ACPI_ARRAY_LENGTH (AslCompilerMsgs); i++, Index++) + { + AH_DISPLAY_ASL_EXCEPTION_TEXT (Index, AslCompilerMsgs[i]); + } + + printf ("\niASL Table Compiler exceptions:\n\n"); + Index = ASL_MSG_TABLE_COMPILER; + for (i = 0; i < ACPI_ARRAY_LENGTH (AslTableCompilerMsgs); i++, Index++) + { + AH_DISPLAY_ASL_EXCEPTION_TEXT (Index, AslTableCompilerMsgs[i]); + } + + printf ("\niASL Preprocessor exceptions:\n\n"); + Index = ASL_MSG_PREPROCESSOR; + for (i = 0; i < ACPI_ARRAY_LENGTH (AslPreprocessorMsgs); i++, Index++) + { + AH_DISPLAY_ASL_EXCEPTION_TEXT (Index, AslPreprocessorMsgs[i]); + } + return; + } + + /* HexString is valid - convert it to a MessageId and decode it */ + + MessageId = strtol (HexString, NULL, 16); + OneException = AeDecodeMessageId ((UINT16) MessageId); + AH_DISPLAY_ASL_EXCEPTION_TEXT (MessageId, OneException); +} +#endif diff --git a/sys/contrib/dev/acpica/compiler/aslmessages.h b/sys/contrib/dev/acpica/compiler/aslmessages.h index 8a2b5c6c7da7..2313d212a4ef 100644 --- a/sys/contrib/dev/acpica/compiler/aslmessages.h +++ b/sys/contrib/dev/acpica/compiler/aslmessages.h @@ -152,7 +152,6 @@ #ifndef __ASLMESSAGES_H #define __ASLMESSAGES_H - /* These values must match error type string tables in aslmessages.c */ typedef enum @@ -167,9 +166,12 @@ typedef enum } ASL_MESSAGE_TYPES; - #define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings for types above */ +void +AhDecodeAslException ( + char *HexString); + /* * Exception code blocks, 0 - 999 * Available for new exception blocks: 600 - 999 @@ -386,6 +388,7 @@ typedef enum ASL_MSG_EXTERNAL_FOUND_HERE, ASL_MSG_LOWER_CASE_NAMESEG, ASL_MSG_LOWER_CASE_NAMEPATH, + ASL_MSG_UUID_NOT_FOUND, /* These messages are used by the Data Table compiler only */ diff --git a/sys/contrib/dev/acpica/compiler/aslnamesp.c b/sys/contrib/dev/acpica/compiler/aslnamesp.c index a35cb2dadee7..32fcfeab2ee8 100644 --- a/sys/contrib/dev/acpica/compiler/aslnamesp.c +++ b/sys/contrib/dev/acpica/compiler/aslnamesp.c @@ -226,8 +226,8 @@ NsDisplayNamespace ( /* File header */ - FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "Contents of ACPI Namespace\n\n"); - FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "Count Depth Name - Type\n\n"); + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "Contents of ACPI Namespace\n\n" + "Count Depth Name - Type\n\n"); /* Walk entire namespace from the root */ @@ -239,14 +239,21 @@ NsDisplayNamespace ( return (Status); } - /* Print the full pathname for each namespace node */ + /* Print the full pathname for each namespace node in the common namespace */ - FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\nNamespace pathnames\n\n"); + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, + "\nNamespace pathnames and where declared:\n" + "\n\n"); Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, FALSE, NsDoOnePathname, NULL, NULL, NULL); + /* + * We just dumped the entire common namespace, we don't want to do it + * again for other input files. + */ + AslGbl_NsOutputFlag = FALSE; return (Status); } @@ -512,7 +519,7 @@ NsDoOneNamespaceObject ( * * RETURN: Status * - * DESCRIPTION: Print the full pathname for a namespace node. + * DESCRIPTION: Print the full pathname and addtional info for a namespace node. * ******************************************************************************/ @@ -528,6 +535,13 @@ NsDoOnePathname ( ACPI_BUFFER TargetPath; + /* Ignore predefined namespace nodes and External declarations */ + + if (!Node->Op || (Node->Flags & ANOBJ_IS_EXTERNAL)) + { + return (AE_OK); + } + TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER; Status = AcpiNsHandleToPathname (Node, &TargetPath, FALSE); if (ACPI_FAILURE (Status)) @@ -535,8 +549,15 @@ NsDoOnePathname ( return (Status); } - FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%s\n", - ACPI_CAST_PTR (char, TargetPath.Pointer)); + /* + * Print the full pathname (and other information) + * for each namespace node in the common namespace + */ + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%-41s %-12s %s, %u\n", + ACPI_CAST_PTR (char, TargetPath.Pointer), + AcpiUtGetTypeName (Node->Type), + Node->Op->Asl.Filename, Node->Op->Asl.LogicalLineNumber); + ACPI_FREE (TargetPath.Pointer); return (AE_OK); } diff --git a/sys/contrib/dev/acpica/compiler/aslopcodes.c b/sys/contrib/dev/acpica/compiler/aslopcodes.c index 4c4ab86326b8..712b24cfe3f5 100644 --- a/sys/contrib/dev/acpica/compiler/aslopcodes.c +++ b/sys/contrib/dev/acpica/compiler/aslopcodes.c @@ -798,7 +798,13 @@ OpcDoUuId ( } else { + /* Convert UUID string to a buffer, check for a known UUID */ + AcpiUtConvertStringToUuid (InString, Buffer); + if (!AcpiAhMatchUuid (Buffer)) + { + AslError (ASL_REMARK, ASL_MSG_UUID_NOT_FOUND, Op, NULL); + } } /* Change Op to a Buffer */ diff --git a/sys/contrib/dev/acpica/compiler/aslprimaries.y b/sys/contrib/dev/acpica/compiler/aslprimaries.y index 1fb9e501dddd..68fdbe840de9 100644 --- a/sys/contrib/dev/acpica/compiler/aslprimaries.y +++ b/sys/contrib/dev/acpica/compiler/aslprimaries.y @@ -500,7 +500,7 @@ DivideTerm EISAIDTerm : PARSEOP_EISAID PARSEOP_OPEN_PAREN - StringData + StringLiteral PARSEOP_CLOSE_PAREN {$$ = TrSetOpIntegerValue (PARSEOP_EISAID, $3);} | PARSEOP_EISAID PARSEOP_OPEN_PAREN @@ -635,7 +635,7 @@ FprintfTerm : PARSEOP_FPRINTF PARSEOP_OPEN_PAREN {$$ = TrCreateLeafOp (PARSEOP_FPRINTF);} TermArg ',' - StringData + StringLiteral PrintfArgList PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($3,3,$4,$6,$7);} | PARSEOP_FPRINTF @@ -1091,7 +1091,7 @@ PowerResTerm PrintfTerm : PARSEOP_PRINTF PARSEOP_OPEN_PAREN {$$ = TrCreateLeafOp (PARSEOP_PRINTF);} - StringData + StringLiteral PrintfArgList PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($3,2,$4,$5);} | PARSEOP_PRINTF @@ -1412,7 +1412,7 @@ ToStringTerm ToUUIDTerm : PARSEOP_TOUUID PARSEOP_OPEN_PAREN - StringData + StringLiteral PARSEOP_CLOSE_PAREN {$$ = TrSetOpIntegerValue (PARSEOP_TOUUID, $3);} | PARSEOP_TOUUID PARSEOP_OPEN_PAREN @@ -1422,7 +1422,7 @@ ToUUIDTerm UnicodeTerm : PARSEOP_UNICODE PARSEOP_OPEN_PAREN {$$ = TrCreateLeafOp (PARSEOP_UNICODE);} - StringData + StringLiteral PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($3,2,0,$4);} | PARSEOP_UNICODE PARSEOP_OPEN_PAREN diff --git a/sys/contrib/dev/acpica/compiler/aslrules.y b/sys/contrib/dev/acpica/compiler/aslrules.y index f998527b3a36..e7e678d2058e 100644 --- a/sys/contrib/dev/acpica/compiler/aslrules.y +++ b/sys/contrib/dev/acpica/compiler/aslrules.y @@ -523,6 +523,10 @@ StringData | String {} ; +StringLiteral + : String {} + ; + ByteConst : Integer {$$ = TrSetOpIntegerValue (PARSEOP_BYTECONST, $1);} ; diff --git a/sys/contrib/dev/acpica/compiler/asltypes.y b/sys/contrib/dev/acpica/compiler/asltypes.y index 85d3af9acf8d..5c07c5df8e35 100644 --- a/sys/contrib/dev/acpica/compiler/asltypes.y +++ b/sys/contrib/dev/acpica/compiler/asltypes.y @@ -178,6 +178,7 @@ NoEcho(' %type RequiredTarget %type SimpleName %type StringData +%type StringLiteral %type Target %type Term %type TermArg diff --git a/sys/contrib/dev/acpica/components/events/evregion.c b/sys/contrib/dev/acpica/components/events/evregion.c index 132e3c27d6db..431be55b7107 100644 --- a/sys/contrib/dev/acpica/components/events/evregion.c +++ b/sys/contrib/dev/acpica/components/events/evregion.c @@ -164,8 +164,10 @@ extern UINT8 AcpiGbl_DefaultAddressSpaces[]; /* Local prototypes */ static void -AcpiEvOrphanEcRegMethod ( - ACPI_NAMESPACE_NODE *EcDeviceNode); +AcpiEvExecuteOrphanRegMethod ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_ADR_SPACE_TYPE SpaceId); + static ACPI_STATUS AcpiEvRegRun ( @@ -869,11 +871,13 @@ AcpiEvExecuteRegMethods ( (void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL, &Info, NULL); - /* Special case for EC: handle "orphan" _REG methods with no region */ - - if (SpaceId == ACPI_ADR_SPACE_EC) + /* + * Special case for EC and GPIO: handle "orphan" _REG methods with + * no region. + */ + if (SpaceId == ACPI_ADR_SPACE_EC || SpaceId == ACPI_ADR_SPACE_GPIO) { - AcpiEvOrphanEcRegMethod (Node); + AcpiEvExecuteOrphanRegMethod (Node, SpaceId); } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, @@ -954,32 +958,29 @@ AcpiEvRegRun ( /******************************************************************************* * - * FUNCTION: AcpiEvOrphanEcRegMethod + * FUNCTION: AcpiEvExecuteOrphanRegMethod * - * PARAMETERS: EcDeviceNode - Namespace node for an EC device + * PARAMETERS: DeviceNode - Namespace node for an ACPI device + * SpaceId - The address space ID * * RETURN: None * - * DESCRIPTION: Execute an "orphan" _REG method that appears under the EC + * DESCRIPTION: Execute an "orphan" _REG method that appears under an ACPI * device. This is a _REG method that has no corresponding region - * within the EC device scope. The orphan _REG method appears to - * have been enabled by the description of the ECDT in the ACPI - * specification: "The availability of the region space can be - * detected by providing a _REG method object underneath the - * Embedded Controller device." - * - * To quickly access the EC device, we use the EcDeviceNode used - * during EC handler installation. Otherwise, we would need to - * perform a time consuming namespace walk, executing _HID - * methods to find the EC device. + * within the device's scope. ACPI tables depending on these + * "orphan" _REG methods have been seen for both EC and GPIO + * Operation Regions. Presumably the Windows ACPI implementation + * always calls the _REG method independent of the presence of + * an actual Operation Region with the correct address space ID. * * MUTEX: Assumes the namespace is locked * ******************************************************************************/ static void -AcpiEvOrphanEcRegMethod ( - ACPI_NAMESPACE_NODE *EcDeviceNode) +AcpiEvExecuteOrphanRegMethod ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_ADR_SPACE_TYPE SpaceId) { ACPI_HANDLE RegMethod; ACPI_NAMESPACE_NODE *NextNode; @@ -988,10 +989,10 @@ AcpiEvOrphanEcRegMethod ( ACPI_OBJECT Objects[2]; - ACPI_FUNCTION_TRACE (EvOrphanEcRegMethod); + ACPI_FUNCTION_TRACE (EvExecuteOrphanRegMethod); - if (!EcDeviceNode) + if (!DeviceNode) { return_VOID; } @@ -1002,7 +1003,7 @@ AcpiEvOrphanEcRegMethod ( /* Get a handle to a _REG method immediately under the EC device */ - Status = AcpiGetHandle (EcDeviceNode, METHOD_NAME__REG, &RegMethod); + Status = AcpiGetHandle (DeviceNode, METHOD_NAME__REG, &RegMethod); if (ACPI_FAILURE (Status)) { goto Exit; /* There is no _REG method present */ @@ -1015,25 +1016,25 @@ AcpiEvOrphanEcRegMethod ( * with other space IDs to be present; but the code below will then * execute the _REG method with the EmbeddedControl SpaceID argument. */ - NextNode = AcpiNsGetNextNode (EcDeviceNode, NULL); + NextNode = AcpiNsGetNextNode (DeviceNode, NULL); while (NextNode) { if ((NextNode->Type == ACPI_TYPE_REGION) && (NextNode->Object) && - (NextNode->Object->Region.SpaceId == ACPI_ADR_SPACE_EC)) + (NextNode->Object->Region.SpaceId == SpaceId)) { goto Exit; /* Do not execute the _REG */ } - NextNode = AcpiNsGetNextNode (EcDeviceNode, NextNode); + NextNode = AcpiNsGetNextNode (DeviceNode, NextNode); } - /* Evaluate the _REG(EmbeddedControl,Connect) method */ + /* Evaluate the _REG(SpaceId,Connect) method */ Args.Count = 2; Args.Pointer = Objects; Objects[0].Type = ACPI_TYPE_INTEGER; - Objects[0].Integer.Value = ACPI_ADR_SPACE_EC; + Objects[0].Integer.Value = SpaceId; Objects[1].Type = ACPI_TYPE_INTEGER; Objects[1].Integer.Value = ACPI_REG_CONNECT; diff --git a/sys/contrib/dev/acpica/components/namespace/nspredef.c b/sys/contrib/dev/acpica/components/namespace/nspredef.c index 2a90ed91244c..eb656eadf0cc 100644 --- a/sys/contrib/dev/acpica/components/namespace/nspredef.c +++ b/sys/contrib/dev/acpica/components/namespace/nspredef.c @@ -223,13 +223,14 @@ AcpiNsCheckReturnValue ( ACPI_STATUS Status; const ACPI_PREDEFINED_INFO *Predefined; + ACPI_FUNCTION_TRACE (NsCheckReturnValue); /* If not a predefined name, we cannot validate the return object */ Predefined = Info->Predefined; if (!Predefined) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* @@ -239,7 +240,7 @@ AcpiNsCheckReturnValue ( if ((ReturnStatus != AE_OK) && (ReturnStatus != AE_CTRL_RETURN_VALUE)) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* @@ -259,7 +260,7 @@ AcpiNsCheckReturnValue ( (!Predefined->Info.ExpectedBtypes) || (Predefined->Info.ExpectedBtypes == ACPI_RTYPE_ALL)) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* @@ -325,7 +326,7 @@ AcpiNsCheckReturnValue ( Node->Flags |= ANOBJ_EVALUATED; } - return (Status); + return_ACPI_STATUS (Status); } diff --git a/sys/contrib/dev/acpica/components/namespace/nsprepkg.c b/sys/contrib/dev/acpica/components/namespace/nsprepkg.c index 4b7c2d4d24cf..0aeecdf1b4af 100644 --- a/sys/contrib/dev/acpica/components/namespace/nsprepkg.c +++ b/sys/contrib/dev/acpica/components/namespace/nsprepkg.c @@ -214,7 +214,7 @@ AcpiNsCheckPackage ( UINT32 i; - ACPI_FUNCTION_NAME (NsCheckPackage); + ACPI_FUNCTION_TRACE (NsCheckPackage); /* The package info for this name is in the next table entry */ @@ -245,13 +245,13 @@ AcpiNsCheckPackage ( { if (Package->RetInfo.Type == ACPI_PTYPE1_VAR) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Return Package has no elements (empty)")); - return (AE_AML_OPERAND_VALUE); + return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } /* @@ -305,7 +305,7 @@ AcpiNsCheckPackage ( Package->RetInfo.ObjectType1, i); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } Elements++; @@ -338,7 +338,7 @@ AcpiNsCheckPackage ( Package->RetInfo3.ObjectType[i], i); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } } else @@ -349,7 +349,7 @@ AcpiNsCheckPackage ( Package->RetInfo3.TailObjectType, i); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } } @@ -365,7 +365,7 @@ AcpiNsCheckPackage ( Info, Elements, ACPI_RTYPE_INTEGER, 0); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } Elements++; @@ -384,7 +384,7 @@ AcpiNsCheckPackage ( Info, Elements, ACPI_RTYPE_INTEGER, 0); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } /* @@ -428,7 +428,7 @@ AcpiNsCheckPackage ( Info, ReturnObject, ReturnObjectPtr); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } /* Update locals to point to the new package (of 1 element) */ @@ -466,7 +466,7 @@ AcpiNsCheckPackage ( Package->RetInfo.ObjectType1, 0); if (ACPI_FAILURE(Status)) { - return (Status); + return_ACPI_STATUS (Status); } /* Validate length of the UUID buffer */ @@ -475,14 +475,14 @@ AcpiNsCheckPackage ( { ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Invalid length for UUID Buffer")); - return (AE_AML_OPERAND_VALUE); + return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } Status = AcpiNsCheckObjectType(Info, Elements + 1, Package->RetInfo.ObjectType2, 0); if (ACPI_FAILURE(Status)) { - return (Status); + return_ACPI_STATUS (Status); } Elements += 2; @@ -498,10 +498,10 @@ AcpiNsCheckPackage ( "Invalid internal return type in table entry: %X", Package->RetInfo.Type)); - return (AE_AML_INTERNAL); + return_ACPI_STATUS (AE_AML_INTERNAL); } - return (Status); + return_ACPI_STATUS (Status); PackageTooSmall: @@ -512,7 +512,7 @@ AcpiNsCheckPackage ( "Return Package is too small - found %u elements, expected %u", Count, ExpectedCount)); - return (AE_AML_OPERAND_VALUE); + return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } @@ -865,6 +865,8 @@ AcpiNsCheckPackageElements ( UINT32 i; + ACPI_FUNCTION_TRACE (NsCheckPackageElements); + /* * Up to two groups of package elements are supported by the data * structure. All elements in each group must be of the same type. @@ -876,7 +878,7 @@ AcpiNsCheckPackageElements ( Type1, i + StartIndex); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } ThisElement++; @@ -888,11 +890,11 @@ AcpiNsCheckPackageElements ( Type2, (i + Count1 + StartIndex)); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } ThisElement++; } - return (AE_OK); + return_ACPI_STATUS (AE_OK); } diff --git a/sys/contrib/dev/acpica/components/namespace/nsrepair2.c b/sys/contrib/dev/acpica/components/namespace/nsrepair2.c index 50414942b2da..fed8d2576537 100644 --- a/sys/contrib/dev/acpica/components/namespace/nsrepair2.c +++ b/sys/contrib/dev/acpica/components/namespace/nsrepair2.c @@ -321,16 +321,18 @@ AcpiNsComplexRepairs ( ACPI_STATUS Status; + ACPI_FUNCTION_TRACE (NsComplexRepairs); + /* Check if this name is in the list of repairable names */ Predefined = AcpiNsMatchComplexRepair (Node); if (!Predefined) { - return (ValidateStatus); + return_ACPI_STATUS (ValidateStatus); } Status = Predefined->RepairFunction (Info, ReturnObjectPtr); - return (Status); + return_ACPI_STATUS (Status); } @@ -526,20 +528,21 @@ AcpiNsRepair_CID ( UINT16 OriginalRefCount; UINT32 i; + ACPI_FUNCTION_TRACE (NsRepair_CID); /* Check for _CID as a simple string */ if (ReturnObject->Common.Type == ACPI_TYPE_STRING) { Status = AcpiNsRepair_HID (Info, ReturnObjectPtr); - return (Status); + return_ACPI_STATUS (Status); } /* Exit if not a Package */ if (ReturnObject->Common.Type != ACPI_TYPE_PACKAGE) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* Examine each element of the _CID package */ @@ -553,7 +556,7 @@ AcpiNsRepair_CID ( Status = AcpiNsRepair_HID (Info, ElementPtr); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } if (OriginalElement != *ElementPtr) @@ -567,7 +570,7 @@ AcpiNsRepair_CID ( ElementPtr++; } - return (AE_OK); + return_ACPI_STATUS (AE_OK); } @@ -687,9 +690,8 @@ AcpiNsRepair_HID ( ACPI_OPERAND_OBJECT **ReturnObjectPtr) { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; - ACPI_OPERAND_OBJECT *NewString; - char *Source; char *Dest; + char *Source; ACPI_FUNCTION_NAME (NsRepair_HID); @@ -699,7 +701,7 @@ AcpiNsRepair_HID ( if (ReturnObject->Common.Type != ACPI_TYPE_STRING) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } if (ReturnObject->String.Length == 0) @@ -711,15 +713,7 @@ AcpiNsRepair_HID ( /* Return AE_OK anyway, let driver handle it */ Info->ReturnFlags |= ACPI_OBJECT_REPAIRED; - return (AE_OK); - } - - /* It is simplest to always create a new string object */ - - NewString = AcpiUtCreateStringObject (ReturnObject->String.Length); - if (!NewString) - { - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_OK); } /* @@ -732,7 +726,7 @@ AcpiNsRepair_HID ( if (*Source == '*') { Source++; - NewString->String.Length--; + ReturnObject->String.Length--; ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, "%s: Removed invalid leading asterisk\n", Info->FullPathname)); @@ -746,14 +740,13 @@ AcpiNsRepair_HID ( * "NNNN####" where N is an uppercase letter or decimal digit, and * # is a hex digit. */ - for (Dest = NewString->String.Pointer; *Source; Dest++, Source++) + for (Dest = ReturnObject->String.Pointer; *Source; Dest++, Source++) { *Dest = (char) toupper ((int) *Source); } + ReturnObject->String.Pointer[ReturnObject->String.Length] = 0; - AcpiUtRemoveReference (ReturnObject); - *ReturnObjectPtr = NewString; - return (AE_OK); + return_ACPI_STATUS (AE_OK); } diff --git a/sys/contrib/dev/acpica/include/accommon.h b/sys/contrib/dev/acpica/include/accommon.h index 41bfef6a0fab..c2194f405f63 100644 --- a/sys/contrib/dev/acpica/include/accommon.h +++ b/sys/contrib/dev/acpica/include/accommon.h @@ -155,7 +155,7 @@ /* * Common set of includes for all ACPICA source files. * We put them here because we don't want to duplicate them - * in the the source code again and again. + * in the source code again and again. * * Note: The order of these include files is important. */ diff --git a/sys/contrib/dev/acpica/include/acpixf.h b/sys/contrib/dev/acpica/include/acpixf.h index aca4c1d49d6d..60eb6818b7e3 100644 --- a/sys/contrib/dev/acpica/include/acpixf.h +++ b/sys/contrib/dev/acpica/include/acpixf.h @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20200925 +#define ACPI_CA_VERSION 0x20201113 #include #include diff --git a/sys/contrib/dev/acpica/include/acuuid.h b/sys/contrib/dev/acpica/include/acuuid.h index 468244a6b373..f11b35365e5a 100644 --- a/sys/contrib/dev/acpica/include/acuuid.h +++ b/sys/contrib/dev/acpica/include/acuuid.h @@ -181,6 +181,7 @@ /* NVDIMM - NFIT table */ +#define UUID_NFIT_DIMM "4309ac30-0d11-11e4-9191-0800200c9a66" #define UUID_VOLATILE_MEMORY "7305944f-fdda-44e3-b16c-3f22d252e5d0" #define UUID_PERSISTENT_MEMORY "66f0d379-b4f3-4074-ac43-0d3318b78cdb" #define UUID_CONTROL_REGION "92f701f6-13b4-405d-910b-299367e8234c" @@ -189,6 +190,10 @@ #define UUID_VOLATILE_VIRTUAL_CD "3d5abd30-4175-87ce-6d64-d2ade523c4bb" #define UUID_PERSISTENT_VIRTUAL_DISK "5cea02c9-4d07-69d3-269f-4496fbe096f9" #define UUID_PERSISTENT_VIRTUAL_CD "08018188-42cd-bb48-100f-5387d53ded3d" +#define UUID_NFIT_DIMM_N_MSFT "1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05" +#define UUID_NFIT_DIMM_N_HPE1 "9002c334-acf3-4c0e-9642-a235f0d53bc6" +#define UUID_NFIT_DIMM_N_HPE2 "5008664b-b758-41a0-a03c-27c2f2d04f7e" +#define UUID_NFIT_DIMM_N_HYPERV "5746c5f2-a9a2-4264-ad0e-e4ddc9e09e80" /* Processor Properties (ACPI 6.2) */