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 ------------------...



details:   https://anonhg.NetBSD.org/src/rev/39419e79dfa8
branches:  intel
changeset: 318774:39419e79dfa8
user:      christos <christos%NetBSD.org@localhost>
date:      Fri May 04 23:44:07 2018 +0000
description:
----------------------------------------
27 April 2018. Summary of changes for version 20180427:


1) ACPICA kernel-resident subsystem:

Debugger: Added support for Package objects in the "Test Objects"
command. This command walks the entire namespace and evaluates all named
data objects (Integers, Strings, Buffers, and now Packages).

Improved error messages for the namespace root node. Originally, the root
was referred to by the confusing string "\___". This has been replaced by
"Namespace Root" for clarification.

Fixed a potential infinite loop in the AcpiRsDumpByteList function. Colin
Ian King <colin.king%canonical.com@localhost>.


2) iASL Compiler/Disassembler and Tools:

iASL: Implemented support to detect and flag illegal forward references.
For compatibility with other ACPI implementations, these references are
now illegal at the root level of the DSDT or SSDTs. Forward references
have always been illegal within control methods. This change should not
affect existing ASL/AML code because of the fact that these references
have always been illegal in the other ACPI implementation.

iASL: Added error messages for the case where a table OEM ID and OEM
TABLE ID strings are longer than the ACPI-defined length. Previously,
these strings were simply silently truncated.

iASL: Enhanced the -tc option (which creates an AML hex file in C,
suitable for import into a firmware project):
  1) Create a unique name for the table, to simplify use of multiple
SSDTs.
  2) Add a protection #ifdef in the file, similar to a .h header file.
With assistance from Sami Mujawar, sami.mujawar%arm.com@localhost and Evan Lloyd,
evan.lloyd%arm.com@localhost

AcpiExec: Added a new option, -df, to disable the local fault handler.
This is useful during debugging, where it may be desired to drop into a
debugger on a fault.

diffstat:

 sys/external/bsd/acpica/dist/changes.txt                  |   43 ++
 sys/external/bsd/acpica/dist/common/adfile.c              |   56 +++
 sys/external/bsd/acpica/dist/common/dmtbinfo2.c           |    2 +-
 sys/external/bsd/acpica/dist/compiler/aslcompiler.h       |    9 +
 sys/external/bsd/acpica/dist/compiler/aslglobal.h         |    3 +-
 sys/external/bsd/acpica/dist/compiler/aslhex.c            |   23 +-
 sys/external/bsd/acpica/dist/compiler/aslload.c           |   72 ++++-
 sys/external/bsd/acpica/dist/compiler/aslmessages.c       |    8 +-
 sys/external/bsd/acpica/dist/compiler/aslmessages.h       |    2 +
 sys/external/bsd/acpica/dist/compiler/asloperands.c       |   15 +-
 sys/external/bsd/acpica/dist/compiler/asltypes.h          |    3 +-
 sys/external/bsd/acpica/dist/compiler/aslutils.c          |   91 +++++
 sys/external/bsd/acpica/dist/compiler/aslxref.c           |  220 +------------
 sys/external/bsd/acpica/dist/debugger/dbnames.c           |   13 +-
 sys/external/bsd/acpica/dist/debugger/dbtest.c            |   67 ++++-
 sys/external/bsd/acpica/dist/dispatcher/dswscope.c        |    9 +-
 sys/external/bsd/acpica/dist/include/acapps.h             |    4 +
 sys/external/bsd/acpica/dist/include/acnames.h            |    7 +-
 sys/external/bsd/acpica/dist/include/acpixf.h             |    2 +-
 sys/external/bsd/acpica/dist/resources/rsdump.c           |    2 +-
 sys/external/bsd/acpica/dist/tables/tbinstal.c            |    2 +-
 sys/external/bsd/acpica/dist/tools/acpiexec/aecommon.h    |    1 +
 sys/external/bsd/acpica/dist/tools/acpiexec/aeexception.c |   13 +-
 sys/external/bsd/acpica/dist/tools/acpiexec/aemain.c      |   12 +-
 sys/external/bsd/acpica/dist/utilities/utprint.c          |    1 +
 sys/external/bsd/acpica/dist/utilities/utstring.c         |    2 +-
 26 files changed, 448 insertions(+), 234 deletions(-)

