Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 May 2012 23:12:30 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r235945 - in head/sys: contrib/dev/acpica contrib/dev/acpica/common contrib/dev/acpica/compiler contrib/dev/acpica/components/debugger contrib/dev/acpica/components/dispatcher contrib/d...
Message-ID:  <201205242312.q4ONCUXr066028@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Thu May 24 23:12:30 2012
New Revision: 235945
URL: http://svn.freebsd.org/changeset/base/235945

Log:
  Merge ACPICA 20120518.

Modified:
  head/sys/contrib/dev/acpica/acpica_prep.sh
  head/sys/contrib/dev/acpica/changes.txt
  head/sys/contrib/dev/acpica/common/adfile.c
  head/sys/contrib/dev/acpica/common/adwalk.c
  head/sys/contrib/dev/acpica/common/dmextern.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/aslcompiler.y
  head/sys/contrib/dev/acpica/compiler/aslerror.c
  head/sys/contrib/dev/acpica/compiler/aslfiles.c
  head/sys/contrib/dev/acpica/compiler/aslmain.c
  head/sys/contrib/dev/acpica/compiler/aslmap.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.h
  head/sys/contrib/dev/acpica/compiler/aslstartup.c
  head/sys/contrib/dev/acpica/compiler/dtio.c
  head/sys/contrib/dev/acpica/compiler/prscan.c
  head/sys/contrib/dev/acpica/compiler/prutils.c
  head/sys/contrib/dev/acpica/components/debugger/dbfileio.c
  head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
  head/sys/contrib/dev/acpica/components/events/evxface.c
  head/sys/contrib/dev/acpica/components/tables/tbfadt.c
  head/sys/contrib/dev/acpica/components/utilities/utmisc.c
  head/sys/contrib/dev/acpica/include/acobject.h
  head/sys/contrib/dev/acpica/include/acpiosxf.h
  head/sys/contrib/dev/acpica/include/acpixf.h
  head/sys/contrib/dev/acpica/include/actypes.h
  head/sys/contrib/dev/acpica/include/acutils.h
  head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
  head/sys/dev/acpica/Osd/OsdSchedule.c
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)
  head/sys/contrib/dev/acpica/common/   (props changed)
  head/sys/contrib/dev/acpica/compiler/   (props changed)
  head/sys/contrib/dev/acpica/components/debugger/   (props changed)
  head/sys/contrib/dev/acpica/components/dispatcher/   (props changed)
  head/sys/contrib/dev/acpica/components/events/   (props changed)
  head/sys/contrib/dev/acpica/components/tables/   (props changed)
  head/sys/contrib/dev/acpica/components/utilities/   (props changed)
  head/sys/contrib/dev/acpica/include/   (props changed)
  head/sys/contrib/dev/acpica/os_specific/   (props changed)

Modified: head/sys/contrib/dev/acpica/acpica_prep.sh
==============================================================================
--- head/sys/contrib/dev/acpica/acpica_prep.sh	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/acpica_prep.sh	Thu May 24 23:12:30 2012	(r235945)
@@ -10,8 +10,8 @@ if [ ! $# -eq 1 ]; then
 fi
 
 src=$1
-wrk=`realpath ./_acpi_ca_unpack`
-dst=`realpath ./acpi_ca_destination`
+wrk="$(realpath .)/_acpi_ca_unpack"
+dst="$(realpath .)/acpi_ca_destination"
 
 # files that should keep their full directory path
 fulldirs="common compiler components include os_specific"
@@ -67,7 +67,8 @@ for H in ${src_headers}; do
 	xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/include/$H\>|g"
 done
 for H in ${comp_headers}; do
-	find ${dst}/common ${dst}/compiler -name "*.[chly]" -type f |	\
+	find ${dst}/common ${dst}/compiler ${dst}/components \
+	    -name "*.[chly]" -type f |	\
 	xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/compiler/$H\>|g"
 done
 for H in ${platform_headers}; do

Modified: head/sys/contrib/dev/acpica/changes.txt
==============================================================================
--- head/sys/contrib/dev/acpica/changes.txt	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/changes.txt	Thu May 24 23:12:30 2012	(r235945)
@@ -1,8 +1,70 @@
 ----------------------------------------
+18 May 2012. Summary of changes for version 20120518:
+
+
+1) ACPICA Core Subsystem:
+
+Added a new OSL interface, AcpiOsWaitEventsComplete. This interface is defined 
+to block until asynchronous events such as notifies and GPEs have completed. 
+Within ACPICA, it is only called before a notify or GPE handler is 
+removed/uninstalled. It also may be useful for the host OS within related 
+drivers such as the Embedded Controller driver. See the ACPICA reference for 
+additional information. ACPICA BZ 868.
+
+ACPI Tables: Added a new error message for a possible overflow failure during 
+the conversion of FADT 32-bit legacy register addresses to internal common 64-
+bit GAS structure representation. The GAS has a one-byte "bit length" field, 
+thus limiting the register length to 255 bits. ACPICA BZ 953.
+
+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.
+
+  Previous Release:
+    Non-Debug Version:  92.9K Code, 25.0K Data, 117.9K Total
+    Debug Version:     172.6K Code, 73.4K Data, 246.0K Total
+  Current Release:
+    Non-Debug Version:  93.0K Code, 25.1K Data, 118.1K Total
+    Debug Version:     172.7K Code, 73.6K Data, 246.3K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Added the ACPI 5.0 "PCC" keyword for use in the Register() ASL macro. 
+This keyword was added late in the ACPI 5.0 release cycle and was not 
+implemented until now.
+
+Disassembler: Added support for Operation Region externals. Adds missing 
+support for operation regions that are defined in another table, and 
+referenced locally via a Field or BankField ASL operator. Now generates the 
+correct External statement.
+
+Disassembler: Several additional fixes for the External() statement generation 
+related to some ASL operators. Also, order the External() statements 
+alphabetically in the disassembler output. Fixes the External() generation for 
+the Create* field, Alias, and Scope operators:
+ 1) Create* buffer field operators - fix type mismatch warning on disassembly
+ 2) Alias - implement missing External support
+ 3) Scope - fix to make sure all necessary externals are emitted.
+
+iASL: Improved pathname support. For include files, merge the prefix pathname 
+with the file pathname and eliminate unnecessary components. Convert 
+backslashes in all pathnames to forward slashes, for readability. Include file 
+pathname changes affect both #include and Include() type operators.
+
+iASL/DTC/Preprocessor: Gracefully handle early EOF. Handle an EOF at the end 
+of a valid line by inserting a newline and then returning the EOF during the 
+next call to GetNextLine. Prevents the line from being ignored due to EOF 
+condition.
+
+iASL: Implemented some changes to enhance the IDE support (-vi option.) Error 
+and Warning messages are now correctly recognized for both the source code 
+browser and the global error and warning counts.
+
+----------------------------------------
 20 April 2012. Summary of changes for version 20120420:
 
