Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/acpica/dist -------------------------------...



details:   https://anonhg.NetBSD.org/src/rev/358bd15db8dd
branches:  trunk
changeset: 361617:358bd15db8dd
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/aslglobal.h         |   3 +-
 sys/external/bsd/acpica/dist/compiler/aslhex.c            |  23 +++++-
 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/dispatcher/dswscope.c        |   9 +-
 sys/external/bsd/acpica/dist/include/acnames.h            |   7 +-
 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/utstring.c         |   2 +-
 15 files changed, 176 insertions(+), 23 deletions(-)

diffs (truncated from 447 to 300 lines):

diff -r a925f2efaa6e -r 358bd15db8dd sys/external/bsd/acpica/dist/changes.txt
--- a/sys/external/bsd/acpica/dist/changes.txt  Fri May 04 23:04:09 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 a925f2efaa6e -r 358bd15db8dd sys/external/bsd/acpica/dist/common/adfile.c
--- a/sys/external/bsd/acpica/dist/common/adfile.c      Fri May 04 23:04:09 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 a925f2efaa6e -r 358bd15db8dd sys/external/bsd/acpica/dist/common/dmtbinfo2.c
--- a/sys/external/bsd/acpica/dist/common/dmtbinfo2.c   Fri May 04 23:04:09 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 a925f2efaa6e -r 358bd15db8dd sys/external/bsd/acpica/dist/compiler/aslglobal.h
--- a/sys/external/bsd/acpica/dist/compiler/aslglobal.h Fri May 04 23:04:09 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 a925f2efaa6e -r 358bd15db8dd sys/external/bsd/acpica/dist/compiler/aslhex.c
--- a/sys/external/bsd/acpica/dist/compiler/aslhex.c    Fri May 04 23:04:09 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 a925f2efaa6e -r 358bd15db8dd sys/external/bsd/acpica/dist/compiler/aslmessages.c
--- a/sys/external/bsd/acpica/dist/compiler/aslmessages.c       Fri May 04 23:04:09 2018 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslmessages.c       Fri May 04 23:44:07 2018 +0000
@@ -234,8 +234,8 @@
 /*    ASL_MSG_RANGE */                      "Constant out of range",
 /*    ASL_MSG_BUFFER_ALLOCATION */          "Could not allocate line buffer",
 /*    ASL_MSG_MISSING_DEPENDENCY */         "Missing dependency",
-/*    ASL_MSG_ILLEGAL_FORWARD_REF */        "Illegal forward reference within a method",
-/*    ASL_MSG_ILLEGAL_METHOD_REF */         "Illegal reference across two methods",
+/*    ASL_MSG_ILLEGAL_FORWARD_REF */        "Illegal forward reference",
+/*    ASL_MSG_ILLEGAL_METHOD_REF */         "Object is declared in a different method",
 /*    ASL_MSG_LOCAL_NOT_USED */             "Method Local is set but never used",
 /*    ASL_MSG_ARG_AS_LOCAL_NOT_USED */      "Method Argument (as a local) is set but never used",
 /*    ASL_MSG_ARG_NOT_USED */               "Method Argument is never used",
@@ -246,7 +246,9 @@
 /*    ASL_MSG_FOUND_HERE */                 "Original name creation/declaration below: ",
 /*    ASL_MSG_ILLEGAL_RECURSION */          "Illegal recursive call to method that creates named objects",
 /*    ASL_MSG_EXTERN_COLLISION */           "A name cannot be defined and declared external in the same table",
-/*    ASL_MSG_FOUND_HERE_EXTERN*/           "Remove one of the declarations indicated above or below:"
+/*    ASL_MSG_FOUND_HERE_EXTERN */          "Remove one of the declarations indicated above or below:",
+/*    ASL_MSG_OEM_TABLE_ID */               "Invalid OEM Table ID",
+/*    ASL_MSG_OEM_ID */                     "Invalid OEM ID"
 };
 
 /* Table compiler */
diff -r a925f2efaa6e -r 358bd15db8dd sys/external/bsd/acpica/dist/compiler/aslmessages.h
--- a/sys/external/bsd/acpica/dist/compiler/aslmessages.h       Fri May 04 23:04:09 2018 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslmessages.h       Fri May 04 23:44:07 2018 +0000
@@ -249,6 +249,8 @@
     ASL_MSG_ILLEGAL_RECURSION,
     ASL_MSG_EXTERN_COLLISION,
     ASL_MSG_EXTERN_FOUND_HERE,
+    ASL_MSG_OEM_TABLE_ID,
+    ASL_MSG_OEM_ID,
 
     /* These messages are used by the Data Table compiler only */
 
diff -r a925f2efaa6e -r 358bd15db8dd sys/external/bsd/acpica/dist/compiler/asloperands.c
--- a/sys/external/bsd/acpica/dist/compiler/asloperands.c       Fri May 04 23:04:09 2018 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asloperands.c       Fri May 04 23:44:07 2018 +0000
@@ -953,7 +953,7 @@
         if (strlen (Gbl_TableSignature) != ACPI_NAME_SIZE)
         {
             AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child,
-                "Length is not exactly 4");
+                "Length must be exactly 4 characters");
         }
 
         for (i = 0; i < ACPI_NAME_SIZE; i++)
@@ -970,6 +970,7 @@
 
     Child = Child->Asl.Next;
     Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+
     /*
      * We used the revision to set the integer width earlier
      */
@@ -978,6 +979,12 @@
 
     Child = Child->Asl.Next;
     Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+    if (Child->Asl.Value.String &&
+        strlen (Child->Asl.Value.String) > ACPI_OEM_ID_SIZE)
+    {
+        AslError (ASL_ERROR, ASL_MSG_OEM_ID, Child,
+            "Length cannot exceed 6 characters");
+    }
 
     /* OEM TableID */
 
@@ -986,6 +993,12 @@
     if (Child->Asl.Value.String)
     {
         Length = strlen (Child->Asl.Value.String);
+        if (Length > ACPI_OEM_TABLE_ID_SIZE)
+        {
+            AslError (ASL_ERROR, ASL_MSG_OEM_TABLE_ID, Child,
+                "Length cannot exceed 8 characters");
+        }
+
         Gbl_TableId = UtLocalCacheCalloc (Length + 1);
         strcpy (Gbl_TableId, Child->Asl.Value.String);
 
diff -r a925f2efaa6e -r 358bd15db8dd sys/external/bsd/acpica/dist/compiler/asltypes.h
--- a/sys/external/bsd/acpica/dist/compiler/asltypes.h  Fri May 04 23:04:09 2018 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/asltypes.h  Fri May 04 23:44:07 2018 +0000
@@ -75,8 +75,9 @@
 #define OP_IS_DUPLICATE             0x00040000
 #define OP_IS_RESOURCE_DATA         0x00080000
 #define OP_IS_NULL_RETURN           0x00100000



Home | Main Index | Thread Index | Old Index