svn commit: r285797 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon...

Jung-uk Kim jkim at FreeBSD.org
Wed Jul 22 16:25:17 UTC 2015


Author: jkim
Date: Wed Jul 22 16:25:07 2015
New Revision: 285797
URL: https://svnweb.freebsd.org/changeset/base/285797

Log:
  Merge ACPICA 20150717.

Added:
  head/sys/contrib/dev/acpica/components/debugger/dbobject.c
     - copied, changed from r285728, vendor-sys/acpica/dist/source/components/debugger/dbobject.c
  head/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c
     - copied, changed from r285728, vendor-sys/acpica/dist/source/components/dispatcher/dsdebug.c
  head/sys/contrib/dev/acpica/components/utilities/utnonansi.c
     - copied, changed from r285728, vendor-sys/acpica/dist/source/components/utilities/utnonansi.c
Deleted:
  head/sys/contrib/dev/acpica/components/disassembler/dmobject.c
Modified:
  head/sys/conf/files
  head/sys/contrib/dev/acpica/acpica_prep.sh
  head/sys/contrib/dev/acpica/changes.txt
  head/sys/contrib/dev/acpica/common/adisasm.c
  head/sys/contrib/dev/acpica/common/dmrestag.c
  head/sys/contrib/dev/acpica/common/dmtable.c
  head/sys/contrib/dev/acpica/common/dmtbdump.c
  head/sys/contrib/dev/acpica/common/dmtbinfo.c
  head/sys/contrib/dev/acpica/compiler/aslascii.c
  head/sys/contrib/dev/acpica/compiler/aslcompile.c
  head/sys/contrib/dev/acpica/compiler/asldefine.h
  head/sys/contrib/dev/acpica/compiler/aslfiles.c
  head/sys/contrib/dev/acpica/compiler/asllookup.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.h
  head/sys/contrib/dev/acpica/compiler/aslmethod.c
  head/sys/contrib/dev/acpica/compiler/aslnamesp.c
  head/sys/contrib/dev/acpica/compiler/asloffset.c
  head/sys/contrib/dev/acpica/compiler/aslopcodes.c
  head/sys/contrib/dev/acpica/compiler/aslopt.c
  head/sys/contrib/dev/acpica/compiler/asloptions.c
  head/sys/contrib/dev/acpica/compiler/aslstartup.c
  head/sys/contrib/dev/acpica/compiler/aslstubs.c
  head/sys/contrib/dev/acpica/compiler/asltypes.h
  head/sys/contrib/dev/acpica/compiler/aslutils.c
  head/sys/contrib/dev/acpica/compiler/aslxref.c
  head/sys/contrib/dev/acpica/compiler/dtcompiler.h
  head/sys/contrib/dev/acpica/compiler/dttable.c
  head/sys/contrib/dev/acpica/compiler/dttemplate.h
  head/sys/contrib/dev/acpica/compiler/prparser.l
  head/sys/contrib/dev/acpica/compiler/prparser.y
  head/sys/contrib/dev/acpica/compiler/prscan.c
  head/sys/contrib/dev/acpica/components/debugger/dbcmds.c
  head/sys/contrib/dev/acpica/components/debugger/dbdisply.c
  head/sys/contrib/dev/acpica/components/debugger/dbinput.c
  head/sys/contrib/dev/acpica/components/debugger/dbmethod.c
  head/sys/contrib/dev/acpica/components/debugger/dbnames.c
  head/sys/contrib/dev/acpica/components/debugger/dbutils.c
  head/sys/contrib/dev/acpica/components/debugger/dbxface.c
  head/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
  head/sys/contrib/dev/acpica/components/disassembler/dmnames.c
  head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
  head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
  head/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
  head/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
  head/sys/contrib/dev/acpica/components/dispatcher/dswload.c
  head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
  head/sys/contrib/dev/acpica/components/executer/excreate.c
  head/sys/contrib/dev/acpica/components/executer/exdebug.c
  head/sys/contrib/dev/acpica/components/executer/exdump.c
  head/sys/contrib/dev/acpica/components/namespace/nsnames.c
  head/sys/contrib/dev/acpica/components/namespace/nsparse.c
  head/sys/contrib/dev/acpica/components/namespace/nsutils.c
  head/sys/contrib/dev/acpica/components/namespace/nsxfname.c
  head/sys/contrib/dev/acpica/components/parser/psargs.c
  head/sys/contrib/dev/acpica/components/parser/psloop.c
  head/sys/contrib/dev/acpica/components/parser/psobject.c
  head/sys/contrib/dev/acpica/components/parser/psparse.c
  head/sys/contrib/dev/acpica/components/parser/psutils.c
  head/sys/contrib/dev/acpica/components/parser/psxface.c
  head/sys/contrib/dev/acpica/components/resources/rscreate.c
  head/sys/contrib/dev/acpica/components/utilities/utdebug.c
  head/sys/contrib/dev/acpica/components/utilities/utdelete.c
  head/sys/contrib/dev/acpica/components/utilities/utinit.c
  head/sys/contrib/dev/acpica/components/utilities/utmisc.c
  head/sys/contrib/dev/acpica/components/utilities/utstring.c
  head/sys/contrib/dev/acpica/include/acdebug.h
  head/sys/contrib/dev/acpica/include/acdisasm.h
  head/sys/contrib/dev/acpica/include/acdispat.h
  head/sys/contrib/dev/acpica/include/acglobal.h
  head/sys/contrib/dev/acpica/include/acinterp.h
  head/sys/contrib/dev/acpica/include/aclocal.h
  head/sys/contrib/dev/acpica/include/acmacros.h
  head/sys/contrib/dev/acpica/include/acnamesp.h
  head/sys/contrib/dev/acpica/include/acobject.h
  head/sys/contrib/dev/acpica/include/acoutput.h
  head/sys/contrib/dev/acpica/include/acparser.h
  head/sys/contrib/dev/acpica/include/acpiosxf.h
  head/sys/contrib/dev/acpica/include/acpixf.h
  head/sys/contrib/dev/acpica/include/acstruct.h
  head/sys/contrib/dev/acpica/include/actbl2.h
  head/sys/contrib/dev/acpica/include/actypes.h
  head/sys/contrib/dev/acpica/include/acutils.h
  head/sys/contrib/dev/acpica/include/platform/acenvex.h
  head/usr.sbin/acpi/acpidb/Makefile
  head/usr.sbin/acpi/iasl/Makefile
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/conf/files	Wed Jul 22 16:25:07 2015	(r285797)
@@ -284,6 +284,7 @@ contrib/dev/acpica/components/debugger/d
 contrib/dev/acpica/components/debugger/dbinput.c	optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbmethod.c	optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbnames.c	optional acpi acpi_debug