-This release is available at www.acpica.org/downloads.
-The ACPI 5.0 specification is available at www.acpi.info.
 
 1) ACPICA Core Subsystem:
 
@@ -68,8 +130,6 @@ several extraneous "unrecognized operato
 ----------------------------------------
 20 March 2012. Summary of changes for version 20120320:
 
-This release is available at www.acpica.org/downloads.
-The ACPI 5.0 specification is available at www.acpi.info.
 
 1) ACPICA Core Subsystem:
 
@@ -160,8 +220,6 @@ Versions supported:
 ----------------------------------------
 15 February 2012. Summary of changes for version 20120215:
 
-This release is available at www.acpica.org/downloads.
-The ACPI 5.0 specification is available at www.acpi.info.
 
 1) ACPICA Core Subsystem:
 
@@ -252,8 +310,6 @@ specification.
 ----------------------------------------
 11 January 2012. Summary of changes for version 20120111:
 
-This release is available at www.acpica.org/downloads.
-The ACPI 5.0 specification is available at www.acpi.info.
 
 1) ACPICA Core Subsystem:
 

Modified: head/sys/contrib/dev/acpica/common/adfile.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/adfile.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/common/adfile.c	Thu May 24 23:12:30 2012	(r235945)
@@ -298,20 +298,24 @@ FlSplitInputPathname (
         return (AE_NO_MEMORY);
     }
 
-    Substring = strrchr (DirectoryPath, '\\');
+    /* Convert backslashes to slashes in the entire path */
+
+    UtConvertBackslashes (DirectoryPath);
+
+    /* Backup to last slash or colon */
+
+    Substring = strrchr (DirectoryPath, '/');
     if (!Substring)
     {
-        Substring = strrchr (DirectoryPath, '/');
-        if (!Substring)
-        {
-            Substring = strrchr (DirectoryPath, ':');
-        }
+        Substring = strrchr (DirectoryPath, ':');
     }
 
