Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/intel]: src/sys/external/bsd/acpica/dist 30 April 2020. Summary of chang...



details:   https://anonhg.NetBSD.org/src/rev/35f78096f35b
branches:  intel
changeset: 933505:35f78096f35b
user:      christos <christos%NetBSD.org@localhost>
date:      Mon May 25 23:16:29 2020 +0000

description:
30 April 2020. Summary of changes for version 20200430:


1) ACPICA kernel-resident subsystem:

Cleaned up the coding style of a couple of global variables
(AcpiGbl_NextCmdNum and AcpiProtocolLengths) caught by static analyzers.
AcpiProtocolLengths was made static, and the definition of
AcpiGbl_NextCmdNum was moved to acglobal.h.


2) iASL Compiler/Disassembler and ACPICA tools:

iASL DataTable Compiler:  Fixed a segfault on errors that aren't directly
associated with a field.

Disassembler: has been made more resilient so that it will continue to
parse AML even if the AML generates ACPI namespace errors. This enables
iASL to disassemble some AML that may have been compiled using older
versions of iASL that no longer compile with newer versions of iASL.

iASL: Fixed the required parameters for _NIH and _NIG. Previously, there
was a mixup where _NIG required one parameter and _NIH required zero
parameters. This change swaps these parameter requirements. Now it is
required that _NIH must be called with one parameter and _NIG requires
zero parameters.

iASL: Allow use of undefined externals as long as they are protected by
an if (CondRefOf (...)) block when compiling multiple definition blocks.

iASL: Fixed the type override behavior of named objects that are declared
as External. External declarations will no longer override the type of
the actual definition if it already exists.

AcpiNames: Added setargv.obj to the MSVC 2017 link sequence to enable
command line wildcard support on Windows. Note: the AcpiNames utility is
essentially redundant with the AcpiExec utility (using the "namespace"
command) and is therefore deprecated. It will be removed in future
releases of ACPICA.

Disassembler: ignore AE_ALREADY_EXISTS status when parsing create*
operators. The disassembler is intended to emit existing ASL code as-is.
Therefore, error messages emitted during disassembly should be ignored or
handled in a way such that the disassembler can continue to parse the
AML. This change ignores AE_ALREADY_EXISTS errors during the deferred Op
parsing for create operators in order to complete parsing ASL termlists.

iASL DataTable Compiler: IVRS table: fix potentially uninitialized
variable warning. Some compilers catch potential uninitialized variables.
This is done by examining branches of if/else statements. This change
replaces an "else if" with an "else" to fix the uninitialized variable
warning.

diffstat:

 sys/external/bsd/acpica/dist/changes.txt             |   59 ++++++-
 sys/external/bsd/acpica/dist/common/acgetline.c      |    2 -
 sys/external/bsd/acpica/dist/common/dmtbdump2.c      |    4 +-
 sys/external/bsd/acpica/dist/compiler/aslcompiler.l  |    2 +-
 sys/external/bsd/acpica/dist/compiler/aslload.c      |   81 ++++----
 sys/external/bsd/acpica/dist/compiler/aslmessages.c  |    1 +
 sys/external/bsd/acpica/dist/compiler/aslmessages.h  |    1 +
 sys/external/bsd/acpica/dist/compiler/aslpredef.c    |    2 +-
 sys/external/bsd/acpica/dist/compiler/aslxref.c      |  165 +++++++++++++++++-
 sys/external/bsd/acpica/dist/compiler/dtutils.c      |   11 +-
 sys/external/bsd/acpica/dist/debugger/dbhistry.c     |    1 -
 sys/external/bsd/acpica/dist/disassembler/dmbuffer.c |   19 ++-
 sys/external/bsd/acpica/dist/dispatcher/dsfield.c    |   24 ++-
 sys/external/bsd/acpica/dist/executer/exfield.c      |    2 +-
 sys/external/bsd/acpica/dist/include/acglobal.h      |    1 +
 sys/external/bsd/acpica/dist/include/acpixf.h        |    2 +-
 sys/external/bsd/acpica/dist/include/acpredef.h      |    4 +-
 sys/external/bsd/acpica/dist/tools/acpiexec/aemain.c |   15 +-
 18 files changed, 313 insertions(+), 83 deletions(-)