diffs (truncated from 1186 to 300 lines):

diff -r ff031bf4041c -r 39419e79dfa8 sys/external/bsd/acpica/dist/changes.txt
--- a/sys/external/bsd/acpica/dist/changes.txt  Sat Apr 07 14:12:43 2018 +0000
+++ b/sys/external/bsd/acpica/dist/changes.txt  Fri May 04 23:44:07 2018 +0000
@@ -1,4 +1,47 @@
 ----------------------------------------
+27 April 2018. Summary of changes for version 20180427: 
+
+
+1) ACPICA kernel-resident subsystem:
+
+Debugger: Added support for Package objects in the "Test Objects" 
+command. This command walks the entire namespace and evaluates all named 
+data objects (Integers, Strings, Buffers, and now Packages).
+
+Improved error messages for the namespace root node. Originally, the root 
+was referred to by the confusing string "\___". This has been replaced by 
+"Namespace Root" for clarification.
+
+Fixed a potential infinite loop in the AcpiRsDumpByteList function. Colin 
+Ian King <colin.king%canonical.com@localhost>.
+
+
+2) iASL Compiler/Disassembler and Tools: 
+
+iASL: Implemented support to detect and flag illegal forward references. 
+For compatibility with other ACPI implementations, these references are 
+now illegal at the root level of the DSDT or SSDTs. Forward references 
+have always been illegal within control methods. This change should not 
+affect existing ASL/AML code because of the fact that these references 
+have always been illegal in the other ACPI implementation.
+
+iASL: Added error messages for the case where a table OEM ID and OEM 
+TABLE ID strings are longer than the ACPI-defined length. Previously, 
+these strings were simply silently truncated.
+
+iASL: Enhanced the -tc option (which creates an AML hex file in C, 
+suitable for import into a firmware project):
+  1) Create a unique name for the table, to simplify use of multiple 
+SSDTs.
+  2) Add a protection #ifdef in the file, similar to a .h header file.
+With assistance from Sami Mujawar, sami.mujawar%arm.com@localhost and Evan Lloyd, 
+evan.lloyd%arm.com@localhost
+
+AcpiExec: Added a new option, -df, to disable the local fault handler. 
+This is useful during debugging, where it may be desired to drop into a 
+debugger on a fault.
+
+----------------------------------------
 13 March 2018. Summary of changes for version 20180313:
 
 
diff -r ff031bf4041c -r 39419e79dfa8 sys/external/bsd/acpica/dist/common/adfile.c
--- a/sys/external/bsd/acpica/dist/common/adfile.c      Sat Apr 07 14:12:43 2018 +0000
+++ b/sys/external/bsd/acpica/dist/common/adfile.c      Fri May 04 23:44:07 2018 +0000
@@ -346,3 +346,59 @@
 
     return (AE_OK);
 }
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    FlGetFileBasename
+ *
+ * PARAMETERS:  FilePathname            - File path to be split
+ *
+ * RETURN:      The extracted base name of the file, in upper case
+ *
+ * DESCRIPTION: Extract the file base name (the file name with no extension)
+ *              from the input pathname.
+ *
+ *              Note: Any backslashes in the pathname should be previously
+ *              converted to forward slashes before calling this function.
+ *
+ ******************************************************************************/
+
+char *
+FlGetFileBasename (
+    char                    *FilePathname)
+{
+    char                    *FileBasename;
+    char                    *Substring;
+
+
+    /* Backup to last slash or colon */
+
+    Substring = strrchr (FilePathname, '/');
+    if (!Substring)
+    {
+        Substring = strrchr (FilePathname, ':');
+    }
+
+    /* Extract the full filename (base + extension) */
+
+    if (Substring)
+    {
+        FileBasename = FlStrdup (Substring + 1);
+    }
+    else
+    {
+        FileBasename = FlStrdup (FilePathname);
+    }
+
+    /* Remove the filename extension if present */
+
+    Substring = strchr (FileBasename, '.');
+    if (Substring)
+    {
+        *Substring = 0;
+    }
+
+    AcpiUtStrupr (FileBasename);
+    return (FileBasename);
+}
diff -r ff031bf4041c -r 39419e79dfa8 sys/external/bsd/acpica/dist/common/dmtbinfo2.c
--- a/sys/external/bsd/acpica/dist/common/dmtbinfo2.c   Sat Apr 07 14:12:43 2018 +0000
+++ b/sys/external/bsd/acpica/dist/common/dmtbinfo2.c   Fri May 04 23:44:07 2018 +0000
@@ -955,7 +955,7 @@
     {ACPI_DMT_UINT24,   ACPI_NFIT7_OFFSET (Reserved[0]),            "Reserved", 0},
     {ACPI_DMT_UINT32,   ACPI_NFIT7_OFFSET (Capabilities),           "Capabilities (decoded below)", DT_FLAG},
     {ACPI_DMT_FLAG0,    ACPI_NFIT7_FLAG_OFFSET (Capabilities,0),    "Cache Flush to NVDIMM", 0},