+contrib/dev/acpica/components/debugger/dbobject.c	optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbstats.c	optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbtest.c		optional acpi acpi_debug
 contrib/dev/acpica/components/debugger/dbutils.c	optional acpi acpi_debug
@@ -293,7 +294,6 @@ contrib/dev/acpica/components/disassembl
 contrib/dev/acpica/components/disassembler/dmdeferred.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmnames.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmopcode.c	optional acpi acpi_debug
-contrib/dev/acpica/components/disassembler/dmobject.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmresrc.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmresrcl.c	optional acpi acpi_debug
 contrib/dev/acpica/components/disassembler/dmresrcl2.c	optional acpi acpi_debug
@@ -302,6 +302,7 @@ contrib/dev/acpica/components/disassembl
 contrib/dev/acpica/components/disassembler/dmwalk.c	optional acpi acpi_debug
 contrib/dev/acpica/components/dispatcher/dsargs.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dscontrol.c	optional acpi
+contrib/dev/acpica/components/dispatcher/dsdebug.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dsfield.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dsinit.c	optional acpi
 contrib/dev/acpica/components/dispatcher/dsmethod.c	optional acpi
@@ -437,6 +438,7 @@ contrib/dev/acpica/components/utilities/
 contrib/dev/acpica/components/utilities/utmath.c	optional acpi
 contrib/dev/acpica/components/utilities/utmisc.c	optional acpi
 contrib/dev/acpica/components/utilities/utmutex.c	optional acpi
+contrib/dev/acpica/components/utilities/utnonansi.c	optional acpi
 contrib/dev/acpica/components/utilities/utobject.c	optional acpi
 contrib/dev/acpica/components/utilities/utosi.c		optional acpi
 contrib/dev/acpica/components/utilities/utownerid.c	optional acpi

Modified: head/sys/contrib/dev/acpica/acpica_prep.sh
==============================================================================
--- head/sys/contrib/dev/acpica/acpica_prep.sh	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/acpica_prep.sh	Wed Jul 22 16:25:07 2015	(r285797)
@@ -20,10 +20,10 @@ fulldirs="common compiler components inc
 stripdirs="generate libraries tests tools"
 stripfiles="Makefile README accygwin.h acdragonfly.h acdragonflyex.h	\
 	acefi.h acefiex.h achaiku.h acintel.h aclinux.h aclinuxex.h	\
-	acmacosx.h acmsvc.h acnetbsd.h acos2.h acwin.h acwin64.h	\
-	new_table.txt osbsdtbl.c osefitbl.c osefixf.c osfreebsdtbl.c	\
-	oslinuxtbl.c osunixdir.c osunixmap.c oswindir.c oswintbl.c	\
-	oswinxf.c readme.txt utclib.c"
+	acmacosx.h acmsvc.h acmsvcex.h acnetbsd.h acos2.h acwin.h	\
+	acwin64.h acwinex.h new_table.txt osbsdtbl.c osefitbl.c		\
+	osefixf.c osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c	\
+	oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c"
 
 # include files to canonify
 src_headers="acapps.h acbuffer.h acclib.h accommon.h acconfig.h		\

Modified: head/sys/contrib/dev/acpica/changes.txt
==============================================================================
--- head/sys/contrib/dev/acpica/changes.txt	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/changes.txt	Wed Jul 22 16:25:07 2015	(r285797)
@@ -1,4 +1,87 @@
 ----------------------------------------