diffs (truncated from 817 to 300 lines):

diff -r 57d51d5db000 -r 35f78096f35b sys/external/bsd/acpica/dist/changes.txt
--- a/sys/external/bsd/acpica/dist/changes.txt  Sat Mar 28 19:46:32 2020 +0000
+++ b/sys/external/bsd/acpica/dist/changes.txt  Mon May 25 23:16:29 2020 +0000
@@ -1,4 +1,61 @@
 ----------------------------------------
+
+
+30 April 2020. Summary of changes for version 20200430:
+
+
+1) ACPICA kernel-resident subsystem:
+
+Cleaned up the coding style of a couple of global variables 
+(AcpiGbl_NextCmdNum and AcpiProtocolLengths) caught by static analyzers. 
+AcpiProtocolLengths was made static, and the definition of 
+AcpiGbl_NextCmdNum was moved to acglobal.h.
+
+
+2) iASL Compiler/Disassembler and ACPICA tools: 
+
+iASL DataTable Compiler:  Fixed a segfault on errors that aren't directly 
+associated with a field.
+
+Disassembler: has been made more resilient so that it will continue to 
+parse AML even if the AML generates ACPI namespace errors. This enables 
+iASL to disassemble some AML that may have been compiled using older 
+versions of iASL that no longer compile with newer versions of iASL.
+
+iASL: Fixed the required parameters for _NIH and _NIG. Previously, there 
+was a mixup where _NIG required one parameter and _NIH required zero 
+parameters. This change swaps these parameter requirements. Now it is 
+required that _NIH must be called with one parameter and _NIG requires 
+zero parameters.
+
+iASL: Allow use of undefined externals as long as they are protected by 
+an if (CondRefOf (...)) block when compiling multiple definition blocks.
+
+iASL: Fixed the type override behavior of named objects that are declared 
+as External. External declarations will no longer override the type of 
+the actual definition if it already exists.
+
+AcpiNames: Added setargv.obj to the MSVC 2017 link sequence to enable 
+command line wildcard support on Windows. Note: the AcpiNames utility is 
+essentially redundant with the AcpiExec utility (using the "namespace" 
+command) and is therefore deprecated. It will be removed in future 
+releases of ACPICA.
+
+Disassembler: ignore AE_ALREADY_EXISTS status when parsing create* 
+operators. The disassembler is intended to emit existing ASL code as-is. 
+Therefore, error messages emitted during disassembly should be ignored or 
+handled in a way such that the disassembler can continue to parse the 
+AML. This change ignores AE_ALREADY_EXISTS errors during the deferred Op 
+parsing for create operators in order to complete parsing ASL termlists.
+
+iASL DataTable Compiler: IVRS table: fix potentially uninitialized 
+variable warning. Some compilers catch potential uninitialized variables. 
+This is done by examining branches of if/else statements. This change 
+replaces an "else if" with an "else" to fix the uninitialized variable 
+warning.
+
+
+----------------------------------------
 26 March 2020. Summary of changes for version 20200326:
 
 
@@ -674,7 +731,7 @@
 
 iASL: Emit error for creation of a zero-length operation region. Such a 
 region is rather pointless. If encountered, a runtime error is also 
-implemented in the interpeter.
+implemented in the interpreter.
 
 Debugger: Fix a possible fault with the "test objects" command.
 
diff -r 57d51d5db000 -r 35f78096f35b sys/external/bsd/acpica/dist/common/acgetline.c
--- a/sys/external/bsd/acpica/dist/common/acgetline.c   Sat Mar 28 19:46:32 2020 +0000
+++ b/sys/external/bsd/acpica/dist/common/acgetline.c   Mon May 25 23:16:29 2020 +0000
@@ -81,8 +81,6 @@
 #define _ASCII_LEFT_ARROW           'D'
 #define _ASCII_NEWLINE              '\n'
 
-extern UINT32               AcpiGbl_NextCmdNum;
-
 /* Erase a single character on the input command line */
 
 #define ACPI_CLEAR_CHAR() \