-    {ACPI_DMT_FLAG1,    ACPI_NFIT7_FLAG_OFFSET (Capabilities,0),    "Memory Flush to MVDIMM", 0},
+    {ACPI_DMT_FLAG1,    ACPI_NFIT7_FLAG_OFFSET (Capabilities,0),    "Memory Flush to NVDIMM", 0},
     {ACPI_DMT_FLAG2,    ACPI_NFIT7_FLAG_OFFSET (Capabilities,0),    "Memory Mirroring", 0},
     {ACPI_DMT_UINT32,   ACPI_NFIT7_OFFSET (Reserved2),              "Reserved", 0},
     ACPI_DMT_TERMINATOR
diff -r ff031bf4041c -r 39419e79dfa8 sys/external/bsd/acpica/dist/compiler/aslcompiler.h
--- a/sys/external/bsd/acpica/dist/compiler/aslcompiler.h       Sat Apr 07 14:12:43 2018 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslcompiler.h       Fri May 04 23:44:07 2018 +0000
@@ -1079,6 +1079,15 @@
     ACPI_PARSE_OBJECT       *Op,
     UINT32                  Level);
 
+void *
+UtGetParentMethod (
+    ACPI_NAMESPACE_NODE     *Node);
+
+BOOLEAN
+UtNodeIsDescendantOf (
+    ACPI_NAMESPACE_NODE     *Node1,
+    ACPI_NAMESPACE_NODE     *Node2);
+
 void
 UtDisplaySupportedTables (
     void);
diff -r ff031bf4041c -r 39419e79dfa8 sys/external/bsd/acpica/dist/compiler/aslglobal.h
--- a/sys/external/bsd/acpica/dist/compiler/aslglobal.h Sat Apr 07 14:12:43 2018 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslglobal.h Fri May 04 23:44:07 2018 +0000
@@ -112,7 +112,8 @@
     "OP_COMPILER_EMITTED",
     "OP_IS_DUPLICATE",
     "OP_IS_RESOURCE_DATA",
-    "OP_IS_NULL_RETURN"
+    "OP_IS_NULL_RETURN",
+    "OP_NOT_FOUND_DURING_LOAD"
 };
 
 #else
diff -r ff031bf4041c -r 39419e79dfa8 sys/external/bsd/acpica/dist/compiler/aslhex.c
--- a/sys/external/bsd/acpica/dist/compiler/aslhex.c    Sat Apr 07 14:12:43 2018 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslhex.c    Fri May 04 23:44:07 2018 +0000
@@ -42,6 +42,7 @@
  */
 
 #include "aslcompiler.h"
+#include "acapps.h"
 
 #define _COMPONENT          ACPI_COMPILER
         ACPI_MODULE_NAME    ("ashex")
@@ -157,6 +158,9 @@
  *              output file, but formatted into hex/ascii bytes suitable for
  *              inclusion into a C source file.
  *
+ *              Note: the base name of the hex output file is prepended to
+ *              all symbols as they are output to the file.
+ *
  ******************************************************************************/
 
 static void
@@ -168,17 +172,29 @@
     UINT32                  Offset = 0;
     UINT32                  AmlFileSize;
     UINT32                  i;