+17 July 2015. Summary of changes for version 20150717:
+
+1) ACPICA kernel-resident subsystem:
+
+Improved the partitioning between the Debugger and Disassembler 
+components. This allows the Debugger to be used standalone within kernel 
+code without the Disassembler (which is used for single stepping also). 
+This renames and moves one file, dmobject.c to dbobject.c. Lv Zheng.
+
+Debugger: Implemented a new command to trace the execution of control 
+methods (Trace). This is especially useful for the in-kernel version of 
+the debugger when file I/O may not be available for method trace output. 
+See the ACPICA reference for more information. Lv Zheng.
+
+Moved all C library prototypes (used for the local versions of these 
+functions when requested) to a new header, acclib.h
+Cleaned up the use of non-ANSI C library functions. These functions are 
+implemented locally in ACPICA. Moved all such functions to a common 
+source file, utnonansi.c
+
+Debugger: Fixed a problem with the "!!" command (get last command 
+executed) where the debugger could enter an infinite loop and eventually 
+crash.
+
+Removed the use of local macros that were used for some of the standard C 
+library functions to automatically cast input parameters. This mostly 
+affected the is* functions where the input parameter is defined to be an 
+int. This required a few modifications to the main ACPICA source code to 
+provide casting for these functions and eliminate possible compiler 
+warnings for these parameters.
+
+Across the source code, added additional status/error checking to resolve 
+issues discovered by static source code analysis tools such as Coverity.
+
+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.
+
+  Current Release:
+    Non-Debug Version: 100.9K Code, 24.5K Data, 125.4K Total
+    Debug Version:     197.8K Code, 81.5K Data, 279.3K Total
+  Previous Release:
+    Non-Debug Version: 100.6K Code, 27.6K Data, 128.2K Total
+    Debug Version:     196.2K Code, 81.0K Data, 277.2K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Fixed a regression where the device map file feature no longer 
+worked properly when used in conjunction with the disassembler. It only 
+worked properly with the compiler itself.
+
+iASL: Implemented a new warning for method LocalX variables that are set 
+but never used (similar to a C compiler such as gcc). This also applies 
+to ArgX variables that are not defined by the parent method, and are 
+instead (legally) used as local variables.
+
+iASL/Preprocessor: Finished the pass-through of line numbers from the 
+preprocessor to the compiler. This ensures that compiler errors/warnings 
+have the correct original line numbers and filenames, regardless of any 
+#include files.
+
+iASL/Preprocessor: Fixed a couple of issues with comment handling and the 
+pass-through of comments to the preprocessor output file (which becomes 
+the compiler input file). Also fixed a problem with // comments that 
+appear after a math expression.
+
+iASL: Added support for the TCPA server table to the table compiler and 
+template generator. (The client table was already previously supported)
+
+iASL/Preprocessor: Added a permanent #define of the symbol "__IASL__" to 
+identify the iASL compiler.
+
+Cleaned up the use of the macros NEGATIVE and POSITIVE which were defined 
+multiple times. The new names are ACPI_SIGN_NEGATIVE and 
+ACPI_SIGN_POSITIVE.
+
+AcpiHelp: Update to expand help messages for the iASL preprocessor 
+directives.
+
+
+----------------------------------------
 19 June 2015. Summary of changes for version 20150619:
 
 Two regressions in version 20150616 have been addressed:

Modified: head/sys/contrib/dev/acpica/common/adisasm.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/adisasm.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/common/adisasm.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -187,6 +187,7 @@ AdInitialize (
     AcpiGbl_RootTableList.CurrentTableCount = 0;
     AcpiGbl_RootTableList.Tables = LocalTables;
 
+    AcpiGbl_PreviousOp = NULL;
     return (Status);
 }
 
@@ -796,8 +797,8 @@ AdStoreTable (
 
     AcpiTbInitTableDescriptor (TableDesc, ACPI_PTR_TO_PHYSADDR (Table),
         ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, Table);
-    AcpiTbValidateTable (TableDesc);
-    return (AE_OK);
+    Status = AcpiTbValidateTable (TableDesc);
+    return (Status);
 }
 
 
@@ -892,7 +893,7 @@ AdParseTable (
 
     /* Create the root object */
 
-    AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp ();
+    AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp (AmlStart);
     if (!AcpiGbl_ParseOpRoot)
     {
         return (AE_NO_MEMORY);

Modified: head/sys/contrib/dev/acpica/common/dmrestag.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/dmrestag.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/common/dmrestag.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -650,7 +650,7 @@ AcpiGetTagPathname (
 
     /* Get the full pathname to the parent buffer */
 
-    RequiredSize = AcpiNsGetPathnameLength (BufferNode);
+    RequiredSize = AcpiNsBuildNormalizedPath (BufferNode, NULL, 0, FALSE);
     if (!RequiredSize)
     {
         return (NULL);
@@ -662,12 +662,8 @@ AcpiGetTagPathname (
         return (NULL);
     }
 
-    Status = AcpiNsBuildExternalPath (BufferNode, RequiredSize, Pathname);
-    if (ACPI_FAILURE (Status))
-    {
-        ACPI_FREE (Pathname);
-        return (NULL);
-    }
+    (void) AcpiNsBuildNormalizedPath (BufferNode, Pathname,
+            RequiredSize, FALSE);
 
     /*
      * Create the full path to the resource and tag by: remove the buffer name,

Modified: head/sys/contrib/dev/acpica/common/dmtable.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/dmtable.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/common/dmtable.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -368,7 +368,7 @@ const ACPI_DMTABLE_DATA     AcpiDmTableD
     {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi,    NULL,           NULL,           TemplateSpmi},
     {ACPI_SIG_SRAT, NULL,                   AcpiDmDumpSrat, DtCompileSrat,  TemplateSrat},
     {ACPI_SIG_STAO, NULL,                   AcpiDmDumpStao, DtCompileStao,  TemplateStao},
-    {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa,    NULL,           NULL,           TemplateTcpa},
+    {ACPI_SIG_TCPA, NULL,                   AcpiDmDumpTcpa, DtCompileTcpa,  TemplateTcpa},
     {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2,    NULL,           NULL,           TemplateTpm2},
     {ACPI_SIG_UEFI, AcpiDmTableInfoUefi,    NULL,           DtCompileUefi,  TemplateUefi},
     {ACPI_SIG_VRTC, AcpiDmTableInfoVrtc,    AcpiDmDumpVrtc, DtCompileVrtc,  TemplateVrtc},
@@ -500,7 +500,11 @@ AcpiDmDumpDataTable (
     if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS))
     {
         Length = Table->Length;
-        AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
+        Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
     }
     else if (ACPI_VALIDATE_RSDP_SIG (Table->Signature))
     {
@@ -561,7 +565,11 @@ AcpiDmDumpDataTable (
         {
             /* Simple table, just walk the info table */
 
-            AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo);
+            Status = AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo);
+            if (ACPI_FAILURE (Status))
+            {
+                return;
+            }
         }
     }
 