+    /* Extract the simple filename */
+
     if (!Substring)
     {
+        Filename = FlStrdup (DirectoryPath);
         DirectoryPath[0] = 0;
-        Filename = FlStrdup (InputPath);
     }
     else
     {
@@ -326,7 +330,6 @@ FlSplitInputPathname (
 
     *OutDirectoryPath = DirectoryPath;
     *OutFilename = Filename;
-
     return (AE_OK);
 }
 

Modified: head/sys/contrib/dev/acpica/common/adwalk.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/adwalk.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/common/adwalk.c	Thu May 24 23:12:30 2012	(r235945)
@@ -521,6 +521,7 @@ AcpiDmFindOrphanDescending (
 
         if ((OpInfo->Class != AML_CLASS_EXECUTE) &&
             (OpInfo->Class != AML_CLASS_CREATE) &&
+            (OpInfo->ObjectType != ACPI_TYPE_LOCAL_ALIAS) &&
             (ParentOp->Common.AmlOpcode != AML_INT_METHODCALL_OP) &&
             !Op->Common.Node)
         {
@@ -743,13 +744,23 @@ AcpiDmXrefDescendingOp (
 
     if (OpInfo->Flags & AML_NAMED)
     {
-        if ((Op->Common.AmlOpcode == AML_ALIAS_OP) ||
-            (Op->Common.AmlOpcode == AML_SCOPE_OP))
+        /*
+         * Only these two operators (Alias, Scope) refer to an existing
+         * name, it is the first argument
+         */
+        if (Op->Common.AmlOpcode == AML_ALIAS_OP)
+        {
+            ObjectType = ACPI_TYPE_ANY;
+
+            NextOp = Op->Common.Value.Arg;
+            NextOp = NextOp->Common.Value.Arg;
+            if (NextOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
+            {
+                Path = NextOp->Common.Value.String;
+            }
+        }
+        else if (Op->Common.AmlOpcode == AML_SCOPE_OP)
         {
-            /*
-             * Only these two operators refer to an existing name,
-             * first argument
-             */
             Path = (char *) Op->Named.Path;
         }
     }
@@ -757,6 +768,8 @@ AcpiDmXrefDescendingOp (
     {
         /* Referenced Buffer Name is the first child */
 
+        ObjectType = ACPI_TYPE_BUFFER; /* Change from TYPE_BUFFER_FIELD */
+
         NextOp = Op->Common.Value.Arg;
         if (NextOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
         {
@@ -783,6 +796,11 @@ AcpiDmXrefDescendingOp (
     Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
                 ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
                 WalkState, &Node);
+    if (ACPI_SUCCESS (Status) && (Node->Flags & ANOBJ_IS_EXTERNAL))
+    {
+        Status = AE_NOT_FOUND;
+    }
+
     if (ACPI_FAILURE (Status))
     {
         if (Status == AE_NOT_FOUND)

Modified: head/sys/contrib/dev/acpica/common/dmextern.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/dmextern.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/common/dmextern.c	Thu May 24 23:12:30 2012	(r235945)
@@ -454,12 +454,12 @@ AcpiDmAddToExternalList (
 
     NewExternal->InternalPath = Path;
 
-    /* Link the new descriptor into the global list, ordered by string length */
+    /* Link the new descriptor into the global list, alphabetically ordered */
 
     NextExternal = AcpiGbl_ExternalList;
     while (NextExternal)
     {
-        if (NewExternal->Length <= NextExternal->Length)
+        if (AcpiUtStricmp (NewExternal->Path, NextExternal->Path) < 0)
         {
             if (PrevExternal)
             {
@@ -508,7 +508,7 @@ AcpiDmAddExternalsToNamespace (
 {
     ACPI_STATUS             Status;
     ACPI_NAMESPACE_NODE     *Node;
-    ACPI_OPERAND_OBJECT     *MethodDesc;
+    ACPI_OPERAND_OBJECT     *ObjDesc;
     ACPI_EXTERNAL_LIST      *External = AcpiGbl_ExternalList;
 
 
@@ -527,13 +527,29 @@ AcpiDmAddExternalsToNamespace (
                 "while adding external to namespace [%s]",
                 External->Path));
         }
-        else if (External->Type == ACPI_TYPE_METHOD)
+
+        else switch (External->Type)
         {
+        case ACPI_TYPE_METHOD:
+
             /* For methods, we need to save the argument count */
 
-            MethodDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
-            MethodDesc->Method.ParamCount = (UINT8) External->Value;
-            Node->Object = MethodDesc;
+            ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
+            ObjDesc->Method.ParamCount = (UINT8) External->Value;
+            Node->Object = ObjDesc;
+            break;
+
+        case ACPI_TYPE_REGION:
+
+            /* Regions require a region sub-object */
+
+            ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION);
+            ObjDesc->Region.Node = Node;
+            Node->Object = ObjDesc;
+            break;
+
+        default:
+            break;
         }
 
         External = External->Next;

Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslcompile.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/compiler/aslcompile.c	Thu May 24 23:12:30 2012	(r235945)
@@ -59,12 +59,12 @@ CmFlushSourceCode (
 
 static void
 FlConsumeAnsiComment (
-    ASL_FILE_INFO           *FileInfo,
+    FILE                    *Handle,
     ASL_FILE_STATUS         *Status);
 
 static void
 FlConsumeNewComment (
-    ASL_FILE_INFO           *FileInfo,
+    FILE                    *Handle,
     ASL_FILE_STATUS         *Status);
 
 
@@ -253,7 +253,8 @@ CmFlushSourceCode (
  *
  * FUNCTION:    FlConsume*
  *
- * PARAMETERS:  FileInfo        - Points to an open input file
+ * PARAMETERS:  Handle              - Open input file
+ *              Status              - File current status struct
  *
  * RETURN:      Number of lines consumed
  *
@@ -263,14 +264,14 @@ CmFlushSourceCode (
 
 static void
 FlConsumeAnsiComment (
-    ASL_FILE_INFO           *FileInfo,
+    FILE                    *Handle,
     ASL_FILE_STATUS         *Status)
 {
     UINT8                   Byte;
     BOOLEAN                 ClosingComment = FALSE;
 
 
-    while (fread (&Byte, 1, 1, FileInfo->Handle))
+    while (fread (&Byte, 1, 1, Handle))
     {
         /* Scan until comment close is found */
 
@@ -307,13 +308,13 @@ FlConsumeAnsiComment (
 
 static void
 FlConsumeNewComment (
-    ASL_FILE_INFO           *FileInfo,
+    FILE                    *Handle,
     ASL_FILE_STATUS         *Status)
 {
     UINT8                   Byte;
 
 
-    while (fread (&Byte, 1, 1, FileInfo->Handle))
+    while (fread (&Byte, 1, 1, Handle))
     {
         Status->Offset++;
 
@@ -332,7 +333,9 @@ FlConsumeNewComment (
  *
  * FUNCTION:    FlCheckForAscii
  *
- * PARAMETERS:  FileInfo        - Points to an open input file
+ * PARAMETERS:  Handle              - Open input file
+ *              Filename            - Input filename
+ *              DisplayErrors       - TRUE if error messages desired
  *
  * RETURN:      Status
  *
@@ -347,7 +350,9 @@ FlConsumeNewComment (
 
 ACPI_STATUS
 FlCheckForAscii (
-    ASL_FILE_INFO           *FileInfo)
+    FILE                    *Handle,
+    char                    *Filename,
+    BOOLEAN                 DisplayErrors)
 {
     UINT8                   Byte;
     ACPI_SIZE               BadBytes = 0;
@@ -360,7 +365,7 @@ FlCheckForAscii (
 
     /* Read the entire file */
 
-    while (fread (&Byte, 1, 1, FileInfo->Handle))
+    while (fread (&Byte, 1, 1, Handle))
     {
         /* Ignore comment fields (allow non-ascii within) */
 
@@ -370,12 +375,12 @@ FlCheckForAscii (
 
             if (Byte == '*')
             {
-                FlConsumeAnsiComment (FileInfo, &Status);
+                FlConsumeAnsiComment (Handle, &Status);
             }
 
             if (Byte == '/')
             {
-                FlConsumeNewComment (FileInfo, &Status);
+                FlConsumeNewComment (Handle, &Status);
             }
 
             /* Reset */
@@ -391,7 +396,7 @@ FlCheckForAscii (
 
         if (!ACPI_IS_ASCII (Byte))
         {
-            if (BadBytes < 10)
+            if ((BadBytes < 10) && (DisplayErrors))
             {
                 AcpiOsPrintf (
                     "Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n",
@@ -413,20 +418,24 @@ FlCheckForAscii (
 
     /* Seek back to the beginning of the source file */
 
-    fseek (FileInfo->Handle, 0, SEEK_SET);
+    fseek (Handle, 0, SEEK_SET);
 
     /* Were there any non-ASCII characters in the file? */
 
     if (BadBytes)
     {
-        AcpiOsPrintf (
-            "%u non-ASCII characters found in input source text, could be a binary file\n",
-            BadBytes);
-        AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, FileInfo->Filename);
+        if (DisplayErrors)
+        {
+            AcpiOsPrintf (
+                "%u non-ASCII characters found in input source text, could be a binary file\n",
+                BadBytes);
+            AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, Filename);
+        }
+
         return (AE_BAD_CHARACTER);
     }
 
-    /* File is OK */
+    /* File is OK (100% ASCII) */
 
     return (AE_OK);
 }

Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslcompiler.h	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h	Thu May 24 23:12:30 2012	(r235945)
@@ -166,7 +166,9 @@ CmCleanupAndExit (
 
 ACPI_STATUS
 FlCheckForAscii (
-    ASL_FILE_INFO           *FileInfo);
+    FILE                    *Handle,
+    char                    *Filename,
+    BOOLEAN                 DisplayErrors);
 
 
 /*
@@ -608,6 +610,11 @@ void
 FlAddIncludeDirectory (
     char                    *Dir);
 
+char *
+FlMergePathnames (
+    char                    *PrefixDir,
+    char                    *FilePathname);
+
 void
 FlOpenIncludeFile (
     ACPI_PARSE_OBJECT       *Op);

Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.l
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslcompiler.l	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/compiler/aslcompiler.l	Thu May 24 23:12:30 2012	(r235945)
@@ -523,6 +523,7 @@ NamePathTail                [.]{NameSeg}
 "IPMI"                      { count (0); return (PARSEOP_REGIONSPACE_IPMI); }
 "GeneralPurposeIo"          { count (0); return (PARSEOP_REGIONSPACE_GPIO); }       /* ACPI 5.0 */
 "GenericSerialBus"          { count (0); return (PARSEOP_REGIONSPACE_GSBUS); }      /* ACPI 5.0 */
+"PCC"                       { count (0); return (PARSEOP_REGIONSPACE_PCC); }        /* ACPI 5.0 */
 "FFixedHW"                  { count (0); return (PARSEOP_REGIONSPACE_FFIXEDHW); }
 
     /* ResourceTypeKeyword: Resource Usage - Resource Descriptors */

Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.y
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslcompiler.y	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/compiler/aslcompiler.y	Thu May 24 23:12:30 2012	(r235945)
@@ -363,6 +363,7 @@ void *                      AslLocalAllo
 %token <i> PARSEOP_REGIONSPACE_IO
 %token <i> PARSEOP_REGIONSPACE_IPMI
 %token <i> PARSEOP_REGIONSPACE_MEM
+%token <i> PARSEOP_REGIONSPACE_PCC
 %token <i> PARSEOP_REGIONSPACE_PCI
 %token <i> PARSEOP_REGIONSPACE_PCIBAR
 %token <i> PARSEOP_REGIONSPACE_SMBUS
@@ -2359,6 +2360,7 @@ RegionSpaceKeyword
     | PARSEOP_REGIONSPACE_IPMI              {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);}
     | PARSEOP_REGIONSPACE_GPIO              {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);}
     | PARSEOP_REGIONSPACE_GSBUS             {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);}
+    | PARSEOP_REGIONSPACE_PCC               {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);}
     | PARSEOP_REGIONSPACE_FFIXEDHW          {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);}
     ;
 

Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslerror.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/compiler/aslerror.c	Thu May 24 23:12:30 2012	(r235945)
@@ -315,12 +315,16 @@ AePrintException (
         }
         else
         {
+            /*
+             * Less verbose version of the error message, enabled via the
+             * -vi switch. The format is compatible with MS Visual Studio.
+             */
             fprintf (OutputFile, "%s", Enode->Filename);
 
             if (Enode->LineNumber)
             {
-                fprintf (OutputFile, "(%u) i:%6u : ",
-                    Enode->LineNumber, Enode->LineNumber);
+                fprintf (OutputFile, "(%u) : ",
+                    Enode->LineNumber);
             }
         }
     }
@@ -335,9 +339,18 @@ AePrintException (
     {
         /* Decode the message ID */
 
-        fprintf (OutputFile, "%s %4.4d - ",
-                    AslErrorLevel[Enode->Level],
-                    Enode->MessageId + ((Enode->Level+1) * 1000));
+        if (Gbl_VerboseErrors)
+        {
+            fprintf (OutputFile, "%s %4.4d - ",
+                        AslErrorLevel[Enode->Level],
+                        Enode->MessageId + ((Enode->Level+1) * 1000));
+        }
+        else /* IDE case */
+        {
+            fprintf (OutputFile, "%s %4.4d:",
+                        AslErrorLevelIde[Enode->Level],
+                        Enode->MessageId + ((Enode->Level+1) * 1000));
+        }
 
         MainMessage = AslMessages[Enode->MessageId];
         ExtraMessage = Enode->Message;

Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslfiles.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/compiler/aslfiles.c	Thu May 24 23:12:30 2012	(r235945)
@@ -492,6 +492,107 @@ FlAddIncludeDirectory (
 
 /*******************************************************************************
  *
+ * FUNCTION:    FlMergePathnames
+ *
+ * PARAMETERS:  PrefixDir       - Prefix directory pathname. Can be NULL or
+ *                                a zero length string.
+ *              FilePathname    - The include filename from the source ASL.
+ *
+ * RETURN:      Merged pathname string
+ *
+ * DESCRIPTION: Merge two pathnames that (probably) have common elements, to
+ *              arrive at a minimal length string. Merge can occur if the
+ *              FilePathname is relative to the PrefixDir.
+ *
+ ******************************************************************************/
+
+char *
+FlMergePathnames (
+    char                    *PrefixDir,
+    char                    *FilePathname)
+{
+    char                    *CommonPath;
+    char                    *Pathname;
+    char                    *LastElement;
+
+
+    DbgPrint (ASL_PARSE_OUTPUT, "Include: Prefix path - \"%s\"\n"
+        "Include: FilePathname - \"%s\"\n",
+         PrefixDir, FilePathname);
+
+    /*
+     * If there is no prefix directory or if the file pathname is absolute,
+     * just return the original file pathname
+     */
+    if (!PrefixDir || (!*PrefixDir) ||
+        (*FilePathname == '/') ||
+         (FilePathname[1] == ':'))
+    {
+        Pathname = ACPI_ALLOCATE (strlen (FilePathname) + 1);
+        strcpy (Pathname, FilePathname);
+        goto ConvertBackslashes;
+    }
+
+    /* Need a local copy of the prefix directory path */
+
+    CommonPath = ACPI_ALLOCATE (strlen (PrefixDir) + 1);
+    strcpy (CommonPath, PrefixDir);
+
+    /*
+     * Walk forward through the file path, and simultaneously backward
+     * through the prefix directory path until there are no more
+     * relative references at the start of the file path.
+     */
+    while (*FilePathname && (!strncmp (FilePathname, "../", 3)))
+    {
+        /* Remove last element of the prefix directory path */
+
+        LastElement = strrchr (CommonPath, '/');
+        if (!LastElement)
+        {
+            goto ConcatenatePaths;
+        }
+
+        *LastElement = 0;   /* Terminate CommonPath string */
+        FilePathname += 3;  /* Point to next path element */
+    }
+
+    /*
+     * Remove the last element of the prefix directory path (it is the same as
+     * the first element of the file pathname), and build the final merged
+     * pathname.
+     */
+    LastElement = strrchr (CommonPath, '/');
+    if (LastElement)
+    {
+        *LastElement = 0;
+    }
+
+    /* Build the final merged pathname */
+
+ConcatenatePaths:
+    Pathname = ACPI_ALLOCATE_ZEROED (strlen (CommonPath) + strlen (FilePathname) + 2);
+    if (LastElement && *CommonPath)
+    {
+        strcpy (Pathname, CommonPath);
+        strcat (Pathname, "/");
+    }
+    strcat (Pathname, FilePathname);
+    ACPI_FREE (CommonPath);
+
+    /* Convert all backslashes to normal slashes */
+
+ConvertBackslashes:
+    UtConvertBackslashes (Pathname);
+
+    DbgPrint (ASL_PARSE_OUTPUT, "Include: Merged Pathname - \"%s\"\n",
+         Pathname);
+    return (Pathname);
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    FlOpenIncludeWithPrefix
  *
  * PARAMETERS:  PrefixDir       - Prefix directory pathname. Can be a zero
@@ -515,12 +616,9 @@ FlOpenIncludeWithPrefix (
 
     /* Build the full pathname to the file */
 
-    Pathname = ACPI_ALLOCATE (strlen (PrefixDir) + strlen (Filename) + 1);
-
-    strcpy (Pathname, PrefixDir);
-    strcat (Pathname, Filename);
+    Pathname = FlMergePathnames (PrefixDir, Filename);
 
-    DbgPrint (ASL_PARSE_OUTPUT, "\nAttempt to open include file: path %s\n\n",
+    DbgPrint (ASL_PARSE_OUTPUT, "Include: Opening file - \"%s\"\n\n",
         Pathname);
 
     /* Attempt to open the file, push if successful */

Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslmain.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/compiler/aslmain.c	Thu May 24 23:12:30 2012	(r235945)
@@ -765,9 +765,18 @@ AslDoOptions (
             break;
 
         case 'i':
-            /* Less verbose error messages */
-
+            /*
+             * Support for integrated development environment(s).
+             *
+             * 1) No compiler signon
+             * 2) Send stderr messages to stdout
+             * 3) Less verbose error messages (single line only for each)
+             * 4) Error/warning messages are formatted appropriately to
+             *    be recognized by MS Visual Studio
+             */
             Gbl_VerboseErrors = FALSE;
+            Gbl_DoSignon = FALSE;
+            Gbl_Files[ASL_FILE_STDERR].Handle = stdout;
             break;
 
         case 'o':

Modified: head/sys/contrib/dev/acpica/compiler/aslmap.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslmap.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/compiler/aslmap.c	Thu May 24 23:12:30 2012	(r235945)
@@ -367,6 +367,7 @@ const ASL_MAPPING_ENTRY     AslKeywordMa
 /* REGIONSPACE_IO */            OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_ADR_SPACE_SYSTEM_IO,       0,                  0),
 /* REGIONSPACE_IPMI */          OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_ADR_SPACE_IPMI,            0,                  0),
 /* REGIONSPACE_MEM */           OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_ADR_SPACE_SYSTEM_MEMORY,   0,                  0),
+/* REGIONSPACE_PCC */           OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_ADR_SPACE_PLATFORM_COMM,   0,                  0),
 /* REGIONSPACE_PCI */           OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_ADR_SPACE_PCI_CONFIG,      0,                  0),
 /* REGIONSPACE_PCIBAR */        OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_ADR_SPACE_PCI_BAR_TARGET,  0,                  0),
 /* REGIONSPACE_SMBUS */         OP_TABLE_ENTRY (AML_RAW_DATA_BYTE,          ACPI_ADR_SPACE_SMBUS,           0,                  0),

Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslmessages.h	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/compiler/aslmessages.h	Thu May 24 23:12:30 2012	(r235945)
@@ -402,7 +402,7 @@ char                        *AslMessages
 };
 
 
-char                    *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
+const char              *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
     "Warning ",
     "Warning ",
     "Warning ",
@@ -411,6 +411,15 @@ char                    *AslErrorLevel [
     "Optimize"
 };
 
+const char              *AslErrorLevelIde [ASL_NUM_REPORT_LEVELS] = {
+    "warning ",
+    "warning ",
+    "warning ",
+    "error   ",
+    "remark  ",
+    "optimize"
+};
+
 #define ASL_ERROR_LEVEL_LENGTH          8       /* Length of strings above */
 
 #endif  /* ASL_EXCEPTIONS */

Modified: head/sys/contrib/dev/acpica/compiler/aslstartup.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslstartup.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/compiler/aslstartup.c	Thu May 24 23:12:30 2012	(r235945)
@@ -227,7 +227,7 @@ AslDetectSourceFileType (
 
     /* Check for 100% ASCII source file (comments are ignored) */
 
-    Status = FlCheckForAscii (Info);
+    Status = FlCheckForAscii (Info->Handle, Info->Filename, TRUE);
     if (ACPI_FAILURE (Status))
     {
         printf ("Non-ascii input file - %s\n", Info->Filename);

Modified: head/sys/contrib/dev/acpica/compiler/dtio.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/dtio.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/compiler/dtio.c	Thu May 24 23:12:30 2012	(r235945)
@@ -427,7 +427,6 @@ DtGetNextLine (
             {
             case DT_START_QUOTED_STRING:
             case DT_SLASH_ASTERISK_COMMENT:
-            case DT_SLASH_SLASH_COMMENT:
 
                 AcpiOsPrintf ("**** EOF within comment/string %u\n", State);
                 break;
@@ -436,7 +435,22 @@ DtGetNextLine (
                 break;
             }
 
-            return (ASL_EOF);
+            /* Standalone EOF is OK */
+
+            if (i == 0)
+            {
+                return (ASL_EOF);
+            }
+
+            /*
+             * Received an EOF in the middle of a line. Terminate the
+             * line with a newline. The next call to this function will
+             * return a standalone EOF. Thus, the upper parsing software
+             * never has to deal with an EOF within a valid line (or
+             * the last line does not get tossed on the floor.)
+             */
+            c = '\n';
+            State = DT_NORMAL_TEXT;
         }
 
         switch (State)

Modified: head/sys/contrib/dev/acpica/compiler/prscan.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/prscan.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/compiler/prscan.c	Thu May 24 23:12:30 2012	(r235945)
@@ -654,7 +654,7 @@ PrDoDirective (
         }
 
         DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID
-            "Start #include file %s\n", Gbl_CurrentLineNumber,
+            "Start #include file \"%s\"\n", Gbl_CurrentLineNumber,
             Token, Gbl_CurrentLineNumber);
 
         PrOpenIncludeFile (Token);

Modified: head/sys/contrib/dev/acpica/compiler/prutils.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/prutils.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/compiler/prutils.c	Thu May 24 23:12:30 2012	(r235945)
@@ -246,13 +246,11 @@ PrOpenIncludeFile (
     ASL_INCLUDE_DIR         *NextDir;
 
 
-    /*
-     * start the actual include file on the next line
-     */
+    /* Start the actual include file on the next line */
+
     Gbl_CurrentLineOffset++;
 
     /* Attempt to open the include file */
-
     /* If the file specifies an absolute path, just open it */
 
     if ((Filename[0] == '/')  ||
@@ -330,13 +328,10 @@ PrOpenIncludeWithPrefix (
 
     /* Build the full pathname to the file */
 
-    Pathname = ACPI_ALLOCATE (strlen (PrefixDir) + strlen (Filename) + 1);
+    Pathname = FlMergePathnames (PrefixDir, Filename);
 
-    strcpy (Pathname, PrefixDir);
-    strcat (Pathname, Filename);
-
-    DbgPrint (ASL_PARSE_OUTPUT, "\n" PR_PREFIX_ID
-        "Opening include file: path %s\n",
+    DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID
+        "Include: Opening file - \"%s\"\n",
         Gbl_CurrentLineNumber, Pathname);
 
     /* Attempt to open the file, push if successful */

Modified: head/sys/contrib/dev/acpica/components/debugger/dbfileio.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/debugger/dbfileio.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/components/debugger/dbfileio.c	Thu May 24 23:12:30 2012	(r235945)
@@ -51,6 +51,10 @@
 #include <contrib/dev/acpica/include/actables.h>
 #endif
 
+#ifdef ACPI_ASL_COMPILER
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+#endif
+
 #if (defined ACPI_DEBUGGER || defined ACPI_DISASSEMBLER)
 
 #define _COMPONENT          ACPI_CA_DEBUGGER
@@ -309,6 +313,15 @@ AcpiDbReadTable (
             AcpiOsPrintf (
                 "TableHeader length [0x%X] greater than the input file size [0x%X]\n",
                 TableHeader.Length, FileSize);
+
+#ifdef ACPI_ASL_COMPILER
+            Status = FlCheckForAscii (fp, NULL, FALSE);
+            if (ACPI_SUCCESS (Status))
+            {
+                AcpiOsPrintf ("File appears to be ASCII only, must be binary\n",
+                    TableHeader.Length, FileSize);
+            }
+#endif
             return (AE_BAD_HEADER);
         }
 

Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c	Thu May 24 23:12:30 2012	(r235945)
@@ -57,6 +57,18 @@
 
 /* Local prototypes */
 
+#ifdef ACPI_ASL_COMPILER
+#include <contrib/dev/acpica/include/acdisasm.h>
+
+static ACPI_STATUS
+AcpiDsCreateExternalRegion (
+    ACPI_STATUS             LookupStatus,
+    ACPI_PARSE_OBJECT       *Op,
+    char                    *Path,
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_NAMESPACE_NODE     **Node);
+#endif
+
 static ACPI_STATUS
 AcpiDsGetFieldNames (
     ACPI_CREATE_FIELD_INFO  *Info,
@@ -64,6 +76,69 @@ AcpiDsGetFieldNames (
     ACPI_PARSE_OBJECT       *Arg);
 
 
+#ifdef ACPI_ASL_COMPILER
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDsCreateExternalRegion (iASL Disassembler only)
+ *
+ * PARAMETERS:  LookupStatus    - Status from NsLookup operation
+ *              Op              - Op containing the Field definition and args
+ *              Path            - Pathname of the region
+ *  `           WalkState       - Current method state
+ *              Node            - Where the new region node is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Add region to the external list if NOT_FOUND. Create a new
+ *              region node/object.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDsCreateExternalRegion (
+    ACPI_STATUS             LookupStatus,
+    ACPI_PARSE_OBJECT       *Op,
+    char                    *Path,
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_NAMESPACE_NODE     **Node)
+{
+    ACPI_STATUS             Status;
+    ACPI_OPERAND_OBJECT     *ObjDesc;
+
+
+    if (LookupStatus != AE_NOT_FOUND)
+    {
+        return (LookupStatus);
+    }
+
+    /*
+     * Table disassembly:
+     * OperationRegion not found. Generate an External for it, and
+     * insert the name into the namespace.
+     */
+    AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_REGION, 0);
+    Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_REGION,
+       ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, Node);
+    if (ACPI_FAILURE (Status))
+    {
+        return (Status);
+    }
+
+    /* Must create and install a region object for the new node */
+
+    ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION);
+    if (!ObjDesc)
+    {
+        return (AE_NO_MEMORY);
+    }
+
+    ObjDesc->Region.Node = *Node;
+    Status = AcpiNsAttachObject (*Node, ObjDesc, ACPI_TYPE_REGION);
+    return (Status);
+}
+#endif
+
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiDsCreateBufferField
@@ -438,11 +513,16 @@ AcpiDsCreateField (
     /* First arg is the name of the parent OpRegion (must already exist) */
 
     Arg = Op->Common.Value.Arg;
+
     if (!RegionNode)
     {
         Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name,
                         ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
                         ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
+#ifdef ACPI_ASL_COMPILER
+        Status = AcpiDsCreateExternalRegion (Status, Arg,
+            Arg->Common.Value.Name, WalkState, &RegionNode);
+#endif
         if (ACPI_FAILURE (Status))
         {
             ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status);
@@ -628,6 +708,10 @@ AcpiDsCreateBankField (
         Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name,
                         ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
                         ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
+#ifdef ACPI_ASL_COMPILER
+        Status = AcpiDsCreateExternalRegion (Status, Arg,
+            Arg->Common.Value.Name, WalkState, &RegionNode);
+#endif
         if (ACPI_FAILURE (Status))
         {
             ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status);

Modified: head/sys/contrib/dev/acpica/components/events/evxface.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/events/evxface.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/components/events/evxface.c	Thu May 24 23:12:30 2012	(r235945)
@@ -280,11 +280,9 @@ AcpiRemoveNotifyHandler (
         return_ACPI_STATUS (AE_BAD_PARAMETER);
     }
 
-#ifdef _UNDER_DEVELOPMENT
-    /* Make sure all deferred tasks are completed */
+    /* Make sure all deferred notify tasks are completed */
 
-    AcpiOsWaitEventsComplete (NULL);
-#endif
+    AcpiOsWaitEventsComplete ();
 
     Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
     if (ACPI_FAILURE (Status))
@@ -802,6 +800,10 @@ AcpiRemoveGpeHandler (
         return_ACPI_STATUS (AE_BAD_PARAMETER);
     }
 
+    /* Make sure all deferred GPE tasks are completed */
+
+    AcpiOsWaitEventsComplete ();
+
     Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
     if (ACPI_FAILURE (Status))
     {

Modified: head/sys/contrib/dev/acpica/components/tables/tbfadt.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/tables/tbfadt.c	Thu May 24 23:03:23 2012	(r235944)
+++ head/sys/contrib/dev/acpica/components/tables/tbfadt.c	Thu May 24 23:12:30 2012	(r235945)
@@ -52,12 +52,13 @@
 
 /* Local prototypes */
 
-static ACPI_INLINE void
+static void
 AcpiTbInitGenericAddress (
     ACPI_GENERIC_ADDRESS    *GenericAddress,
     UINT8                   SpaceId,
     UINT8                   ByteWidth,
-    UINT64                  Address);
+    UINT64                  Address,
+    char                    *RegisterName);
 
 static void
 AcpiTbConvertFadt (
@@ -202,13 +203,30 @@ static ACPI_FADT_PM_INFO    FadtPmInfoTa

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205242312.q4ONCUXr066028>