From owner-svn-src-vendor@FreeBSD.ORG Tue Jun 16 19:48:25 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D226FE31; Tue, 16 Jun 2015 19:48:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.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 BC52E2B5; Tue, 16 Jun 2015 19:48:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5GJmPQa060768; Tue, 16 Jun 2015 19:48:25 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5GJmHvR060699; Tue, 16 Jun 2015 19:48:17 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201506161948.t5GJmHvR060699@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 16 Jun 2015 19:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r284458 - in vendor-sys/acpica/dist: . source/common source/compiler source/components/debugger source/components/disassembler source/components/dispatcher source/components/events sour... 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: Tue, 16 Jun 2015 19:48:25 -0000 Author: jkim Date: Tue Jun 16 19:48:16 2015 New Revision: 284458 URL: https://svnweb.freebsd.org/changeset/base/284458 Log: Import ACPICA 20150616. Added: vendor-sys/acpica/dist/source/include/platform/acefiex.h (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/source/common/adisasm.c vendor-sys/acpica/dist/source/common/ahids.c vendor-sys/acpica/dist/source/common/ahpredef.c vendor-sys/acpica/dist/source/common/ahuuids.c vendor-sys/acpica/dist/source/common/dmextern.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/common/getopt.c vendor-sys/acpica/dist/source/compiler/aslanalyze.c vendor-sys/acpica/dist/source/compiler/aslascii.c vendor-sys/acpica/dist/source/compiler/aslcodegen.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/aslcompiler.h vendor-sys/acpica/dist/source/compiler/aslcompiler.l vendor-sys/acpica/dist/source/compiler/asldefine.h vendor-sys/acpica/dist/source/compiler/aslerror.c vendor-sys/acpica/dist/source/compiler/aslfileio.c vendor-sys/acpica/dist/source/compiler/aslfiles.c vendor-sys/acpica/dist/source/compiler/aslfold.c vendor-sys/acpica/dist/source/compiler/aslglobal.h vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/aslmapenter.c vendor-sys/acpica/dist/source/compiler/aslmapoutput.c vendor-sys/acpica/dist/source/compiler/aslmethod.c vendor-sys/acpica/dist/source/compiler/aslopcodes.c vendor-sys/acpica/dist/source/compiler/asloperands.c vendor-sys/acpica/dist/source/compiler/aslopt.c vendor-sys/acpica/dist/source/compiler/asloptions.c vendor-sys/acpica/dist/source/compiler/aslprintf.c vendor-sys/acpica/dist/source/compiler/aslstartup.c vendor-sys/acpica/dist/source/compiler/aslsupport.l vendor-sys/acpica/dist/source/compiler/asltypes.h vendor-sys/acpica/dist/source/compiler/aslutils.c vendor-sys/acpica/dist/source/compiler/asluuid.c vendor-sys/acpica/dist/source/compiler/dtcompile.c vendor-sys/acpica/dist/source/compiler/dtexpress.c vendor-sys/acpica/dist/source/compiler/dtfield.c vendor-sys/acpica/dist/source/compiler/dtio.c vendor-sys/acpica/dist/source/compiler/dtparser.y vendor-sys/acpica/dist/source/compiler/dtsubtable.c vendor-sys/acpica/dist/source/compiler/dttable.c vendor-sys/acpica/dist/source/compiler/dttemplate.c vendor-sys/acpica/dist/source/compiler/dttemplate.h vendor-sys/acpica/dist/source/compiler/dtutils.c vendor-sys/acpica/dist/source/compiler/prparser.y vendor-sys/acpica/dist/source/compiler/prscan.c vendor-sys/acpica/dist/source/compiler/prutils.c vendor-sys/acpica/dist/source/components/debugger/dbcmds.c vendor-sys/acpica/dist/source/components/debugger/dbconvert.c vendor-sys/acpica/dist/source/components/debugger/dbdisply.c vendor-sys/acpica/dist/source/components/debugger/dbexec.c vendor-sys/acpica/dist/source/components/debugger/dbfileio.c vendor-sys/acpica/dist/source/components/debugger/dbhistry.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/dbtest.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/dmbuffer.c vendor-sys/acpica/dist/source/components/disassembler/dmcstyle.c vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c vendor-sys/acpica/dist/source/components/dispatcher/dsinit.c vendor-sys/acpica/dist/source/components/dispatcher/dsobject.c vendor-sys/acpica/dist/source/components/dispatcher/dsutils.c vendor-sys/acpica/dist/source/components/dispatcher/dswload.c vendor-sys/acpica/dist/source/components/events/evgpe.c vendor-sys/acpica/dist/source/components/events/evgpeinit.c vendor-sys/acpica/dist/source/components/executer/exconfig.c vendor-sys/acpica/dist/source/components/executer/exconvrt.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/executer/exfield.c vendor-sys/acpica/dist/source/components/executer/exfldio.c vendor-sys/acpica/dist/source/components/executer/exmisc.c vendor-sys/acpica/dist/source/components/executer/exnames.c vendor-sys/acpica/dist/source/components/executer/exoparg2.c vendor-sys/acpica/dist/source/components/executer/exoparg3.c vendor-sys/acpica/dist/source/components/executer/exregion.c vendor-sys/acpica/dist/source/components/executer/exstorob.c vendor-sys/acpica/dist/source/components/executer/exutils.c vendor-sys/acpica/dist/source/components/hardware/hwgpe.c vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c vendor-sys/acpica/dist/source/components/namespace/nsaccess.c vendor-sys/acpica/dist/source/components/namespace/nsconvert.c vendor-sys/acpica/dist/source/components/namespace/nsdump.c vendor-sys/acpica/dist/source/components/namespace/nseval.c vendor-sys/acpica/dist/source/components/namespace/nsinit.c vendor-sys/acpica/dist/source/components/namespace/nsparse.c vendor-sys/acpica/dist/source/components/namespace/nsrepair2.c vendor-sys/acpica/dist/source/components/namespace/nssearch.c vendor-sys/acpica/dist/source/components/namespace/nsutils.c vendor-sys/acpica/dist/source/components/namespace/nsxfeval.c vendor-sys/acpica/dist/source/components/namespace/nsxfname.c vendor-sys/acpica/dist/source/components/parser/psutils.c vendor-sys/acpica/dist/source/components/resources/rscreate.c vendor-sys/acpica/dist/source/components/resources/rsmisc.c vendor-sys/acpica/dist/source/components/resources/rsutils.c vendor-sys/acpica/dist/source/components/resources/rsxface.c vendor-sys/acpica/dist/source/components/tables/tbdata.c vendor-sys/acpica/dist/source/components/tables/tbfadt.c vendor-sys/acpica/dist/source/components/tables/tbfind.c vendor-sys/acpica/dist/source/components/tables/tbinstal.c vendor-sys/acpica/dist/source/components/tables/tbprint.c vendor-sys/acpica/dist/source/components/tables/tbutils.c vendor-sys/acpica/dist/source/components/tables/tbxface.c vendor-sys/acpica/dist/source/components/tables/tbxfload.c vendor-sys/acpica/dist/source/components/utilities/utalloc.c vendor-sys/acpica/dist/source/components/utilities/utbuffer.c vendor-sys/acpica/dist/source/components/utilities/utcache.c vendor-sys/acpica/dist/source/components/utilities/utclib.c vendor-sys/acpica/dist/source/components/utilities/utcopy.c vendor-sys/acpica/dist/source/components/utilities/utids.c vendor-sys/acpica/dist/source/components/utilities/utmisc.c vendor-sys/acpica/dist/source/components/utilities/utosi.c vendor-sys/acpica/dist/source/components/utilities/utpredef.c vendor-sys/acpica/dist/source/components/utilities/utprint.c vendor-sys/acpica/dist/source/components/utilities/utstring.c vendor-sys/acpica/dist/source/components/utilities/uttrack.c vendor-sys/acpica/dist/source/components/utilities/utxface.c 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/acnames.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/acpixf.h vendor-sys/acpica/dist/source/include/acstruct.h vendor-sys/acpica/dist/source/include/actbl.h vendor-sys/acpica/dist/source/include/actbl1.h vendor-sys/acpica/dist/source/include/actbl2.h vendor-sys/acpica/dist/source/include/actbl3.h vendor-sys/acpica/dist/source/include/actypes.h vendor-sys/acpica/dist/source/include/acutils.h vendor-sys/acpica/dist/source/include/platform/acefi.h vendor-sys/acpica/dist/source/include/platform/acenv.h vendor-sys/acpica/dist/source/include/platform/acenvex.h vendor-sys/acpica/dist/source/include/platform/acgcc.h vendor-sys/acpica/dist/source/include/platform/acmsvc.h vendor-sys/acpica/dist/source/os_specific/service_layers/osbsdtbl.c vendor-sys/acpica/dist/source/os_specific/service_layers/osefitbl.c vendor-sys/acpica/dist/source/os_specific/service_layers/osefixf.c vendor-sys/acpica/dist/source/os_specific/service_layers/oslinuxtbl.c vendor-sys/acpica/dist/source/os_specific/service_layers/osunixmap.c vendor-sys/acpica/dist/source/os_specific/service_layers/oswintbl.c vendor-sys/acpica/dist/source/tools/acpidump/acpidump.h vendor-sys/acpica/dist/source/tools/acpidump/apdump.c vendor-sys/acpica/dist/source/tools/acpidump/apfiles.c vendor-sys/acpica/dist/source/tools/acpidump/apmain.c vendor-sys/acpica/dist/source/tools/acpiexec/aeexec.c vendor-sys/acpica/dist/source/tools/acpiexec/aehandlers.c vendor-sys/acpica/dist/source/tools/acpiexec/aeinitfile.c vendor-sys/acpica/dist/source/tools/acpiexec/aeregion.c vendor-sys/acpica/dist/source/tools/acpiexec/aetables.c vendor-sys/acpica/dist/source/tools/acpihelp/ahamlops.c vendor-sys/acpica/dist/source/tools/acpihelp/ahdecode.c vendor-sys/acpica/dist/source/tools/acpinames/antables.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/asremove.c vendor-sys/acpica/dist/source/tools/acpisrc/astable.c vendor-sys/acpica/dist/source/tools/acpisrc/asutils.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/changes.txt Tue Jun 16 19:48:16 2015 (r284458) @@ -1,5 +1,114 @@ ---------------------------------------- -08 April 2015. Summary of changes for version 20150515: +16 June 2015. Summary of changes for version 20150616: + + +1) ACPICA kernel-resident subsystem: + +Across the entire ACPICA source code base, the various macros for the C +library functions (such as ACPI_STRLEN, etc.) have been removed and +replaced by the standard C library names (strlen, etc.) The original +purpose for these macros is no longer applicable. This simplification +reduces the number of macros used in the ACPICA source code +significantly, improving readability and maintainability. + +Implemented support for a new ACPI table, the OSDT. This table, the +"override" SDT, can be loaded directly by the host OS at boot time. It +enables the replacement of existing namespace objects that were installed +via the DSDT and/or SSDTs. The primary purpose for this is to replace +buggy or incorrect ASL/AML code obtained via the BIOS. The OSDT is slated +for inclusion in a future version of the ACPI Specification. Lv Zheng/Bob +Moore. + +Added support for systems with (improperly) two FACS tables -- a "32-bit" +table (via FADT 32-bit legacy field) and a "64-bit" table (via the 64-bit +X field). This change will support both automatically. There continues to +be systems found with this issue. This support requires a change to the +AcpiSetFirmwareWakingVector interface. Also, a public global variable has +been added to allow the host to select which FACS is desired +(AcpiGbl_Use32BitFacsAddresses). See the ACPICA reference for more +details Lv Zheng. + +Added a new feature to allow for systems that do not contain an FACS. +Although this is already supported on hardware-reduced platforms, the +feature has been extended for all platforms. The reasoning is that we do +not want to abort the entire ACPICA initialization just because the +system is seriously buggy and has no FACS. + +Fixed a problem where the GUID strings for NFIT tables (in acuuid.h) were +not correctly transcribed from the ACPI specification in ACPICA version +20150515. + +Implemented support for the _CLS object in the AcpiGetObjectInfo external +interface. + +Updated the definitions of the TCPA and TPM2 ACPI tables to the more +recent TCG ACPI Specification, December 14, 2014. Table disassembler and +compiler also updated. Note: The TCPA "server" table is not supported by +the disassembler/table-compiler at this time. + +ACPI 6.0: Added definitions for the new GIC version field in the MADT. + +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.6K Code, 27.6K Data, 128.2K Total + Debug Version: 196.2K Code, 81.0K Data, 277.2K Total + Previous Release: + Non-Debug Version: 99.9K Code, 27.5K Data, 127.4K Total + Debug Version: 195.2K Code, 80.8K Data, 276.0K Total + + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Fixed a problem with the new symbolic operator disassembler +where incorrect ASL code could be emitted in some cases for the "non- +commutative" operators -- Subtract, Divide, Modulo, ShiftLeft, and +ShiftRight. The actual problem cases seem to be rather unusual in common +ASL code, however. David Box. + +Modified the linux version of acpidump to obtain ACPI tables from not +just /dev/mem (which may not exist) and /sys/firmware/acpi/tables. Lv +Zheng. + +iASL: Fixed a problem where the user preprocessor output file (.i) +contained extra data that was not expected. The compiler was using this +file as a temporary file and passed through #line directives in order to +keep compiler error messages in sync with the input file and line number +across multiple include files. The (.i) is no longer a temporary file as +the compiler uses a new, different file for the original purpose. + +iASL: Fixed a problem where comments within the original ASL source code +file were not passed through to the preprocessor output file, nor any +listing files. + +iASL: Fixed some issues for the handling of the "#include" preprocessor +directive and the similar (but not the same) "Include" ASL operator. + +iASL: Add support for the new OSDT in both the disassembler and compiler. + +iASL: Fixed a problem with the constant folding support where a Buffer +object could be incorrectly generated (incorrectly formed) during a +conversion to a Store() operator. + +AcpiHelp: Updated for new NFIT GUIDs, "External" AML opcode, and new +description text for the _REV predefined name. _REV now permanently +returns 2, as per the ACPI 6.0 specification. + +Debugger: Enhanced the output of the Debug ASL object for references +produced by the Index operator. For Buffers and strings, only output the +actual byte pointed to by the index. For packages, only print the single +package element decoded by the index. Previously, the entire +buffer/string/package was emitted. + +iASL/Table-compiler: Fixed a regression where the "generic" data types +were no longer recognized, causing errors. + + +---------------------------------------- +15 May 2015. Summary of changes for version 20150515: This release implements most of ACPI 6.0 as described below. @@ -34,7 +143,7 @@ iASL disassembler and table compiler: Ad tables: FADT, MADT. iASL preprocessor: Added a new directive to enable inclusion of binary -blobs into ASL code. The new directive is #includebinary. It takes a +blobs into ASL code. The new directive is #includebuffer. It takes a binary file as input and emits a named ascii buffer object into the ASL code. Modified: vendor-sys/acpica/dist/source/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adisasm.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/adisasm.c Tue Jun 16 19:48:16 2015 (r284458) @@ -243,7 +243,7 @@ AdAmlDisassemble ( while (ExternalFileList) { ExternalFilename = ExternalFileList->Path; - if (!ACPI_STRCMP (ExternalFilename, Filename)) + if (!strcmp (ExternalFilename, Filename)) { /* Next external file */ Modified: vendor-sys/acpica/dist/source/common/ahids.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahids.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/ahids.c Tue Jun 16 19:48:16 2015 (r284458) @@ -230,7 +230,7 @@ AcpiAhMatchHardwareId ( for (Info = AslDeviceIds; Info->Name; Info++) { - if (!ACPI_STRCMP (HardwareId, Info->Name)) + if (!strcmp (HardwareId, Info->Name)) { return (Info); } Modified: vendor-sys/acpica/dist/source/common/ahpredef.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahpredef.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/ahpredef.c Tue Jun 16 19:48:16 2015 (r284458) @@ -249,7 +249,7 @@ const AH_PREDEFINED_NAME AslPredefine AH_PREDEF ("_RBW", "Register Bit Width", "Resource Descriptor field"), AH_PREDEF ("_RDI", "Resource Dependencies for Idle", "Returns a list of dependencies for idle states"), AH_PREDEF ("_REG", "Region Availability", "Inform AML code of an operation region availability change"), - AH_PREDEF ("_REV", "Supported ACPI Revision", "Returns the revision of the ACPI specification that is implemented"), + AH_PREDEF ("_REV", "Supported Integer Width", "Returns the supported integer width (<= 1: 32 bits only, >=2: both 32 and 64 bits"), AH_PREDEF ("_RMV", "Removal Status", "Returns a device's removal ability status (docking)"), AH_PREDEF ("_RNG", "Range", "Memory range type, Resource Descriptor field"), AH_PREDEF ("_RST", "Device Reset", "Executes a reset on a device"), Modified: vendor-sys/acpica/dist/source/common/ahuuids.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahuuids.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/ahuuids.c Tue Jun 16 19:48:16 2015 (r284458) @@ -122,7 +122,7 @@ AcpiAhMatchUuid ( AcpiUtConvertStringToUuid (Info->String, UuidBuffer); - if (!ACPI_MEMCMP (Data, UuidBuffer, UUID_BUFFER_LENGTH)) + if (!memcmp (Data, UuidBuffer, UUID_BUFFER_LENGTH)) { return (Info->Description); } Modified: vendor-sys/acpica/dist/source/common/dmextern.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmextern.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/dmextern.c Tue Jun 16 19:48:16 2015 (r284458) @@ -224,7 +224,7 @@ AcpiDmNormalizeParentPrefix ( return (NULL); } - Length = (ACPI_STRLEN (ParentPath) + ACPI_STRLEN (Path) + 1); + Length = (strlen (ParentPath) + strlen (Path) + 1); if (ParentPath[1]) { /* @@ -253,7 +253,7 @@ AcpiDmNormalizeParentPrefix ( * * Copy the parent path */ - ACPI_STRCPY (Fullpath, &ParentPath[Index]); + strcpy (Fullpath, &ParentPath[Index]); /* * Add dot separator @@ -261,12 +261,12 @@ AcpiDmNormalizeParentPrefix ( */ if (ParentPath[1]) { - ACPI_STRCAT (Fullpath, "."); + strcat (Fullpath, "."); } /* Copy child path (carat parent prefix(es) were skipped above) */ - ACPI_STRCAT (Fullpath, Path); + strcat (Fullpath, Path); Cleanup: ACPI_FREE (ParentPath); @@ -648,13 +648,13 @@ AcpiDmAddNodeToExternalList ( if ((*ExternalPath == AML_ROOT_PREFIX) && (ExternalPath[1])) { - Temp = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (ExternalPath) + 1); + Temp = ACPI_ALLOCATE_ZEROED (strlen (ExternalPath) + 1); if (!Temp) { return_VOID; } - ACPI_STRCPY (Temp, &ExternalPath[1]); + strcpy (Temp, &ExternalPath[1]); ACPI_FREE (ExternalPath); ExternalPath = Temp; } @@ -806,7 +806,7 @@ AcpiDmCreateNewExternal ( NextExternal = AcpiGbl_ExternalList; while (NextExternal) { - if (!ACPI_STRCMP (ExternalPath, NextExternal->Path)) + if (!strcmp (ExternalPath, NextExternal->Path)) { /* Duplicate method, check that the Value (ArgCount) is the same */ @@ -849,7 +849,7 @@ AcpiDmCreateNewExternal ( NewExternal->Value = Value; NewExternal->Path = ExternalPath; NewExternal->Type = Type; - NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath); + NewExternal->Length = (UINT16) strlen (ExternalPath); NewExternal->InternalPath = InternalPath; /* Link the new descriptor into the global list, alphabetically ordered */ Modified: vendor-sys/acpica/dist/source/common/dmrestag.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmrestag.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/dmrestag.c Tue Jun 16 19:48:16 2015 (r284458) @@ -679,10 +679,10 @@ AcpiGetTagPathname ( * end up in the final compiled AML, it's just an appearance issue for the * disassembled code. */ - Pathname[ACPI_STRLEN (Pathname) - ACPI_NAME_SIZE] = 0; - ACPI_STRNCAT (Pathname, ResourceNode->Name.Ascii, ACPI_NAME_SIZE); - ACPI_STRCAT (Pathname, "."); - ACPI_STRNCAT (Pathname, Tag, ACPI_NAME_SIZE); + Pathname[strlen (Pathname) - ACPI_NAME_SIZE] = 0; + strncat (Pathname, ResourceNode->Name.Ascii, ACPI_NAME_SIZE); + strcat (Pathname, "."); + strncat (Pathname, Tag, ACPI_NAME_SIZE); /* Internalize the namepath to AML format */ Modified: vendor-sys/acpica/dist/source/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtable.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/dmtable.c Tue Jun 16 19:48:16 2015 (r284458) @@ -528,7 +528,7 @@ AcpiDmDumpDataTable ( TableData = AcpiDmGetTableData (Table->Signature); if (!TableData) { - if (!ACPI_STRNCMP (Table->Signature, "OEM", 3)) + if (!strncmp (Table->Signature, "OEM", 3)) { AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n", Table->Signature); @@ -856,7 +856,7 @@ AcpiDmDumpTable ( case ACPI_DMT_STRING: - ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1; + ByteLength = strlen (ACPI_CAST_PTR (char, Target)) + 1; break; case ACPI_DMT_GAS: Modified: vendor-sys/acpica/dist/source/common/dmtbdump.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbdump.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/dmtbdump.c Tue Jun 16 19:48:16 2015 (r284458) @@ -155,7 +155,7 @@ AcpiDmDumpUnicode ( for (i = 0; i < Length; i += 2) { - if (!ACPI_IS_PRINT (Buffer[i])) + if (!isprint (Buffer[i])) { goto DumpRawBuffer; } @@ -1701,7 +1701,7 @@ AcpiDmDumpIort ( InfoTable = AcpiDmTableInfoIort1; Length = ACPI_OFFSET (ACPI_IORT_NAMED_COMPONENT, DeviceName); String = ACPI_ADD_PTR (char, IortNode, NodeOffset + Length); - Length += ACPI_STRLEN (String) + 1; + Length += strlen (String) + 1; break; case ACPI_IORT_NODE_PCI_ROOT_COMPLEX: @@ -3344,7 +3344,7 @@ AcpiDmDumpStao ( while (Offset < Table->Length) { Namepath = ACPI_ADD_PTR (char, Table, Offset); - StringLength = ACPI_STRLEN (Namepath) + 1; + StringLength = strlen (Namepath) + 1; AcpiDmLineHeader (Offset, StringLength, "Namestring"); AcpiOsPrintf ("\"%s\"\n", Namepath); Modified: vendor-sys/acpica/dist/source/common/dmtbinfo.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbinfo.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/dmtbinfo.c Tue Jun 16 19:48:16 2015 (r284458) @@ -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_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA,f) +#define ACPI_TCPA_CLIENT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_CLIENT,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) @@ -2611,15 +2611,15 @@ ACPI_DMTABLE_INFO AcpiDmTableI /******************************************************************************* * - * TCPA - Trusted Computing Platform Alliance table + * TCPA - Trusted Computing Platform Alliance table (Client) * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[] = { - {ACPI_DMT_UINT16, ACPI_TCPA_OFFSET (Reserved), "Reserved", 0}, - {ACPI_DMT_UINT32, ACPI_TCPA_OFFSET (MaxLogLength), "Max Event Log Length", 0}, - {ACPI_DMT_UINT64, ACPI_TCPA_OFFSET (LogAddress), "Event Log Address", 0}, + {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 }; @@ -2632,7 +2632,8 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[] = { - {ACPI_DMT_UINT32, ACPI_TPM2_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_UINT16, ACPI_TPM2_OFFSET (PlatformClass), "Platform Class", 0}, + {ACPI_DMT_UINT16, ACPI_TPM2_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_TPM2_OFFSET (ControlAddress), "Control Address", 0}, {ACPI_DMT_UINT32, ACPI_TPM2_OFFSET (StartMethod), "Start Method", 0}, ACPI_DMT_TERMINATOR Modified: vendor-sys/acpica/dist/source/common/getopt.c ============================================================================== --- vendor-sys/acpica/dist/source/common/getopt.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/getopt.c Tue Jun 16 19:48:16 2015 (r284458) @@ -145,7 +145,7 @@ AcpiGetopt( { return (ACPI_OPT_END); } - else if (ACPI_STRCMP (argv[AcpiGbl_Optind], "--") == 0) + else if (strcmp (argv[AcpiGbl_Optind], "--") == 0) { AcpiGbl_Optind++; return (ACPI_OPT_END); @@ -159,7 +159,7 @@ AcpiGetopt( /* Make sure that the option is legal */ if (CurrentChar == ':' || - (OptsPtr = ACPI_STRCHR (opts, CurrentChar)) == NULL) + (OptsPtr = strchr (opts, CurrentChar)) == NULL) { ACPI_OPTION_ERROR ("Illegal option: -", CurrentChar); Modified: vendor-sys/acpica/dist/source/compiler/aslanalyze.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslanalyze.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslanalyze.c Tue Jun 16 19:48:16 2015 (r284458) @@ -67,8 +67,8 @@ AnIsInternalMethod ( ACPI_PARSE_OBJECT *Op) { - if ((!ACPI_STRCMP (Op->Asl.ExternalName, "\\_OSI")) || - (!ACPI_STRCMP (Op->Asl.ExternalName, "_OSI"))) + if ((!strcmp (Op->Asl.ExternalName, "\\_OSI")) || + (!strcmp (Op->Asl.ExternalName, "_OSI"))) { return (TRUE); } @@ -94,8 +94,8 @@ AnGetInternalMethodReturnType ( ACPI_PARSE_OBJECT *Op) { - if ((!ACPI_STRCMP (Op->Asl.ExternalName, "\\_OSI")) || - (!ACPI_STRCMP (Op->Asl.ExternalName, "_OSI"))) + if ((!strcmp (Op->Asl.ExternalName, "\\_OSI")) || + (!strcmp (Op->Asl.ExternalName, "_OSI"))) { return (ACPI_BTYPE_STRING); } @@ -462,7 +462,7 @@ ApCheckForGpeNameConflict ( /* Verify 3rd/4th chars are a valid hex value */ - GpeNumber = ACPI_STRTOUL (&Name[2], NULL, 16); + GpeNumber = strtoul (&Name[2], NULL, 16); if (GpeNumber == ACPI_UINT32_MAX) { return; Modified: vendor-sys/acpica/dist/source/compiler/aslascii.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslascii.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslascii.c Tue Jun 16 19:48:16 2015 (r284458) @@ -226,7 +226,7 @@ FlCheckForAscii ( /* Ensure character is either printable or a "space" char */ - else if (!ACPI_IS_PRINT (Byte) && !ACPI_IS_SPACE (Byte)) + else if (!isprint (Byte) && !isspace (Byte)) { if ((BadBytes < 10) && (DisplayErrors)) { Modified: vendor-sys/acpica/dist/source/compiler/aslcodegen.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcodegen.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslcodegen.c Tue Jun 16 19:48:16 2015 (r284458) @@ -110,7 +110,7 @@ CgGenerateAmlOutput ( DbgPrint (ASL_TREE_OUTPUT, "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" - " Parent Child Next Flags AcTyp Final Col L\n", + " Parent Child Next Flags AcTyp Final Col L# EL# LL# ELL#\n", 76, " "); CgCloseTable (); @@ -145,7 +145,7 @@ CgAmlWriteWalk ( "Final parse tree used for AML output:\n"); DbgPrint (ASL_TREE_OUTPUT, "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" - " Parent Child Next Flags AcTyp Final Col L\n", + " Parent Child Next Flags AcTyp Final Col L# EL# LL# ELL#\n", 76, " "); } @@ -169,7 +169,7 @@ CgAmlWriteWalk ( DbgPrint (ASL_TREE_OUTPUT, "%08X %04X %04X %01X %04X %04X %04X %04X " - "%08X %08X %08X %08X %08X %08X %04X %02d %02d\n", + "%08X %08X %08X %08X %08X %08X %04X %02d %02d %02d %02d %02d\n", /* 1 */ (UINT32) Op->Asl.Value.Integer, /* 2 */ Op->Asl.ParseOpcode, /* 3 */ Op->Asl.AmlOpcode, @@ -186,7 +186,10 @@ CgAmlWriteWalk ( /* 14 */ Op->Asl.AcpiBtype, /* 15 */ Op->Asl.FinalAmlLength, /* 16 */ Op->Asl.Column, - /* 17 */ Op->Asl.LineNumber); + /* 17 */ Op->Asl.LineNumber, + /* 18 */ Op->Asl.EndLine, + /* 19 */ Op->Asl.LogicalLineNumber, + /* 20 */ Op->Asl.EndLogicalLine); /* Generate the AML for this node */ Modified: vendor-sys/acpica/dist/source/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompile.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Tue Jun 16 19:48:16 2015 (r284458) @@ -103,6 +103,9 @@ CmDoCompile ( /* Preprocessor */ PrDoPreprocess (); + Gbl_CurrentLineNumber = 1; + Gbl_LogicalLineNumber = 1; + if (Gbl_PreprocessOnly) { UtEndEvent (Event); @@ -112,6 +115,7 @@ CmDoCompile ( } UtEndEvent (Event); + /* Build the parse tree */ Event = UtBeginEvent ("Parse source code and build parse tree"); @@ -708,7 +712,7 @@ CmCleanupAndExit ( /* Close all open files */ /* - * Take care with the preprocessor file (.i), it might be the same + * Take care with the preprocessor file (.pre), it might be the same * as the "input" file, depending on where the compiler has terminated * or aborted. Prevent attempt to close the same file twice in * loop below. @@ -733,10 +737,9 @@ CmCleanupAndExit ( FlDeleteFile (ASL_FILE_AML_OUTPUT); } - /* Delete the preprocessor output file (.i) unless -li flag is set */ + /* Delete the preprocessor temp file unless full debug was specified */ - if (!Gbl_PreprocessorOutputFlag && - Gbl_PreprocessFlag) + if (Gbl_PreprocessFlag && !Gbl_KeepPreprocessorTempFile) { FlDeleteFile (ASL_FILE_PREPROCESSOR); } @@ -752,8 +755,6 @@ CmCleanupAndExit ( * Note: Handles are cleared by FlCloseFile above, so we look at the * filename instead, to determine if the .SRC file was actually * created. - * - * TBD: SourceOutput should be .TMP, then rename if we want to keep it? */ if (!Gbl_SourceOutputFlag) { Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.h Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h Tue Jun 16 19:48:16 2015 (r284458) @@ -1003,7 +1003,7 @@ UtDoConstant ( char *String); ACPI_STATUS -UtStrtoul64 ( +stroul64 ( char *String, UINT32 Base, UINT64 *RetInteger); Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.l ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.l Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.l Tue Jun 16 19:48:16 2015 (r284458) @@ -709,7 +709,7 @@ NamePathTail [.]{NameSeg} return (PARSEOP_NAMESTRING); } . { count (1); - if (ACPI_IS_PRINT (*AslCompilertext)) + if (isprint (*AslCompilertext)) { sprintf (MsgBuffer, "Invalid character (%c), expecting ASL keyword or name", Modified: vendor-sys/acpica/dist/source/compiler/asldefine.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asldefine.h Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/asldefine.h Tue Jun 16 19:48:16 2015 (r284458) @@ -105,7 +105,8 @@ /* filename suffixes for output files */ -#define FILE_SUFFIX_PREPROCESSOR "i" +#define FILE_SUFFIX_PREPROC_USER "i " +#define FILE_SUFFIX_PREPROCESSOR "pre" #define FILE_SUFFIX_AML_CODE "aml" #define FILE_SUFFIX_MAP "map" #define FILE_SUFFIX_LISTING "lst" @@ -136,6 +137,8 @@ #define ASL_ABORT TRUE #define ASL_NO_ABORT FALSE #define ASL_EOF ACPI_UINT32_MAX +#define ASL_WITHIN_COMMENT (ACPI_UINT32_MAX -1) +#define ASL_BLANK_LINE (ACPI_UINT32_MAX -1) /* Listings */ Modified: vendor-sys/acpica/dist/source/compiler/aslerror.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslerror.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslerror.c Tue Jun 16 19:48:16 2015 (r284458) @@ -561,11 +561,11 @@ AslCommonError2 ( /* Keep a copy of the extra message */ - ACPI_STRCPY (MessageBuffer, ExtraMessage); + strcpy (MessageBuffer, ExtraMessage); } LineBuffer = UtLocalCalloc (strlen (SourceLine) + 1); - ACPI_STRCPY (LineBuffer, SourceLine); + strcpy (LineBuffer, SourceLine); /* Initialize the error node */ @@ -647,7 +647,7 @@ AslCommonError ( /* Keep a copy of the extra message */ - ACPI_STRCPY (MessageBuffer, ExtraMessage); + strcpy (MessageBuffer, ExtraMessage); } /* Initialize the error node */ Modified: vendor-sys/acpica/dist/source/compiler/aslfileio.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfileio.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslfileio.c Tue Jun 16 19:48:16 2015 (r284458) @@ -218,6 +218,19 @@ FlWriteFile ( FlFileError (FileId, ASL_MSG_WRITE); AslAbort (); } + + if ((FileId == ASL_FILE_PREPROCESSOR) && Gbl_PreprocessorOutputFlag) + { + /* Duplicate the output to the user preprocessor (.i) file */ + + Actual = fwrite ((char *) Buffer, 1, Length, + Gbl_Files[ASL_FILE_PREPROCESSOR_USER].Handle); + if (Actual != Length) + { + FlFileError (FileId, ASL_MSG_WRITE); + AslAbort (); + } + } } @@ -247,7 +260,6 @@ FlPrintFile ( va_start (Args, Format); - Actual = vfprintf (Gbl_Files[FileId].Handle, Format, Args); va_end (Args); @@ -256,6 +268,30 @@ FlPrintFile ( FlFileError (FileId, ASL_MSG_WRITE); AslAbort (); } + + if ((FileId == ASL_FILE_PREPROCESSOR) && Gbl_PreprocessorOutputFlag) + { + /* + * Duplicate the output to the user preprocessor (.i) file, + * except: no #line directives. + */ + if (!strncmp (Format, "#line", 5)) + { + return; + } + + va_start (Args, Format); + Actual = vfprintf (Gbl_Files[ASL_FILE_PREPROCESSOR_USER].Handle, + Format, Args); + va_end (Args); + + if (Actual == -1) + { + FlFileError (FileId, ASL_MSG_WRITE); + AslAbort (); + } + } + } Modified: vendor-sys/acpica/dist/source/compiler/aslfiles.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfiles.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslfiles.c Tue Jun 16 19:48:16 2015 (r284458) @@ -43,6 +43,7 @@ #include "aslcompiler.h" #include "acapps.h" +#include "dtcompiler.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslfiles") @@ -84,7 +85,6 @@ FlSetLineNumber ( LineNumber, Gbl_LogicalLineNumber); Gbl_CurrentLineNumber = LineNumber; - Gbl_LogicalLineNumber = LineNumber; } @@ -303,6 +303,7 @@ FlOpenIncludeWithPrefix ( { FILE *IncludeFile; char *Pathname; + UINT32 OriginalLineNumber; /* Build the full pathname to the file */ @@ -322,13 +323,20 @@ FlOpenIncludeWithPrefix ( return (NULL); } -#ifdef _MUST_HANDLE_COMMENTS /* - * Check entire include file for any # preprocessor directives. + * Check the entire include file for any # preprocessor directives. * This is because there may be some confusion between the #include - * preprocessor directive and the ASL Include statement. + * preprocessor directive and the ASL Include statement. A file included + * by the ASL include cannot contain preprocessor directives because + * the preprocessor has already run by the time the ASL include is + * recognized (by the compiler, not the preprocessor.) + * + * Note: DtGetNextLine strips/ignores comments. + * Save current line number since DtGetNextLine modifies it. */ - while (fgets (Gbl_CurrentLineBuffer, Gbl_LineBufferSize, IncludeFile)) + Gbl_CurrentLineNumber--; + OriginalLineNumber = Gbl_CurrentLineNumber; + while (DtGetNextLine (IncludeFile) != ASL_EOF) { if (Gbl_CurrentLineBuffer[0] == '#') { @@ -336,7 +344,7 @@ FlOpenIncludeWithPrefix ( Op, "use #include instead"); } } -#endif + Gbl_CurrentLineNumber = OriginalLineNumber; /* Must seek back to the start of the file */ @@ -579,8 +587,6 @@ FlOpenMiscOutputFiles ( /* Open the debug file as STDERR, text mode */ - /* TBD: hide this behind a FlReopenFile function */ - Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename; Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = freopen (Filename, "w+t", stderr); @@ -588,13 +594,15 @@ FlOpenMiscOutputFiles ( if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle) { /* - * A problem with freopen is that on error, - * we no longer have stderr. + * A problem with freopen is that on error, we no longer + * have stderr and cannot emit normal error messages. + * Emit error to stdout, close files, and exit. */ - Gbl_DebugFlag = FALSE; - memcpy (stderr, stdout, sizeof (FILE)); - FlFileError (ASL_FILE_DEBUG_OUTPUT, ASL_MSG_DEBUG_FILENAME); - AslAbort (); + fprintf (stdout, + "\nCould not open debug output file: %s\n\n", Filename); + + CmCleanupAndExit (); + exit (1); } AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT); @@ -621,7 +629,7 @@ FlOpenMiscOutputFiles ( AslCompilerFileHeader (ASL_FILE_LISTING_OUTPUT); } - /* Create the preprocessor output file if preprocessor enabled */ + /* Create the preprocessor output temp file if preprocessor enabled */ if (Gbl_PreprocessFlag) { @@ -636,6 +644,23 @@ FlOpenMiscOutputFiles ( FlOpenFile (ASL_FILE_PREPROCESSOR, Filename, "w+t"); } + /* + * Create the "user" preprocessor output file if -li flag set. + * Note, this file contains no embedded #line directives. + */ + if (Gbl_PreprocessorOutputFlag) + { + Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_PREPROC_USER); + if (!Filename) + { + AslCommonError (ASL_ERROR, ASL_MSG_PREPROCESSOR_FILENAME, + 0, 0, 0, 0, NULL, NULL); + return (AE_ERROR); + } + + FlOpenFile (ASL_FILE_PREPROCESSOR_USER, Filename, "w+t"); + } + /* All done for data table compiler */ if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA) Modified: vendor-sys/acpica/dist/source/compiler/aslfold.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfold.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslfold.c Tue Jun 16 19:48:16 2015 (r284458) @@ -380,10 +380,12 @@ TrSimpleConstantReduction ( return (Status); } + /* Disconnect any existing children, install new constant */ + + Op->Asl.Child = NULL; TrInstallReducedConstant (Op, ObjDesc); UtSetParseOpName (Op); - Op->Asl.Child = NULL; return (AE_OK); } @@ -547,7 +549,8 @@ TrInstallReducedConstant ( ACPI_PARSE_OBJECT *Op, ACPI_OPERAND_OBJECT *ObjDesc) { - ACPI_PARSE_OBJECT *RootOp; + ACPI_PARSE_OBJECT *LengthOp; + ACPI_PARSE_OBJECT *DataOp; TotalFolds++; @@ -574,17 +577,22 @@ TrInstallReducedConstant ( Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL; Op->Common.AmlOpcode = AML_STRING_OP; - Op->Asl.AmlLength = ACPI_STRLEN (ObjDesc->String.Pointer) + 1; + Op->Asl.AmlLength = strlen (ObjDesc->String.Pointer) + 1; Op->Common.Value.String = ObjDesc->String.Pointer; DbgPrint (ASL_PARSE_OUTPUT, "Constant expression reduced to (STRING) %s\n\n", Op->Common.Value.String); - break; case ACPI_TYPE_BUFFER: - + /* + * Create a new parse subtree of the form: + * + * BUFFER (Buffer AML opcode) + * INTEGER (Buffer length in bytes) + * RAW_DATA (Buffer byte data) + */ Op->Asl.ParseOpcode = PARSEOP_BUFFER; Op->Common.AmlOpcode = AML_BUFFER_OP; Op->Asl.CompileFlags = NODE_AML_PACKAGE; @@ -592,28 +600,24 @@ TrInstallReducedConstant ( /* Child node is the buffer length */ - RootOp = TrAllocateNode (PARSEOP_INTEGER); - - RootOp->Asl.AmlOpcode = AML_DWORD_OP; - RootOp->Asl.Value.Integer = ObjDesc->Buffer.Length; - RootOp->Asl.Parent = Op; + LengthOp = TrAllocateNode (PARSEOP_INTEGER); - (void) OpcSetOptimalIntegerSize (RootOp); + LengthOp->Asl.AmlOpcode = AML_DWORD_OP; + LengthOp->Asl.Value.Integer = ObjDesc->Buffer.Length; + LengthOp->Asl.Parent = Op; + (void) OpcSetOptimalIntegerSize (LengthOp); - Op->Asl.Child = RootOp; - Op = RootOp; - UtSetParseOpName (Op); + Op->Asl.Child = LengthOp; - /* Peer to the child is the raw buffer data */ + /* Next child is the raw buffer data */ - RootOp = TrAllocateNode (PARSEOP_RAW_DATA); - RootOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; - RootOp->Asl.AmlLength = ObjDesc->Buffer.Length; - RootOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer; - RootOp->Asl.Parent = Op->Asl.Parent; + DataOp = TrAllocateNode (PARSEOP_RAW_DATA); + DataOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; + DataOp->Asl.AmlLength = ObjDesc->Buffer.Length; + DataOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer; + DataOp->Asl.Parent = Op; - Op->Asl.Next = RootOp; - Op = RootOp; + LengthOp->Asl.Next = DataOp; DbgPrint (ASL_PARSE_OUTPUT, "Constant expression reduced to (BUFFER) length %X\n\n", Modified: vendor-sys/acpica/dist/source/compiler/aslglobal.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslglobal.h Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslglobal.h Tue Jun 16 19:48:16 2015 (r284458) @@ -73,6 +73,7 @@ ASL_FILE_INFO Gbl_ {NULL, NULL, "Binary Output:", "AML Output"}, {NULL, NULL, "Source Output:", "Source Output"}, {NULL, NULL, "Preprocessor: ", "Preprocessor Output"}, + {NULL, NULL, "Preprocessor: ", "Preprocessor Temp File"}, {NULL, NULL, "Listing File: ", "Listing Output"}, {NULL, NULL, "Hex Dump: ", "Hex Table Output"}, {NULL, NULL, "Namespace: ", "Namespace Output"}, @@ -123,10 +124,10 @@ ASL_EXTERN char ASL_ ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_LineBufPtr, NULL); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LineBufferSize, ASL_DEFAULT_LINE_BUFFER_SIZE); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentColumn, 0); -ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_PreviousLineNumber, 0); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineNumber, 1); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LogicalLineNumber, 1); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineOffset, 0); +ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_OriginalInputFileSize, 0); ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_SyntaxError, 0); /* Exception reporting */ @@ -146,6 +147,7 @@ ASL_EXTERN BOOLEAN ASL_ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_MapfileFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessorOutputFlag, FALSE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_KeepPreprocessorTempFile, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DebugFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AsmOutputFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_C_OutputFlag, FALSE); Modified: vendor-sys/acpica/dist/source/compiler/aslmain.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmain.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslmain.c Tue Jun 16 19:48:16 2015 (r284458) @@ -261,7 +261,7 @@ AslSignalHandler ( /* Close all open files */ - Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */ + Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .pre file is same as source file */ for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++) { Modified: vendor-sys/acpica/dist/source/compiler/aslmapenter.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmapenter.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslmapenter.c Tue Jun 16 19:48:16 2015 (r284458) @@ -239,7 +239,7 @@ MpCreateGpioInfo ( /* Sort on source DeviceName first */ while (NextGpio && - (ACPI_STRCMP (DeviceName, NextGpio->DeviceName) > 0)) + (strcmp (DeviceName, NextGpio->DeviceName) > 0)) { PrevGpio = NextGpio; NextGpio = NextGpio->Next; @@ -249,7 +249,7 @@ MpCreateGpioInfo ( while (NextGpio && (NextGpio->PinNumber < PinNumber) && - !ACPI_STRCMP (DeviceName, NextGpio->DeviceName)) + !strcmp (DeviceName, NextGpio->DeviceName)) { PrevGpio = NextGpio; NextGpio = NextGpio->Next; @@ -316,7 +316,7 @@ MpCreateSerialInfo ( /* Sort on source DeviceName */ while (NextSerial && - (ACPI_STRCMP (DeviceName, NextSerial->DeviceName) > 0)) + (strcmp (DeviceName, NextSerial->DeviceName) > 0)) { PrevSerial = NextSerial; NextSerial = NextSerial->Next; @@ -326,7 +326,7 @@ MpCreateSerialInfo ( while (NextSerial && (NextSerial->Address < Address) && - !ACPI_STRCMP (DeviceName, NextSerial->DeviceName)) + !strcmp (DeviceName, NextSerial->DeviceName)) { PrevSerial = NextSerial; NextSerial = NextSerial->Next; Modified: vendor-sys/acpica/dist/source/compiler/aslmapoutput.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmapoutput.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslmapoutput.c Tue Jun 16 19:48:16 2015 (r284458) @@ -207,7 +207,7 @@ MpEmitGpioInfo ( /* Print header info for the controller itself */ if (!PrevDeviceName || - ACPI_STRCMP (PrevDeviceName, Info->DeviceName)) + strcmp (PrevDeviceName, Info->DeviceName)) { FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\nGPIO Controller: %-8s %-28s", @@ -360,7 +360,7 @@ MpEmitSerialInfo ( /* Print header info for the controller itself */ if (!PrevDeviceName || - ACPI_STRCMP (PrevDeviceName, Info->DeviceName)) + strcmp (PrevDeviceName, Info->DeviceName)) { FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\n%s Controller: ", Type); Modified: vendor-sys/acpica/dist/source/compiler/aslmethod.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmethod.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslmethod.c Tue Jun 16 19:48:16 2015 (r284458) @@ -430,7 +430,7 @@ MtMethodAnalysisWalkBegin ( /* Special typechecking for _HID */ - if (!ACPI_STRCMP (METHOD_NAME__HID, Op->Asl.NameSeg)) + if (!strcmp (METHOD_NAME__HID, Op->Asl.NameSeg)) { Next = Op->Asl.Child->Asl.Next; AnCheckId (Next, ASL_TYPE_HID); @@ -438,7 +438,7 @@ MtMethodAnalysisWalkBegin ( /* Special typechecking for _CID */ - else if (!ACPI_STRCMP (METHOD_NAME__CID, Op->Asl.NameSeg)) + else if (!strcmp (METHOD_NAME__CID, Op->Asl.NameSeg)) { Next = Op->Asl.Child->Asl.Next; Modified: vendor-sys/acpica/dist/source/compiler/aslopcodes.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslopcodes.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslopcodes.c Tue Jun 16 19:48:16 2015 (r284458) @@ -636,7 +636,7 @@ OpcDoEisaId ( * The EISAID string must be exactly 7 characters and of the form * "UUUXXXX" -- 3 uppercase letters and 4 hex digits (e.g., "PNP0001") */ - if (ACPI_STRLEN (InString) != 7) + if (strlen (InString) != 7) { Status = AE_BAD_PARAMETER; } @@ -855,7 +855,7 @@ OpcFindName ( for (i = 0, Str = List[0]; Str; i++, Str = List[i]) { - if (!(ACPI_STRNCMP (Str, Name, ACPI_STRLEN (Name)))) + if (!(strncmp (Str, Name, strlen (Name)))) { *Index = i; return (TRUE); @@ -907,7 +907,7 @@ OpcDoPld ( return; } - ACPI_MEMSET (&PldInfo, 0, sizeof (ACPI_PLD_INFO)); + memset (&PldInfo, 0, sizeof (ACPI_PLD_INFO)); Node = Op->Asl.Child; while (Node) Modified: vendor-sys/acpica/dist/source/compiler/asloperands.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asloperands.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/asloperands.c Tue Jun 16 19:48:16 2015 (r284458) *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***