@@ -720,6 +728,7 @@ AcpiDmDumpTable (
     const AH_TABLE          *TableData;
     const char              *Name;
     BOOLEAN                 LastOutputBlankLine = FALSE;
+    ACPI_STATUS             Status;
     char                    RepairedName[8];
 
 
@@ -1114,8 +1123,13 @@ AcpiDmDumpTable (
             /* Generic Address Structure */
 
             AcpiOsPrintf (STRING_FORMAT, "Generic Address Structure");
-            AcpiDmDumpTable (TableLength, CurrentOffset, Target,
+            Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
                 sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas);
+            if (ACPI_FAILURE (Status))
+            {
+                return (Status);
+            }
+
             AcpiOsPrintf ("\n");
             LastOutputBlankLine = TRUE;
             break;
@@ -1250,8 +1264,13 @@ AcpiDmDumpTable (
             AcpiOsPrintf (STRING_FORMAT,
                 "Hardware Error Notification Structure");
 
-            AcpiDmDumpTable (TableLength, CurrentOffset, Target,
+            Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
                 sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);
+            if (ACPI_FAILURE (Status))
+            {
+                return (Status);
+            }
+
             AcpiOsPrintf ("\n");
             LastOutputBlankLine = TRUE;
             break;
@@ -1275,8 +1294,13 @@ AcpiDmDumpTable (
             AcpiOsPrintf (STRING_FORMAT,
                 "IORT Memory Access Properties");
 
-            AcpiDmDumpTable (TableLength, CurrentOffset, Target,
+            Status = AcpiDmDumpTable (TableLength, CurrentOffset, Target,
                 sizeof (ACPI_IORT_MEMORY_ACCESS), AcpiDmTableInfoIortAcc);
+            if (ACPI_FAILURE (Status))
+            {
+                return (Status);
+            }
+
             LastOutputBlankLine = TRUE;
             break;
 

Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/dmtbdump.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/common/dmtbdump.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -208,11 +208,16 @@ AcpiDmDumpRsdp (
     ACPI_TABLE_RSDP         *Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table);
     UINT32                  Length = sizeof (ACPI_RSDP_COMMON);
     UINT8                   Checksum;
+    ACPI_STATUS             Status;
 
 
     /* Dump the common ACPI 1.0 portion */
 
-    AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1);
+    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1);
+    if (ACPI_FAILURE (Status))
+    {
+        return (Length);
+    }
 
     /* Validate the first checksum */
 
@@ -229,7 +234,11 @@ AcpiDmDumpRsdp (
     if (Rsdp->Revision > 0)
     {
         Length = Rsdp->Length;
-        AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2);
+        Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2);
+        if (ACPI_FAILURE (Status))
+        {
+            return (Length);
+        }
 
         /* Validate the extended checksum over entire RSDP */
 
@@ -347,37 +356,59 @@ void
 AcpiDmDumpFadt (
     ACPI_TABLE_HEADER       *Table)
 {
+    ACPI_STATUS             Status;
+
 
     /* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */
 
-    AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt1);
+    Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt1);
+    if (ACPI_FAILURE (Status))
+    {
+        return;
+    }
 
     /* Check for FADT revision 2 fields (ACPI 1.0B MS extensions) */
 
     if ((Table->Length > ACPI_FADT_V1_SIZE) &&
         (Table->Length <= ACPI_FADT_V2_SIZE))
     {
-        AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2);
+        Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
     }
 
     /* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */
 
     else if (Table->Length > ACPI_FADT_V2_SIZE)
     {
-        AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3);
+        Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
 
         /* Check for FADT revision 5 fields and up (ACPI 5.0+) */
 
         if (Table->Length > ACPI_FADT_V3_SIZE)
         {
-            AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5);
+            Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5);
+            if (ACPI_FAILURE (Status))
+            {
+                return;
+            }
         }
 
         /* Check for FADT revision 6 fields and up (ACPI 6.0+) */
 
         if (Table->Length > ACPI_FADT_V3_SIZE)
         {
-            AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt6);
+            Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt6);
+            if (ACPI_FAILURE (Status))
+            {
+                return;
+            }
         }
     }
 
@@ -1136,7 +1167,7 @@ AcpiDmDumpDrtm (
                 AcpiDmTableInfoDrtm1);
     if (ACPI_FAILURE (Status))
     {
-            return;
+        return;
     }
 
     Offset += ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources);
@@ -1164,13 +1195,9 @@ AcpiDmDumpDrtm (
 
     DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
     AcpiOsPrintf ("\n");
-    Status = AcpiDmDumpTable (Table->Length, Offset,
+    (void) AcpiDmDumpTable (Table->Length, Offset,
                 DrtmDps, sizeof (ACPI_DRTM_DPS_ID),
                 AcpiDmTableInfoDrtm2);
-    if (ACPI_FAILURE (Status))
-    {
-        return;
-    }
 }
 
 
@@ -1794,6 +1821,10 @@ AcpiDmDumpIort (
                 Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
                             ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
                             Length, AcpiDmTableInfoIort3a);
+                if (ACPI_FAILURE (Status))
+                {
+                    return;
+                }
 
                 NodeOffset = IortSmmu->ContextInterruptOffset;
                 for (i = 0; i < IortSmmu->ContextInterruptCount; i++)
@@ -1801,6 +1832,10 @@ AcpiDmDumpIort (
                     Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
                                 ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
                                 8, AcpiDmTableInfoIort3b);
+                    if (ACPI_FAILURE (Status))
+                    {
+                        return;
+                    }
                     NodeOffset += 8;
                 }
 