+    char                    *FileBasename;
 
 
+    /* Obtain the file basename (filename with no extension) */
+
+    FileBasename = FlGetFileBasename (Gbl_Files [ASL_FILE_HEX_OUTPUT].Filename);
+
     /* Get AML size, seek back to start */
 
     AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT);
     FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
 
+    /* Finish the file header and emit the non-data symbols */
+
     FlPrintFile (ASL_FILE_HEX_OUTPUT, " * C source code output\n");
     FlPrintFile (ASL_FILE_HEX_OUTPUT, " * AML code block contains 0x%X bytes\n *\n */\n",
         AmlFileSize);
-    FlPrintFile (ASL_FILE_HEX_OUTPUT, "unsigned char AmlCode[] =\n{\n");
+
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, "#ifndef __%s_HEX__\n", FileBasename);
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, "#define __%s_HEX__\n\n", FileBasename);
+
+    AcpiUtStrlwr (FileBasename);
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, "unsigned char %s_aml_code[] =\n{\n", FileBasename);
 
     while (Offset < AmlFileSize)
     {
@@ -195,7 +211,7 @@
         for (i = 0; i < LineLength; i++)
         {
             /*
-             * Print each hex byte.
+             * Output each hex byte in the form: "0xnn,"
              * Add a comma until the very last byte of the AML file
              * (Some C compilers complain about a trailing comma)
              */
@@ -229,7 +245,8 @@
         Offset += LineLength;
     }
 
-    FlPrintFile (ASL_FILE_HEX_OUTPUT, "};\n");
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, "};\n\n");
+    FlPrintFile (ASL_FILE_HEX_OUTPUT, "#endif\n");
 }
 
 
diff -r ff031bf4041c -r 39419e79dfa8 sys/external/bsd/acpica/dist/compiler/aslload.c
--- a/sys/external/bsd/acpica/dist/compiler/aslload.c   Sat Apr 07 14:12:43 2018 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslload.c   Fri May 04 23:44:07 2018 +0000
@@ -45,8 +45,9 @@
 #include "amlcode.h"
 #include "acdispat.h"
 #include "acnamesp.h"
+#include "acparser.h"
+#include "aslcompiler.y.h"
 
-#include "aslcompiler.y.h"
 
 #define _COMPONENT          ACPI_COMPILER
         ACPI_MODULE_NAME    ("aslload")
@@ -362,9 +363,13 @@
     UINT32                  i;
     BOOLEAN                 ForceNewScope = FALSE;
     ACPI_OWNER_ID           OwnerId = 0;
+    const ACPI_OPCODE_INFO  *OpInfo;
+    ACPI_PARSE_OBJECT       *ParentOp;
 
 
     ACPI_FUNCTION_NAME (LdNamespace1Begin);
+
+
     ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op %p [%s]\n",
         Op, Op->Asl.ParseOpName));
 
@@ -440,6 +445,69 @@
         return (AE_OK);
     }
 
+    /* Check for a possible illegal forward reference */
+
+    if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
+        (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
+    {
+        /*
+         * Op->Asl.Namepath will be NULL for these opcodes.
+         * These opcodes are guaranteed to have a parent.
+         * Examine the parent opcode.
+         */
+        Status = AE_OK;
+        ParentOp = Op->Asl.Parent;
+        OpInfo = AcpiPsGetOpcodeInfo (ParentOp->Asl.AmlOpcode);
+
+        /*
+         * Exclude all operators that actually declare a new name:
+         *      Name (ABCD, 1) -> Ignore (AML_CLASS_NAMED_OBJECT)
+         * We only want references to named objects:
+         *      Store (2, WXYZ) -> Attempt to resolve the name
+         */
+        if (OpInfo->Class == AML_CLASS_NAMED_OBJECT)
+        {
+            return (AE_OK);
+        }
+
+        /*
+         * Check if the referenced object exists at this point during
+         * the load:
+         * 1) If it exists, then this cannot be a forward reference.
+         * 2) If it does not exist, it could be a forward reference or
+         * it truly does not exist (and no external declaration).
+         */
+        Status = AcpiNsLookup (WalkState->ScopeInfo,
+            Op->Asl.Value.Name, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+            ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
+            WalkState, &Node);
+        if (Status == AE_NOT_FOUND)
+        {
+            /*



Home | Main Index | Thread Index | Old Index