diff -r 57d51d5db000 -r 35f78096f35b sys/external/bsd/acpica/dist/common/dmtbdump2.c
--- a/sys/external/bsd/acpica/dist/common/dmtbdump2.c   Sat Mar 28 19:46:32 2020 +0000
+++ b/sys/external/bsd/acpica/dist/common/dmtbdump2.c   Mon May 25 23:16:29 2020 +0000
@@ -420,8 +420,10 @@
                 DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, Subtable,
                     sizeof (ACPI_IVRS_HARDWARE1));
             }
-            else if (Subtable->Type == ACPI_IVRS_TYPE_HARDWARE2)
+            else
             {
+                /* ACPI_IVRS_TYPE_HARDWARE2 subtable type */
+
                 EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE2);
                 DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, Subtable,
                     sizeof (ACPI_IVRS_HARDWARE2));
diff -r 57d51d5db000 -r 35f78096f35b sys/external/bsd/acpica/dist/compiler/aslcompiler.l
--- a/sys/external/bsd/acpica/dist/compiler/aslcompiler.l       Sat Mar 28 19:46:32 2020 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslcompiler.l       Mon May 25 23:16:29 2020 +0000
@@ -711,7 +711,7 @@
                                 }
 
                                 /*
-                                 * The eror code is contained inside the
+                                 * The error code is contained inside the
                                  * {ErrorCode} pattern. Extract it and log it
                                  * as the expected error code.
                                  */
diff -r 57d51d5db000 -r 35f78096f35b sys/external/bsd/acpica/dist/compiler/aslload.c
--- a/sys/external/bsd/acpica/dist/compiler/aslload.c   Sat Mar 28 19:46:32 2020 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslload.c   Mon May 25 23:16:29 2020 +0000
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Module Name: dswload - Dispatcher namespace load callbacks
+ * Module Name: aslload - compiler namespace load callbacks
  *
  *****************************************************************************/
 
@@ -93,7 +93,6 @@
     ACPI_NAMESPACE_NODE     *Node,
     ACPI_PARSE_OBJECT       *Op,
     ACPI_OBJECT_TYPE        ExternalOpType,
-    ACPI_OBJECT_TYPE        ObjectType,
     ACPI_WALK_STATE         *WalkState);
 
 
@@ -407,7 +406,6 @@
     ACPI_PARSE_OBJECT       *MethodOp;
     ACPI_STATUS             Status;
     ACPI_OBJECT_TYPE        ObjectType;
-    ACPI_OBJECT_TYPE        ActualObjectType = ACPI_TYPE_ANY;
     char                    *Path;
     UINT32                  Flags = ACPI_NS_NO_UPSEARCH;
     ACPI_PARSE_OBJECT       *Arg;
@@ -581,8 +579,7 @@
          *
          * first child is name, next child is ObjectType
          */
-        ActualObjectType = (UINT8) Op->Asl.Child->Asl.Next->Asl.Value.Integer;
-        ObjectType = ACPI_TYPE_ANY;
+        ObjectType = (UINT8) Op->Asl.Child->Asl.Next->Asl.Value.Integer;
 
         /*
          * We will mark every new node along the path as "External". This
@@ -601,7 +598,7 @@
          *       Store (\_SB_.PCI0.ABCD, Local0)
          *   }
          */
-        Flags |= ACPI_NS_EXTERNAL;
+        Flags |= ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE;
         break;
 
     case PARSEOP_DEFAULT_ARG:
@@ -805,8 +802,7 @@
             else if ((Node->Flags & ANOBJ_IS_EXTERNAL) ||
                      (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL))
             {
-                Status = LdAnalyzeExternals (Node, Op, ActualObjectType,
-                    ObjectType, WalkState);
+                Status = LdAnalyzeExternals (Node, Op, ObjectType, WalkState);
                 if (ACPI_FAILURE (Status))
                 {
                     if (Status == AE_ERROR)
@@ -821,6 +817,19 @@
                     }
                     return_ACPI_STATUS (Status);
                 }
+
+                if (!(Node->Flags & ANOBJ_IS_EXTERNAL) &&
+                     (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL))
+                {
+                    /*
+                     * If we get to here, it means that an actual definition of
+                     * the object declared external exists. Meaning that Op
+                     * loading this this Op should have no change to the ACPI
+                     * namespace. By going to FinishNode, we skip the
+                     * assignment of Node->Op = Op.
+                     */
+                    goto FinishNode;
+                }
             }
             else
             {
@@ -872,30 +881,15 @@
         }
     }
 