@@ -1810,6 +1845,10 @@ AcpiDmDumpIort (
                     Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
                                 ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
                                 8, AcpiDmTableInfoIort3c);
+                    if (ACPI_FAILURE (Status))
+                    {
+                        return;
+                    }
                     NodeOffset += 8;
                 }
             }
@@ -1830,6 +1869,10 @@ AcpiDmDumpIort (
             Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
                         ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
                         Length, AcpiDmTableInfoIortMap);
+            if (ACPI_FAILURE (Status))
+            {
+                return;
+            }
             NodeOffset += Length;
         }
 
@@ -2004,6 +2047,10 @@ AcpiDmDumpIvrs (
 
                 Status = AcpiDmDumpTable (Table->Length, EntryOffset,
                             DeviceEntry, EntryLength, InfoTable);
+                if (ACPI_FAILURE (Status))
+                {
+                    return;
+                }
 
                 EntryOffset += EntryLength;
                 DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry,
@@ -2687,6 +2734,11 @@ AcpiDmDumpNfit (
                 Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
                             &Interleave->LineOffset[i],
                             sizeof (UINT32), AcpiDmTableInfoNfit2a);
+                if (ACPI_FAILURE (Status))
+                {
+                    return;
+                }
+
                 FieldOffset += sizeof (UINT32);
             }
             break;
@@ -2715,6 +2767,11 @@ AcpiDmDumpNfit (
                 Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
                             &Hint->HintAddress[i],
                             sizeof (UINT64), AcpiDmTableInfoNfit6a);
+                if (ACPI_FAILURE (Status))
+                {
+                    return;
+                }
+
                 FieldOffset += sizeof (UINT64);
             }
             break;
@@ -3126,7 +3183,7 @@ void
 AcpiDmDumpSlic (
     ACPI_TABLE_HEADER       *Table)
 {
-    AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
+    (void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
                 Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
 }
 
@@ -3358,6 +3415,77 @@ AcpiDmDumpStao (
 
 /*******************************************************************************
  *
+ * FUNCTION:    AcpiDmDumpTcpa
+ *
+ * PARAMETERS:  Table               - A TCPA table
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Format the contents of a TCPA.
+ *
+ * NOTE:        There are two versions of the table with the same signature:
+ *              the client version and the server version. The common
+ *              PlatformClass field is used to differentiate the two types of
+ *              tables.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpTcpa (
+    ACPI_TABLE_HEADER       *Table)
+{
+    UINT32                  Offset = sizeof (ACPI_TABLE_TCPA_HDR);
+    ACPI_TABLE_TCPA_HDR     *CommonHeader = ACPI_CAST_PTR (
+                                ACPI_TABLE_TCPA_HDR, Table);
+    ACPI_TABLE_TCPA_HDR     *SubTable = ACPI_ADD_PTR (
+                                ACPI_TABLE_TCPA_HDR, Table, Offset);
+    ACPI_STATUS             Status;
+
+
+    /* Main table */
+
+    Status = AcpiDmDumpTable (Table->Length, 0, Table,
+        0, AcpiDmTableInfoTcpaHdr);
+    if (ACPI_FAILURE (Status))
+    {
+        return;
+    }
+
+    /*
+     * Examine the PlatformClass field to determine the table type.
+     * Either a client or server table. Only one.
+     */
+    switch (CommonHeader->PlatformClass)
+    {
+    case ACPI_TCPA_CLIENT_TABLE:
+
+        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
+            Table->Length - Offset, AcpiDmTableInfoTcpaClient);
+        break;
+
+    case ACPI_TCPA_SERVER_TABLE:
+
+        Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
+            Table->Length - Offset, AcpiDmTableInfoTcpaServer);
+        break;
+
+    default:
+
+        AcpiOsPrintf ("\n**** Unknown TCPA Platform Class 0x%X\n",
+            CommonHeader->PlatformClass);
+        Status = AE_ERROR;
+        break;
+    }
+
+    if (ACPI_FAILURE (Status))
+    {
+        AcpiOsPrintf ("\n**** Cannot disassemble TCPA table\n");
+    }
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    AcpiDmDumpVrtc
  *
  * PARAMETERS:  Table               - A VRTC table
@@ -3497,10 +3625,6 @@ AcpiDmDumpWpbt (
 
     /* Dump the arguments buffer */
 
-    AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,
+    (void) AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,
         AcpiDmTableInfoWpbt0);
-    if (ACPI_FAILURE (Status))
-    {
-        return;
-    }
 }

Modified: head/sys/contrib/dev/acpica/common/dmtbinfo.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/dmtbinfo.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/common/dmtbinfo.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -113,7 +113,7 @@
 #define ACPI_SPMI_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f)
 #define ACPI_SRAT_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_SRAT,f)
 #define ACPI_STAO_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_STAO,f)
-#define ACPI_TCPA_CLIENT_OFFSET(f)      (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_CLIENT,f)
+#define ACPI_TCPA_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_HDR,f)
 #define ACPI_TPM2_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM2,f)
 #define ACPI_UEFI_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f)
 #define ACPI_WAET_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f)
@@ -230,6 +230,8 @@
 #define ACPI_SRAT1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
 #define ACPI_SRAT2_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f)
 #define ACPI_SRAT3_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_SRAT_GICC_AFFINITY,f)
+#define ACPI_TCPA_CLIENT_OFFSET(f)      (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_CLIENT,f)
+#define ACPI_TCPA_SERVER_OFFSET(f)      (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_SERVER,f)
 #define ACPI_VRTC0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_VRTC_ENTRY,f)
 #define ACPI_WDAT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f)
 
