From owner-svn-src-vendor@freebsd.org Mon Jul 20 22:32:01 2015 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 836F69A7408; Mon, 20 Jul 2015 22:32:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6ACE61F7F; Mon, 20 Jul 2015 22:32:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6KMW1Yh094370; Mon, 20 Jul 2015 22:32:01 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6KMVpuk094335; Mon, 20 Jul 2015 22:31:51 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201507202231.t6KMVpuk094335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 20 Jul 2015 22:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r285728 - in vendor-sys/acpica/dist: . generate/unix generate/unix/acpidump generate/unix/acpiexamples generate/unix/acpiexec generate/unix/acpihelp generate/unix/acpisrc generate/unix/... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 22:32:01 -0000 Author: jkim Date: Mon Jul 20 22:31:50 2015 New Revision: 285728 URL: https://svnweb.freebsd.org/changeset/base/285728 Log: Import ACPICA 20150717. Added: vendor-sys/acpica/dist/source/components/debugger/dbobject.c - copied, changed from r285727, vendor-sys/acpica/dist/source/components/disassembler/dmobject.c vendor-sys/acpica/dist/source/components/dispatcher/dsdebug.c (contents, props changed) vendor-sys/acpica/dist/source/components/utilities/utnonansi.c (contents, props changed) vendor-sys/acpica/dist/source/include/platform/acmsvcex.h (contents, props changed) vendor-sys/acpica/dist/source/include/platform/acwinex.h (contents, props changed) Deleted: vendor-sys/acpica/dist/source/components/disassembler/dmobject.c Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/Makefile.rules vendor-sys/acpica/dist/generate/unix/acpidump/Makefile vendor-sys/acpica/dist/generate/unix/acpiexamples/Makefile vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile vendor-sys/acpica/dist/generate/unix/acpisrc/Makefile vendor-sys/acpica/dist/generate/unix/acpixtract/Makefile vendor-sys/acpica/dist/generate/unix/iasl/Makefile vendor-sys/acpica/dist/source/common/adisasm.c vendor-sys/acpica/dist/source/common/dmrestag.c vendor-sys/acpica/dist/source/common/dmtable.c vendor-sys/acpica/dist/source/common/dmtbdump.c vendor-sys/acpica/dist/source/common/dmtbinfo.c vendor-sys/acpica/dist/source/compiler/aslascii.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/asldefine.h vendor-sys/acpica/dist/source/compiler/aslfiles.c vendor-sys/acpica/dist/source/compiler/asllookup.c vendor-sys/acpica/dist/source/compiler/aslmessages.c vendor-sys/acpica/dist/source/compiler/aslmessages.h vendor-sys/acpica/dist/source/compiler/aslmethod.c vendor-sys/acpica/dist/source/compiler/aslnamesp.c vendor-sys/acpica/dist/source/compiler/asloffset.c vendor-sys/acpica/dist/source/compiler/aslopcodes.c vendor-sys/acpica/dist/source/compiler/aslopt.c vendor-sys/acpica/dist/source/compiler/asloptions.c vendor-sys/acpica/dist/source/compiler/aslstartup.c vendor-sys/acpica/dist/source/compiler/aslstubs.c vendor-sys/acpica/dist/source/compiler/asltypes.h vendor-sys/acpica/dist/source/compiler/aslutils.c vendor-sys/acpica/dist/source/compiler/aslxref.c vendor-sys/acpica/dist/source/compiler/dtcompiler.h vendor-sys/acpica/dist/source/compiler/dttable.c vendor-sys/acpica/dist/source/compiler/dttemplate.h vendor-sys/acpica/dist/source/compiler/prparser.l vendor-sys/acpica/dist/source/compiler/prparser.y vendor-sys/acpica/dist/source/compiler/prscan.c vendor-sys/acpica/dist/source/components/debugger/dbcmds.c vendor-sys/acpica/dist/source/components/debugger/dbdisply.c vendor-sys/acpica/dist/source/components/debugger/dbinput.c vendor-sys/acpica/dist/source/components/debugger/dbmethod.c vendor-sys/acpica/dist/source/components/debugger/dbnames.c vendor-sys/acpica/dist/source/components/debugger/dbutils.c vendor-sys/acpica/dist/source/components/debugger/dbxface.c vendor-sys/acpica/dist/source/components/disassembler/dmdeferred.c vendor-sys/acpica/dist/source/components/disassembler/dmnames.c vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c vendor-sys/acpica/dist/source/components/disassembler/dmwalk.c vendor-sys/acpica/dist/source/components/dispatcher/dsargs.c vendor-sys/acpica/dist/source/components/dispatcher/dsmethod.c vendor-sys/acpica/dist/source/components/dispatcher/dswload.c vendor-sys/acpica/dist/source/components/dispatcher/dswload2.c vendor-sys/acpica/dist/source/components/executer/excreate.c vendor-sys/acpica/dist/source/components/executer/exdebug.c vendor-sys/acpica/dist/source/components/executer/exdump.c vendor-sys/acpica/dist/source/components/namespace/nsnames.c vendor-sys/acpica/dist/source/components/namespace/nsparse.c vendor-sys/acpica/dist/source/components/namespace/nsutils.c vendor-sys/acpica/dist/source/components/namespace/nsxfname.c vendor-sys/acpica/dist/source/components/parser/psargs.c vendor-sys/acpica/dist/source/components/parser/psloop.c vendor-sys/acpica/dist/source/components/parser/psobject.c vendor-sys/acpica/dist/source/components/parser/psparse.c vendor-sys/acpica/dist/source/components/parser/psutils.c vendor-sys/acpica/dist/source/components/parser/psxface.c vendor-sys/acpica/dist/source/components/resources/rscreate.c vendor-sys/acpica/dist/source/components/utilities/utclib.c vendor-sys/acpica/dist/source/components/utilities/utdebug.c vendor-sys/acpica/dist/source/components/utilities/utdelete.c vendor-sys/acpica/dist/source/components/utilities/utinit.c vendor-sys/acpica/dist/source/components/utilities/utmisc.c vendor-sys/acpica/dist/source/components/utilities/utstring.c vendor-sys/acpica/dist/source/include/acdebug.h vendor-sys/acpica/dist/source/include/acdisasm.h vendor-sys/acpica/dist/source/include/acdispat.h vendor-sys/acpica/dist/source/include/acglobal.h vendor-sys/acpica/dist/source/include/acinterp.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acmacros.h vendor-sys/acpica/dist/source/include/acnamesp.h vendor-sys/acpica/dist/source/include/acobject.h vendor-sys/acpica/dist/source/include/acoutput.h vendor-sys/acpica/dist/source/include/acparser.h vendor-sys/acpica/dist/source/include/acpiosxf.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/acstruct.h vendor-sys/acpica/dist/source/include/actbl2.h vendor-sys/acpica/dist/source/include/actypes.h vendor-sys/acpica/dist/source/include/acutils.h vendor-sys/acpica/dist/source/include/platform/acenvex.h vendor-sys/acpica/dist/source/include/platform/acmsvc.h vendor-sys/acpica/dist/source/tools/acpiexec/aetables.c vendor-sys/acpica/dist/source/tools/acpihelp/acpihelp.h vendor-sys/acpica/dist/source/tools/acpihelp/ahaslkey.c vendor-sys/acpica/dist/source/tools/acpihelp/ahdecode.c vendor-sys/acpica/dist/source/tools/acpihelp/ahmain.c vendor-sys/acpica/dist/source/tools/acpinames/anstubs.c vendor-sys/acpica/dist/source/tools/acpisrc/acpisrc.h vendor-sys/acpica/dist/source/tools/acpisrc/asconvrt.c vendor-sys/acpica/dist/source/tools/acpisrc/asfile.c vendor-sys/acpica/dist/source/tools/acpisrc/asmain.c vendor-sys/acpica/dist/source/tools/acpisrc/astable.c vendor-sys/acpica/dist/source/tools/acpisrc/asutils.c vendor-sys/acpica/dist/source/tools/acpixtract/acpixtract.c vendor-sys/acpica/dist/tests/misc/badcode.asl Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/changes.txt Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/generate/unix/Makefile.rules ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile.rules Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/generate/unix/Makefile.rules Mon Jul 20 22:31:50 2015 (r285728) @@ -18,7 +18,7 @@ $(OBJDIR)/%.o : %.c $(HEADERS) $(ACPICA_ $(COMPILEOBJ) clean : - rm -f $(PROG) $(PROG).exe $(OBJECTS) $(INTERMEDIATES) $(MISC) + rm -f $(PROG) $(PROG).exe $(OBJECTS) $(OBJDIR)/*.o $(INTERMEDIATES) $(MISC) install : $(INSTALLPROG) Modified: vendor-sys/acpica/dist/generate/unix/acpidump/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpidump/Makefile Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/generate/unix/acpidump/Makefile Mon Jul 20 22:31:50 2015 (r285728) @@ -44,6 +44,7 @@ OBJECTS = \ $(OBJDIR)/utexcep.o\ $(OBJDIR)/utglobal.o\ $(OBJDIR)/utmath.o\ + $(OBJDIR)/utnonansi.o\ $(OBJDIR)/utprint.o\ $(OBJDIR)/utstring.o\ $(OBJDIR)/utxferror.o Modified: vendor-sys/acpica/dist/generate/unix/acpiexamples/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpiexamples/Makefile Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/generate/unix/acpiexamples/Makefile Mon Jul 20 22:31:50 2015 (r285728) @@ -40,6 +40,7 @@ OBJECTS = \ $(OBJDIR)/extables.o\ $(OBJDIR)/dsargs.o\ $(OBJDIR)/dscontrol.o\ + $(OBJDIR)/dsdebug.o\ $(OBJDIR)/dsfield.o\ $(OBJDIR)/dsinit.o\ $(OBJDIR)/dsmethod.o\ @@ -148,6 +149,7 @@ OBJECTS = \ $(OBJDIR)/utobject.o\ $(OBJDIR)/utosi.o\ $(OBJDIR)/utownerid.o\ + $(OBJDIR)/utnonansi.o\ $(OBJDIR)/utpredef.o\ $(OBJDIR)/utprint.o\ $(OBJDIR)/utresrc.o\ Modified: vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Mon Jul 20 22:31:50 2015 (r285728) @@ -58,6 +58,7 @@ OBJECTS = \ $(OBJDIR)/dbinput.o\ $(OBJDIR)/dbmethod.o\ $(OBJDIR)/dbnames.o\ + $(OBJDIR)/dbobject.o\ $(OBJDIR)/dbstats.o\ $(OBJDIR)/dbtest.o\ $(OBJDIR)/dbutils.o\ @@ -66,7 +67,6 @@ OBJECTS = \ $(OBJDIR)/dmcstyle.o\ $(OBJDIR)/dmdeferred.o\ $(OBJDIR)/dmnames.o\ - $(OBJDIR)/dmobject.o\ $(OBJDIR)/dmopcode.o\ $(OBJDIR)/dmresrc.o\ $(OBJDIR)/dmresrcl.o\ @@ -76,6 +76,7 @@ OBJECTS = \ $(OBJDIR)/dmwalk.o\ $(OBJDIR)/dsargs.o\ $(OBJDIR)/dscontrol.o\ + $(OBJDIR)/dsdebug.o\ $(OBJDIR)/dsfield.o\ $(OBJDIR)/dsinit.o\ $(OBJDIR)/dsmethod.o\ @@ -218,6 +219,7 @@ OBJECTS = \ $(OBJDIR)/utobject.o\ $(OBJDIR)/utosi.o\ $(OBJDIR)/utownerid.o\ + $(OBJDIR)/utnonansi.o\ $(OBJDIR)/utpredef.o\ $(OBJDIR)/utprint.o\ $(OBJDIR)/utresrc.o\ Modified: vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile Mon Jul 20 22:31:50 2015 (r285728) @@ -45,6 +45,7 @@ OBJECTS = \ $(OBJDIR)/utglobal.o\ $(OBJDIR)/uthex.o\ $(OBJDIR)/utmath.o\ + $(OBJDIR)/utnonansi.o\ $(OBJDIR)/utpredef.o\ $(OBJDIR)/utprint.o\ $(OBJDIR)/utuuid.o Modified: vendor-sys/acpica/dist/generate/unix/acpisrc/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpisrc/Makefile Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/generate/unix/acpisrc/Makefile Mon Jul 20 22:31:50 2015 (r285728) @@ -43,7 +43,9 @@ OBJECTS = \ $(OBJDIR)/utexcep.o\ $(OBJDIR)/utglobal.o\ $(OBJDIR)/utmath.o\ + $(OBJDIR)/utnonansi.o\ $(OBJDIR)/utprint.o\ + $(OBJDIR)/utstring.o\ $(OBJDIR)/utxferror.o # Modified: vendor-sys/acpica/dist/generate/unix/acpixtract/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpixtract/Makefile Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/generate/unix/acpixtract/Makefile Mon Jul 20 22:31:50 2015 (r285728) @@ -36,6 +36,7 @@ OBJECTS = \ $(OBJDIR)/utexcep.o\ $(OBJDIR)/utglobal.o\ $(OBJDIR)/utmath.o\ + $(OBJDIR)/utnonansi.o\ $(OBJDIR)/utprint.o\ $(OBJDIR)/utxferror.o Modified: vendor-sys/acpica/dist/generate/unix/iasl/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/iasl/Makefile Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/generate/unix/iasl/Makefile Mon Jul 20 22:31:50 2015 (r285728) @@ -106,7 +106,6 @@ OBJECTS = \ $(OBJDIR)/dmdeferred.o\ $(OBJDIR)/dmextern.o\ $(OBJDIR)/dmnames.o\ - $(OBJDIR)/dmobject.o\ $(OBJDIR)/dmopcode.o\ $(OBJDIR)/dmresrc.o\ $(OBJDIR)/dmresrcl.o\ @@ -208,6 +207,7 @@ OBJECTS = \ $(OBJDIR)/utmath.o\ $(OBJDIR)/utmisc.o\ $(OBJDIR)/utmutex.o\ + $(OBJDIR)/utnonansi.o\ $(OBJDIR)/utobject.o\ $(OBJDIR)/utownerid.o\ $(OBJDIR)/utpredef.o\ Modified: vendor-sys/acpica/dist/source/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adisasm.c Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/common/adisasm.c Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/source/common/dmrestag.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmrestag.c Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/common/dmrestag.c Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/source/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtable.c Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/common/dmtable.c Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/source/common/dmtbdump.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbdump.c Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/common/dmtbdump.c Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/source/common/dmtbinfo.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbinfo.c Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/common/dmtbinfo.c Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/source/compiler/aslascii.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslascii.c Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/compiler/aslascii.c Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/source/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompile.c Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/source/compiler/asldefine.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asldefine.h Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/compiler/asldefine.h Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/source/compiler/aslfiles.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfiles.c Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/compiler/aslfiles.c Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/source/compiler/asllookup.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asllookup.c Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/compiler/asllookup.c Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/source/compiler/aslmessages.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.c Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.c Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/source/compiler/aslmessages.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.h Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.h Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/source/compiler/aslmethod.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmethod.c Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/compiler/aslmethod.c Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/source/compiler/aslnamesp.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslnamesp.c Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/compiler/aslnamesp.c Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/source/compiler/asloffset.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asloffset.c Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/compiler/asloffset.c Mon Jul 20 22:31:50 2015 (r285728) @@ -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: vendor-sys/acpica/dist/source/compiler/aslopcodes.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslopcodes.c Mon Jul 20 22:17:11 2015 (r285727) +++ vendor-sys/acpica/dist/source/compiler/aslopcodes.c Mon Jul 20 22:31:50 2015 (r285728) @@ -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; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Mon Jul 20 22:32:44 2015 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 779D99A7455; Mon, 20 Jul 2015 22:32:44 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBD81186; Mon, 20 Jul 2015 22:32:44 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6KMWibo094451; Mon, 20 Jul 2015 22:32:44 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6KMWi7Y094450; Mon, 20 Jul 2015 22:32:44 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201507202232.t6KMWi7Y094450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 20 Jul 2015 22:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r285729 - vendor-sys/acpica/20150717 X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 22:32:44 -0000 Author: jkim Date: Mon Jul 20 22:32:43 2015 New Revision: 285729 URL: https://svnweb.freebsd.org/changeset/base/285729 Log: Tag ACPICA 20150717. Added: vendor-sys/acpica/20150717/ - copied from r285728, vendor-sys/acpica/dist/