-FinishNode:
-    /*
-     * Point the parse node to the new namespace node, and point
-     * the Node back to the original Parse node
-     */
-    Op->Asl.Node = Node;
+    /* Point the Node back to the original Parse node */
+
     Node->Op = Op;
 
-    /*
-     * Set the actual data type if appropriate (EXTERNAL term only)
-     * As of 11/19/2019, ASL External() does not support parameter
-     * counts. When an External method is loaded, the parameter count is
-     * recorded in the external's arg count parameter. The parameter count may
-     * or may not be known in the declaration. If the value of this node turns
-     * out to be ASL_EXTERNAL_METHOD_UNKNOWN_PARAMS, it indicates that
-     * we do not know the parameter count and that we must look at the usage of
-     * the External method call to get this information.
-     */
-    if (ActualObjectType != ACPI_TYPE_ANY)
-    {
-        Node->Type = (UINT8) ActualObjectType;
-        Node->Value = (UINT32)
-            Op->Asl.Child->Asl.Next->Asl.Next->Asl.Value.Integer;
-    }
+FinishNode:
+
+    /* Point the parse node to the new namespace node */
+
+    Op->Asl.Node = Node;
 
     if (Op->Asl.ParseOpcode == PARSEOP_METHOD)
     {
@@ -905,6 +899,13 @@
          */
         Node->Value = (UINT32) Op->Asl.Extra;
     }
+    else if (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL &&
+        Node->Type == ACPI_TYPE_METHOD &&
+        (Node->Flags & ANOBJ_IS_EXTERNAL))
+    {
+        Node->Value =
+            (UINT32) Op->Asl.Child->Asl.Next->Asl.Next->Asl.Value.Integer;
+    }
 
     return_ACPI_STATUS (Status);
 }
@@ -912,7 +913,7 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    LdAnalyzeExternals
+ * FUNCTION:    LdMatchExternType
  *
  * PARAMETERS:  Type1
  *              Type2
@@ -929,7 +930,7 @@
  ******************************************************************************/
 
 static BOOLEAN
-LdTypesMatchExternType (
+LdMatchExternType (
     ACPI_OBJECT_TYPE        Type1,
     ACPI_OBJECT_TYPE        Type2)
 {
@@ -985,7 +986,6 @@
  * PARAMETERS:  Node            - Node that represents the named object
  *              Op              - Named object declaring this named object
  *              ExternalOpType  - Type of ExternalOp
- *              ObjectType      - Type of Declared object
  *              WalkState       - Current WalkState
  *
  * RETURN:      Status
@@ -1003,7 +1003,6 @@
     ACPI_NAMESPACE_NODE     *Node,
     ACPI_PARSE_OBJECT       *Op,
     ACPI_OBJECT_TYPE        ExternalOpType,
-    ACPI_OBJECT_TYPE        ObjectType,
     ACPI_WALK_STATE         *WalkState)
 {
     ACPI_STATUS             Status = AE_OK;
@@ -1027,12 +1026,12 @@
     else
     {
         ActualExternalOpType = Node->Type;
-        ActualOpType = ObjectType;
+        ActualOpType = ExternalOpType;
     }
 
     if ((ActualOpType != ACPI_TYPE_ANY) &&
         (ActualExternalOpType != ACPI_TYPE_ANY) &&
-        !LdTypesMatchExternType (ActualExternalOpType, ActualOpType))
+        !LdMatchExternType (ActualExternalOpType, ActualOpType))
     {
         if (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL &&
             Node->Op->Asl.ParseOpcode == PARSEOP_EXTERNAL)
@@ -1060,6 +1059,8 @@
         }
     }
 
+    /* Set the object type of the external */
+
     if ((Node->Flags & ANOBJ_IS_EXTERNAL) &&
         (Op->Asl.ParseOpcode != PARSEOP_EXTERNAL))
     {
@@ -1068,13 +1069,13 @@



Home | Main Index | Thread Index | Old Index