@@ -2613,16 +2615,53 @@ ACPI_DMTABLE_INFO           AcpiDmTableI
  *
  * TCPA - Trusted Computing Platform Alliance table (Client)
  *
+ * NOTE: There are two versions of the table with the same signature --
+ * the client version and the server version. The common PlatformClass
+ * field is used to differentiate the two types of tables.
+ *
  ******************************************************************************/
 
-ACPI_DMTABLE_INFO           AcpiDmTableInfoTcpa[] =
+ACPI_DMTABLE_INFO           AcpiDmTableInfoTcpaHdr[] =
+{
+    {ACPI_DMT_UINT16,   ACPI_TCPA_OFFSET (PlatformClass),           "Platform Class", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoTcpaClient[] =
 {
-    {ACPI_DMT_UINT16,   ACPI_TCPA_CLIENT_OFFSET (PlatformClass),    "Platform Class", 0},
     {ACPI_DMT_UINT32,   ACPI_TCPA_CLIENT_OFFSET (MinimumLogLength), "Min Event Log Length", 0},
     {ACPI_DMT_UINT64,   ACPI_TCPA_CLIENT_OFFSET (LogAddress),       "Event Log Address", 0},
     ACPI_DMT_TERMINATOR
 };
 
+ACPI_DMTABLE_INFO           AcpiDmTableInfoTcpaServer[] =
+{
+    {ACPI_DMT_UINT16,   ACPI_TCPA_SERVER_OFFSET (Reserved),         "Reserved", 0},
+    {ACPI_DMT_UINT64,   ACPI_TCPA_SERVER_OFFSET (MinimumLogLength), "Min Event Log Length", 0},
+    {ACPI_DMT_UINT64,   ACPI_TCPA_SERVER_OFFSET (LogAddress),       "Event Log Address", 0},
+    {ACPI_DMT_UINT16,   ACPI_TCPA_SERVER_OFFSET (SpecRevision),     "Specification Revision", 0},
+    {ACPI_DMT_UINT8,    ACPI_TCPA_SERVER_OFFSET (DeviceFlags),      "Device Flags (decoded below)", DT_FLAG},
+    {ACPI_DMT_FLAG0,    ACPI_TCPA_SERVER_OFFSET (DeviceFlags),      "Pci Device", 0},
+    {ACPI_DMT_FLAG1,    ACPI_TCPA_SERVER_OFFSET (DeviceFlags),      "Bus is Pnp", 0},
+    {ACPI_DMT_FLAG2,    ACPI_TCPA_SERVER_OFFSET (DeviceFlags),      "Address Valid", 0},
+    {ACPI_DMT_UINT8,    ACPI_TCPA_SERVER_OFFSET (InterruptFlags),   "Interrupt Flags (decoded below)", DT_FLAG},
+    {ACPI_DMT_FLAG0,    ACPI_TCPA_SERVER_OFFSET (InterruptFlags),   "Mode", 0},
+    {ACPI_DMT_FLAG1,    ACPI_TCPA_SERVER_OFFSET (InterruptFlags),   "Polarity", 0},
+    {ACPI_DMT_FLAG2,    ACPI_TCPA_SERVER_OFFSET (InterruptFlags),   "GPE SCI Triggered", 0},
+    {ACPI_DMT_FLAG3,    ACPI_TCPA_SERVER_OFFSET (InterruptFlags),   "Global System Interrupt", 0},
+    {ACPI_DMT_UINT8,    ACPI_TCPA_SERVER_OFFSET (GpeNumber),        "Gpe Number", 0},
+    {ACPI_DMT_UINT24,   ACPI_TCPA_SERVER_OFFSET (Reserved2[0]),     "Reserved", 0},
+    {ACPI_DMT_UINT32,   ACPI_TCPA_SERVER_OFFSET (GlobalInterrupt),  "Global Interrupt", 0},
+    {ACPI_DMT_GAS,      ACPI_TCPA_SERVER_OFFSET (Address),          "Address", 0},
+    {ACPI_DMT_UINT32,   ACPI_TCPA_SERVER_OFFSET (Reserved3),        "Reserved", 0},
+    {ACPI_DMT_GAS,      ACPI_TCPA_SERVER_OFFSET (ConfigAddress),    "Configuration Address", 0},
+    {ACPI_DMT_UINT8,    ACPI_TCPA_SERVER_OFFSET (Group),            "Pci Group", 0},
+    {ACPI_DMT_UINT8,    ACPI_TCPA_SERVER_OFFSET (Bus),              "Pci Bus", 0},
+    {ACPI_DMT_UINT8,    ACPI_TCPA_SERVER_OFFSET (Device),           "Pci Device", 0},
+    {ACPI_DMT_UINT8,    ACPI_TCPA_SERVER_OFFSET (Function),         "Pci Function", 0},
+    ACPI_DMT_TERMINATOR
+};
+
 
 /*******************************************************************************
  *

Modified: head/sys/contrib/dev/acpica/compiler/aslascii.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslascii.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/compiler/aslascii.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -177,6 +177,11 @@ FlCheckForAscii (
     /* Open file in text mode so file offset is always accurate */
 
     Handle = fopen (Filename, "rb");
+    if (!Handle)
+    {
+        perror ("Could not open input file");
+        return (AE_ERROR);
+    }
 
     Status.Line = 1;
     Status.Offset = 0;

Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslcompile.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/compiler/aslcompile.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -100,6 +100,10 @@ CmDoCompile (
     Event = UtBeginEvent ("Preprocess input file");
     if (Gbl_PreprocessFlag)
     {
+        /* Enter compiler name as a #define */
+
+        PrAddDefine (ASL_DEFINE, "", FALSE);
+
         /* Preprocessor */
 
         PrDoPreprocess ();

Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/asldefine.h	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/compiler/asldefine.h	Wed Jul 22 16:25:07 2015	(r285797)
@@ -52,6 +52,7 @@
 #define AML_DISASSEMBLER_NAME       "AML/ASL+ Disassembler"
 #define ASL_INVOCATION_NAME         "iasl"
 #define ASL_CREATOR_ID              "INTL"
+#define ASL_DEFINE                  "__IASL__"
 
 #define ASL_COMPLIANCE              "Supports ACPI Specification Revision 6.0"
 
@@ -155,12 +156,6 @@
 #define ACPI_COMPILER_RESERVED_NAME     (ACPI_UINT32_MAX - 3)
 
 
-/* String to Integer conversion */
-
-#define NEGATIVE                    1
-#define POSITIVE                    0
-
-
 /* Helper macros for resource tag creation */
 
 #define RsCreateMultiBitField \

Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslfiles.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/compiler/aslfiles.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -546,6 +546,26 @@ FlOpenMiscOutputFiles (
     char                    *Filename;
 
 
+     /* Create/Open a map file if requested */
+
+    if (Gbl_MapfileFlag)
+    {
+        Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_MAP);
+        if (!Filename)
+        {
+            AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
+                0, 0, 0, 0, NULL, NULL);
+            return (AE_ERROR);
+        }
+
+        /* Open the hex file, text mode (closed at compiler exit) */
+
+        FlOpenFile (ASL_FILE_MAP_OUTPUT, Filename, "w+t");
+
+        AslCompilerSignon (ASL_FILE_MAP_OUTPUT);
+        AslCompilerFileHeader (ASL_FILE_MAP_OUTPUT);
+    }
+
     /* All done for disassembler */
 
     if (Gbl_FileType == ASL_INPUT_TYPE_ACPI_TABLE)
@@ -812,26 +832,6 @@ FlOpenMiscOutputFiles (
         AslCompilerFileHeader (ASL_FILE_NAMESPACE_OUTPUT);
     }
 
-    /* Create/Open a map file if requested */
-
-    if (Gbl_MapfileFlag)
-    {
-        Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_MAP);
-        if (!Filename)
-        {
-            AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
-                0, 0, 0, 0, NULL, NULL);
-            return (AE_ERROR);
-        }
-
-        /* Open the hex file, text mode (closed at compiler exit) */
-
-        FlOpenFile (ASL_FILE_MAP_OUTPUT, Filename, "w+t");
-
-        AslCompilerSignon (ASL_FILE_MAP_OUTPUT);
-        AslCompilerFileHeader (ASL_FILE_MAP_OUTPUT);
-    }
-
     return (AE_OK);
 }
 

Modified: head/sys/contrib/dev/acpica/compiler/asllookup.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/asllookup.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/compiler/asllookup.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -119,8 +119,73 @@ LkIsObjectUsed (
 {
     ACPI_NAMESPACE_NODE     *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
     ACPI_NAMESPACE_NODE     *Next;
+    ASL_METHOD_LOCAL        *MethodLocals;
+    ASL_METHOD_LOCAL        *MethodArgs;
+    UINT32                  i;
 
 
+    if (Node->Type == ACPI_TYPE_METHOD)
+    {
+        if (!Node->Op || !Node->MethodLocals)
+        {
+            return (AE_OK);
+        }
+
+        MethodLocals = (ASL_METHOD_LOCAL *) Node->MethodLocals;
+        MethodArgs = (ASL_METHOD_LOCAL *) Node->MethodArgs;
+
+        /*
+         * Analysis of LocalX variables
+         */
+        for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++)
+        {
+            /* Warn for Locals that are set but never referenced */
+
+            if ((MethodLocals[i].Flags & ASL_LOCAL_INITIALIZED) &&
+                (!(MethodLocals[i].Flags & ASL_LOCAL_REFERENCED)))
+            {
+                sprintf (MsgBuffer, "Local%u", i);
+                AslError (ASL_WARNING, ASL_MSG_LOCAL_NOT_USED,
+                    MethodLocals[i].Op, MsgBuffer);
+            }
+        }
+
+        /*
+         * Analysis of ArgX variables (standard method arguments,
+         * and remaining unused ArgX can also be used as locals)
+         */
+        for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++)
+        {
+            if (MethodArgs[i].Flags & ASL_ARG_IS_LOCAL)
+            {
+                /* Warn if ArgX is being used as a local, but not referenced */
+
+                if ((MethodArgs[i].Flags & ASL_ARG_INITIALIZED) &&
+                    (!(MethodArgs[i].Flags & ASL_ARG_REFERENCED)))
+                {
+                    sprintf (MsgBuffer, "Arg%u", i);
+                    AslError (ASL_WARNING, ASL_MSG_ARG_AS_LOCAL_NOT_USED,
+                        MethodArgs[i].Op, MsgBuffer);
+                }
+            }
+            else
+            {
+                /*
+                 * Remark if a normal method ArgX is not referenced.
+                 * We ignore the predefined methods since often, not
+                 * all arguments are needed or used.
+                 */
+                if ((Node->Name.Ascii[0] != '_') &&
+                    (!(MethodArgs[i].Flags & ASL_ARG_REFERENCED)))
+                {
+                    sprintf (MsgBuffer, "Arg%u", i);
+                    AslError (ASL_REMARK, ASL_MSG_ARG_NOT_USED,
+                        MethodArgs[i].Op, MsgBuffer);
+                }
+            }
+        }
+    }
+
     /* Referenced flag is set during the namespace xref */
 
     if (Node->Flags & ANOBJ_IS_REFERENCED)

Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslmessages.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/compiler/aslmessages.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -235,7 +235,11 @@ const char                      *AslComp
 /*    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_METHOD_REF */         "Illegal reference across two methods",
+/*    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"
+
 };
 
 /* Table compiler */

Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslmessages.h	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/compiler/aslmessages.h	Wed Jul 22 16:25:07 2015	(r285797)
@@ -238,6 +238,9 @@ typedef enum
     ASL_MSG_MISSING_DEPENDENCY,
     ASL_MSG_ILLEGAL_FORWARD_REF,
     ASL_MSG_ILLEGAL_METHOD_REF,
+    ASL_MSG_LOCAL_NOT_USED,
+    ASL_MSG_ARG_AS_LOCAL_NOT_USED,
+    ASL_MSG_ARG_NOT_USED,
 
     /* These messages are used by the Data Table compiler only */
 

Modified: head/sys/contrib/dev/acpica/compiler/aslmethod.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslmethod.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/compiler/aslmethod.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -255,7 +255,7 @@ MtMethodAnalysisWalkBegin (
             return (AE_ERROR);
         }
 
-        RegisterNumber = (Op->Asl.AmlOpcode & 0x000F);
+        RegisterNumber = (Op->Asl.AmlOpcode & 0x0007);
 
         /*
          * If the local is being used as a target, mark the local

Modified: head/sys/contrib/dev/acpica/compiler/aslnamesp.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslnamesp.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/compiler/aslnamesp.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -409,7 +409,7 @@ NsDoOnePathname (
 
 
     TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
-    Status = AcpiNsHandleToPathname (Node, &TargetPath);
+    Status = AcpiNsHandleToPathname (Node, &TargetPath, FALSE);
     if (ACPI_FAILURE (Status))
     {
         return (Status);

Modified: head/sys/contrib/dev/acpica/compiler/asloffset.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/asloffset.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/compiler/asloffset.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -363,7 +363,7 @@ LsEmitOffsetTableEntry (
     /* Get the full pathname to the namespace node */
 
     TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
-    Status = AcpiNsHandleToPathname (Node, &TargetPath);
+    Status = AcpiNsHandleToPathname (Node, &TargetPath, FALSE);
     if (ACPI_FAILURE (Status))
     {
         return;

Modified: head/sys/contrib/dev/acpica/compiler/aslopcodes.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslopcodes.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/compiler/aslopcodes.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -791,43 +791,6 @@ OpcEncodePldBuffer (
 
 /*******************************************************************************
  *
- * FUNCTION:    OpcStrupr (strupr)
- *
- * PARAMETERS:  SrcString           - The source string to convert
- *
- * RETURN:      None
- *
- * DESCRIPTION: Convert string to uppercase
- *
- * NOTE: This is not a POSIX function, so it appears here, not in utclib.c
- *
- ******************************************************************************/
-
-static void
-OpcStrupr (
-    char                    *SrcString)
-{
-    char                    *String;
-
-
-    if (!SrcString)
-    {
-        return;
-    }
-
-    /* Walk entire string, uppercasing the letters */
-
-    for (String = SrcString; *String; String++)
-    {
-        *String = (char) toupper ((int) *String);
-    }
-
-    return;
-}
-
-
-/*******************************************************************************
- *
  * FUNCTION:    OpcFindName
  *
  * PARAMETERS:  List                - Array of char strings to be searched
@@ -851,7 +814,7 @@ OpcFindName (
     UINT32                   i;
 
 
-    OpcStrupr (Name);
+    AcpiUtStrupr (Name);
 
     for (i = 0, Str = List[0]; Str; i++, Str = List[i])
     {
@@ -900,13 +863,6 @@ OpcDoPld (
         return;
     }
 
-    Buffer = UtLocalCalloc (ACPI_PLD_BUFFER_SIZE);
-    if (!Buffer)
-    {
-        AslError(ASL_ERROR, ASL_MSG_BUFFER_ALLOCATION, Op, NULL);
-        return;
-    }
-
     memset (&PldInfo, 0, sizeof (ACPI_PLD_INFO));
 
     Node = Op->Asl.Child;

Modified: head/sys/contrib/dev/acpica/compiler/aslopt.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslopt.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/compiler/aslopt.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -655,7 +655,7 @@ OptOptimizeNamePath (
      * format -- something we can easily manipulate
      */
     TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
-    Status = AcpiNsHandleToPathname (TargetNode, &TargetPath);
+    Status = AcpiNsHandleToPathname (TargetNode, &TargetPath, FALSE);
     if (ACPI_FAILURE (Status))
     {
         AslCoreSubsystemError (Op, Status, "Getting Target NamePath",
@@ -667,7 +667,7 @@ OptOptimizeNamePath (
     /* CurrentPath is the path to this scope (where we are in the namespace) */
 
     CurrentPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
-    Status = AcpiNsHandleToPathname (CurrentNode, &CurrentPath);
+    Status = AcpiNsHandleToPathname (CurrentNode, &CurrentPath, FALSE);
     if (ACPI_FAILURE (Status))
     {
         AslCoreSubsystemError (Op, Status, "Getting Current NamePath",

Modified: head/sys/contrib/dev/acpica/compiler/asloptions.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/asloptions.c	Wed Jul 22 16:10:29 2015	(r285796)
+++ head/sys/contrib/dev/acpica/compiler/asloptions.c	Wed Jul 22 16:25:07 2015	(r285797)
@@ -286,6 +286,11 @@ AslDoOptions (
             AcpiGbl_CstyleDisassembly = FALSE;
             break;
 

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


More information about the svn-src-head mailing list