From owner-svn-src-all@FreeBSD.ORG Mon Feb 17 17:10:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34942DF2; Mon, 17 Feb 2014 17:10:46 +0000 (UTC) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 18DDE1837; Mon, 17 Feb 2014 17:10:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHAksP052914; Mon, 17 Feb 2014 17:10:46 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHAfVo052884; Mon, 17 Feb 2014 17:10:41 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201402171710.s1HHAfVo052884@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 17 Feb 2014 17:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r262091 - in vendor-sys/acpica/dist: . generate/unix source/common source/compiler source/components/debugger source/components/dispatcher source/components/events source/components/exe... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:10:46 -0000 Author: jkim Date: Mon Feb 17 17:10:41 2014 New Revision: 262091 URL: http://svnweb.freebsd.org/changeset/base/262091 Log: Import ACPICA 20140214. Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/Makefile.config vendor-sys/acpica/dist/source/common/adisasm.c vendor-sys/acpica/dist/source/common/dmextern.c vendor-sys/acpica/dist/source/common/dmtbinfo.c vendor-sys/acpica/dist/source/compiler/aslcompiler.h vendor-sys/acpica/dist/source/compiler/aslerror.c vendor-sys/acpica/dist/source/compiler/aslfileio.c vendor-sys/acpica/dist/source/compiler/aslglobal.h vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/aslmessages.h vendor-sys/acpica/dist/source/compiler/asloptions.c vendor-sys/acpica/dist/source/compiler/aslpredef.c vendor-sys/acpica/dist/source/compiler/aslprepkg.c vendor-sys/acpica/dist/source/compiler/aslstartup.c vendor-sys/acpica/dist/source/compiler/asltransform.c vendor-sys/acpica/dist/source/compiler/dtfield.c vendor-sys/acpica/dist/source/compiler/dttemplate.h vendor-sys/acpica/dist/source/compiler/prmacros.c vendor-sys/acpica/dist/source/components/debugger/dbdisply.c vendor-sys/acpica/dist/source/components/dispatcher/dsinit.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/events/evregion.c vendor-sys/acpica/dist/source/components/executer/exdump.c vendor-sys/acpica/dist/source/components/executer/exsystem.c vendor-sys/acpica/dist/source/components/executer/exutils.c vendor-sys/acpica/dist/source/components/namespace/nsinit.c vendor-sys/acpica/dist/source/components/namespace/nsload.c vendor-sys/acpica/dist/source/components/namespace/nsobject.c vendor-sys/acpica/dist/source/components/namespace/nsprepkg.c vendor-sys/acpica/dist/source/components/namespace/nsrepair.c vendor-sys/acpica/dist/source/components/namespace/nsrepair2.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/resources/rscalc.c vendor-sys/acpica/dist/source/components/resources/rscreate.c vendor-sys/acpica/dist/source/components/resources/rsdump.c vendor-sys/acpica/dist/source/components/resources/rsdumpinfo.c vendor-sys/acpica/dist/source/components/resources/rsinfo.c vendor-sys/acpica/dist/source/components/utilities/utdelete.c vendor-sys/acpica/dist/source/components/utilities/utglobal.c vendor-sys/acpica/dist/source/components/utilities/utosi.c vendor-sys/acpica/dist/source/include/acapps.h vendor-sys/acpica/dist/source/include/acbuffer.h vendor-sys/acpica/dist/source/include/acconfig.h 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/acevents.h vendor-sys/acpica/dist/source/include/acexcep.h vendor-sys/acpica/dist/source/include/acglobal.h vendor-sys/acpica/dist/source/include/achware.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/acpredef.h vendor-sys/acpica/dist/source/include/acresrc.h vendor-sys/acpica/dist/source/include/acrestyp.h vendor-sys/acpica/dist/source/include/acstruct.h vendor-sys/acpica/dist/source/include/actables.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/amlcode.h vendor-sys/acpica/dist/source/include/amlresrc.h vendor-sys/acpica/dist/source/os_specific/service_layers/oswindir.c vendor-sys/acpica/dist/source/os_specific/service_layers/oswinxf.c vendor-sys/acpica/dist/source/tools/acpiexec/aecommon.h 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/aemain.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/changes.txt Mon Feb 17 17:10:41 2014 (r262091) @@ -1,4 +1,69 @@ ---------------------------------------- +14 February 2014. Summary of changes for version 20140214: + +1) ACPICA kernel-resident subsystem: + +Implemented a new mechanism to proactively prevent problems with ill- +behaved reentrant control methods that create named ACPI objects. This +behavior is illegal as per the ACPI specification, but is nonetheless +frequently seen in the field. Previously, this could lead to an +AE_ALREADY_EXISTS exception if the method was actually entered by more +than one thread. This new mechanism detects such methods at table load +time and marks them "serialized" to prevent reentrancy. A new global +option, AcpiGbl_AutoSerializeMethods, has been added to disable this +feature if desired. This mechanism and global option obsoletes and +supersedes the previous AcpiGbl_SerializeAllMethods option. + +Added the "Windows 2013" string to the _OSI support. ACPICA will now +respond TRUE to _OSI queries with this string. It is the stated policy of +ACPICA to add new strings to the _OSI support as soon as possible after +they are defined. See the full ACPICA _OSI policy which has been added to +the utilities/utosi.c file. + +Hardened/updated the _PRT return value auto-repair code: +1) Do not abort the repair on a single subpackage failure, continue to +check all subpackages. +2) Add check for the minimum subpackage length (4). +3) Properly handle extraneous NULL package elements. + +Added support to avoid the possibility of infinite loops when traversing +object linked lists. Never allow an infinite loop, even in the face of +corrupted object lists. + +ACPICA headers: Deployed the use of #pragma pack(push) and #pragma +pack(pop) directives to ensure that the ACPICA headers are independent of +compiler settings or other host headers. + +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: 96.5K Code, 27.2K Data, 123.7K Total + Debug Version: 188.6K Code, 79.0K Data, 267.6K Total + Previous Release: + Non-Debug Version: 96.2K Code, 27.0K Data, 123.2K Total + Debug Version: 187.5K Code, 78.3K Data, 265.8K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL/Table-compiler: Fixed a problem with support for the SPMI table. The +first reserved field was incorrectly forced to have a value of zero. This +change correctly forces the field to have a value of one. ACPICA BZ 1081. + +Debugger: Added missing support for the "Extra" and "Data" subobjects +when displaying object data. + +Debugger: Added support to display entire object linked lists when +displaying object data. + +iASL: Removed the obsolete -g option to obtain ACPI tables from the +Windows registry. This feature has been superseded by the acpidump +utility. + +---------------------------------------- 14 January 2014. Summary of changes for version 20140114: 1) ACPICA kernel-resident subsystem: Modified: vendor-sys/acpica/dist/generate/unix/Makefile.config ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile.config Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/generate/unix/Makefile.config Mon Feb 17 17:10:41 2014 (r262091) @@ -161,14 +161,15 @@ CWARNINGFLAGS = \ CWARNINGFLAGS += \ -Waddress\ -Waggregate-return\ - -Wchar-subscripts\ + -Winit-self\ + -Winline\ -Wmissing-declarations\ -Wmissing-field-initializers\ -Wnested-externs\ -Wold-style-definition\ + -Woverride-init\ -Wno-format-nonliteral\ -Wredundant-decls - # # Per-host flags and exclusions # Modified: vendor-sys/acpica/dist/source/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adisasm.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/common/adisasm.c Mon Feb 17 17:10:41 2014 (r262091) @@ -250,7 +250,6 @@ AdInitialize ( * OutToFile - TRUE if output should go to a file * Prefix - Path prefix for output * OutFilename - where the filename is returned - * GetAllTables - TRUE if all tables are desired * * RETURN: Status * @@ -263,8 +262,7 @@ AdAmlDisassemble ( BOOLEAN OutToFile, char *Filename, char *Prefix, - char **OutFilename, - BOOLEAN GetAllTables) + char **OutFilename) { ACPI_STATUS Status; char *DisasmFilename = NULL; @@ -348,7 +346,7 @@ AdAmlDisassemble ( } else { - Status = AdGetLocalTables (Filename, GetAllTables); + Status = AdGetLocalTables (); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get ACPI tables, %s\n", @@ -746,8 +744,7 @@ AdDisplayTables ( * * FUNCTION: AdGetLocalTables * - * PARAMETERS: Filename - Not used - * GetAllTables - TRUE if all tables are desired + * PARAMETERS: None * * RETURN: Status * @@ -757,105 +754,36 @@ AdDisplayTables ( ACPI_STATUS AdGetLocalTables ( - char *Filename, - BOOLEAN GetAllTables) + void) { ACPI_STATUS Status; ACPI_TABLE_HEADER TableHeader; ACPI_TABLE_HEADER *NewTable; - UINT32 NumTables; - UINT32 PointerSize; UINT32 TableIndex; - if (GetAllTables) - { - ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_RSDT); - AcpiOsTableOverride (&TableHeader, &NewTable); - if (!NewTable) - { - fprintf (stderr, "Could not obtain RSDT\n"); - return (AE_NO_ACPI_TABLES); - } - else - { - AdWriteTable (NewTable, NewTable->Length, - ACPI_SIG_RSDT, NewTable->OemTableId); - } - - if (ACPI_COMPARE_NAME (NewTable->Signature, ACPI_SIG_RSDT)) - { - PointerSize = sizeof (UINT32); - } - else - { - PointerSize = sizeof (UINT64); - } - - /* - * Determine the number of tables pointed to by the RSDT/XSDT. - * This is defined by the ACPI Specification to be the number of - * pointers contained within the RSDT/XSDT. The size of the pointers - * is architecture-dependent. - */ - NumTables = (NewTable->Length - sizeof (ACPI_TABLE_HEADER)) / PointerSize; - AcpiOsPrintf ("There are %u tables defined in the %4.4s\n\n", - NumTables, NewTable->Signature); - - /* Get the FADT */ - - ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_FADT); - AcpiOsTableOverride (&TableHeader, &NewTable); - if (NewTable) - { - AdWriteTable (NewTable, NewTable->Length, - ACPI_SIG_FADT, NewTable->OemTableId); - } - AcpiOsPrintf ("\n"); - - /* Don't bother with FACS, it is usually all zeros */ - } - - /* Always get the DSDT */ + /* Get the DSDT via table override */ ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_DSDT); AcpiOsTableOverride (&TableHeader, &NewTable); - if (NewTable) - { - AdWriteTable (NewTable, NewTable->Length, - ACPI_SIG_DSDT, NewTable->OemTableId); - - /* Store DSDT in the Table Manager */ - - Status = AcpiTbStoreTable (0, NewTable, NewTable->Length, - 0, &TableIndex); - if (ACPI_FAILURE (Status)) - { - fprintf (stderr, "Could not store DSDT\n"); - return (AE_NO_ACPI_TABLES); - } - } - else + if (!NewTable) { fprintf (stderr, "Could not obtain DSDT\n"); return (AE_NO_ACPI_TABLES); } -#if 0 - /* TBD: Future implementation */ - - AcpiOsPrintf ("\n"); + AdWriteTable (NewTable, NewTable->Length, + ACPI_SIG_DSDT, NewTable->OemTableId); - /* Get all SSDTs */ + /* Store DSDT in the Table Manager */ - ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_SSDT); - do + Status = AcpiTbStoreTable (0, NewTable, NewTable->Length, + 0, &TableIndex); + if (ACPI_FAILURE (Status)) { - NewTable = NULL; - Status = AcpiOsTableOverride (&TableHeader, &NewTable); - - } while (NewTable); -#endif + fprintf (stderr, "Could not store DSDT\n"); + return (AE_NO_ACPI_TABLES); + } return (AE_OK); } Modified: vendor-sys/acpica/dist/source/common/dmextern.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmextern.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/common/dmextern.c Mon Feb 17 17:10:41 2014 (r262091) @@ -1265,10 +1265,16 @@ AcpiDmUnresolvedWarning ( " * were not specified. This resulting disassembler output file may not\n" " * compile because the disassembler did not know how many arguments\n" " * to assign to these methods. To specify the tables needed to resolve\n" - " * external control method references, use the one of the following\n" - " * example iASL invocations:\n" - " * iasl -e -d \n" - " * iasl -e -d \n" + " * external control method references, the -e option can be used to\n" + " * specify the filenames. Example iASL invocations:\n" + " * iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n" + " * iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n" + " * iasl -e ssdt*.aml -d dsdt.aml\n" + " *\n" + " * In addition, the -fe option can be used to specify a file containing\n" + " * control method external declarations with the associated method\n" + " * argument counts. Each line of the file must be of the form:\n" + " * External (, MethodObj, )\n" " */\n", AcpiGbl_NumExternalMethods); } @@ -1279,10 +1285,15 @@ AcpiDmUnresolvedWarning ( AcpiOsPrintf (" /*\n" " * iASL Warning: There were %u external control methods found during\n" " * disassembly, but only %u %s resolved (%u unresolved). Additional\n" - " * ACPI tables are required to properly disassemble the code. This\n" + " * ACPI tables may be required to properly disassemble the code. This\n" " * resulting disassembler output file may not compile because the\n" " * disassembler did not know how many arguments to assign to the\n" " * unresolved methods.\n" + " *\n" + " * If necessary, the -fe option can be used to specify a file containing\n" + " * control method external declarations with the associated method\n" + " * argument counts. Each line of the file must be of the form:\n" + " * External (, MethodObj, )\n" " */\n", AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods, (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"), @@ -1301,10 +1312,16 @@ AcpiDmUnresolvedWarning ( "were not specified. The resulting disassembler output file may not\n" "compile because the disassembler did not know how many arguments\n" "to assign to these methods. To specify the tables needed to resolve\n" - "external control method references, use the one of the following\n" - "example iASL invocations:\n" - " iasl -e -d \n" - " iasl -e -d \n", + "external control method references, the -e option can be used to\n" + "specify the filenames. Example iASL invocations:\n" + " iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n" + " iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n" + " iasl -e ssdt*.aml -d dsdt.aml\n" + "\n" + "In addition, the -fe option can be used to specify a file containing\n" + "control method external declarations with the associated method\n" + "argument counts. Each line of the file must be of the form:\n" + " External (, MethodObj, )\n", AcpiGbl_NumExternalMethods); } else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods) @@ -1314,10 +1331,15 @@ AcpiDmUnresolvedWarning ( fprintf (stderr, "\n" "iASL Warning: There were %u external control methods found during\n" "disassembly, but only %u %s resolved (%u unresolved). Additional\n" - "ACPI tables are required to properly disassemble the code. The\n" + "ACPI tables may be required to properly disassemble the code. The\n" "resulting disassembler output file may not compile because the\n" "disassembler did not know how many arguments to assign to the\n" - "unresolved methods.\n", + "unresolved methods.\n" + "\n" + "If necessary, the -fe option can be used to specify a file containing\n" + "control method external declarations with the associated method\n" + "argument counts. Each line of the file must be of the form:\n" + " External (, MethodObj, )\n", AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods, (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"), (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods)); Modified: vendor-sys/acpica/dist/source/common/dmtbinfo.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbinfo.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/common/dmtbinfo.c Mon Feb 17 17:10:41 2014 (r262091) @@ -1940,7 +1940,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[] = { {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterfaceType), "Interface Type", 0}, - {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved", DT_NON_ZERO}, /* Value must be 1 */ {ACPI_DMT_UINT16, ACPI_SPMI_OFFSET (SpecRevision), "IPMI Spec Version", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterruptType), "Interrupt Type", 0}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (GpeNumber), "GPE Number", 0}, Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.h Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h Mon Feb 17 17:10:41 2014 (r262091) @@ -280,6 +280,10 @@ ApCheckRegMethod ( * aslerror - error handling/reporting */ void +AslAbort ( + void); + +void AslError ( UINT8 Level, UINT8 MessageId, @@ -703,10 +707,6 @@ TrLinkPeerNodes ( * aslfiles - File I/O support */ void -AslAbort ( - void); - -void FlAddIncludeDirectory ( char *Dir); Modified: vendor-sys/acpica/dist/source/compiler/aslerror.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslerror.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslerror.c Mon Feb 17 17:10:41 2014 (r262091) @@ -56,6 +56,36 @@ AeAddToErrorLog ( /******************************************************************************* * + * FUNCTION: AslAbort + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Dump the error log and abort the compiler. Used for serious + * I/O errors. + * + ******************************************************************************/ + +void +AslAbort ( + void) +{ + + AePrintErrorLog (ASL_FILE_STDERR); + if (Gbl_DebugFlag) + { + /* Print error summary to stdout also */ + + AePrintErrorLog (ASL_FILE_STDOUT); + } + + exit (1); +} + + +/******************************************************************************* + * * FUNCTION: AeClearErrorLog * * PARAMETERS: None @@ -817,7 +847,8 @@ AslError ( /* Check if user wants to ignore this exception */ - if (AslIsExceptionDisabled (Level, MessageId)) + if (Gbl_AllExceptionsDisabled || + AslIsExceptionDisabled (Level, MessageId)) { return; } Modified: vendor-sys/acpica/dist/source/compiler/aslfileio.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfileio.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslfileio.c Mon Feb 17 17:10:41 2014 (r262091) @@ -46,35 +46,9 @@ #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslfileio") - -/******************************************************************************* - * - * FUNCTION: AslAbort - * - * PARAMETERS: None - * - * RETURN: None - * - * DESCRIPTION: Dump the error log and abort the compiler. Used for serious - * I/O errors. - * - ******************************************************************************/ - -void -AslAbort ( - void) -{ - - AePrintErrorLog (ASL_FILE_STDERR); - if (Gbl_DebugFlag) - { - /* Print error summary to stdout also */ - - AePrintErrorLog (ASL_FILE_STDOUT); - } - - exit (1); -} +long +UtGetFileSize ( + FILE *fp); /******************************************************************************* @@ -141,13 +115,73 @@ FlOpenFile ( /******************************************************************************* * + * FUNCTION: UtGetFileSize + * + * PARAMETERS: fp - Open file handle + * + * RETURN: File Size. -1 on error. + * + * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open. + * TBD: This function should be used to replace other similar + * functions in ACPICA. + * + ******************************************************************************/ + +long +UtGetFileSize ( + FILE *fp) +{ + long FileSize; + long CurrentOffset; + + + CurrentOffset = ftell (fp); + if (CurrentOffset < 0) + { + goto OffsetError; + } + + if (fseek (fp, 0, SEEK_END)) + { + goto SeekError; + } + + FileSize = ftell (fp); + if (FileSize < 0) + { + goto OffsetError; + } + + /* Restore file pointer */ + + if (fseek (fp, CurrentOffset, SEEK_SET)) + { + goto SeekError; + } + + return (FileSize); + + +OffsetError: + perror ("Could not get file offset"); + return (-1); + +SeekError: + perror ("Could not seek file"); + return (-1); +} + + +/******************************************************************************* + * * FUNCTION: FlGetFileSize * * PARAMETERS: FileId - Index into file info array * * RETURN: File Size * - * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open. + * DESCRIPTION: Get current file size. Uses common seek-to-EOF function. + * File must be open. Aborts compiler on error. * ******************************************************************************/ @@ -155,21 +189,16 @@ UINT32 FlGetFileSize ( UINT32 FileId) { - FILE *fp; - UINT32 FileSize; - long Offset; - + long FileSize; - fp = Gbl_Files[FileId].Handle; - Offset = ftell (fp); - fseek (fp, 0, SEEK_END); - FileSize = (UINT32) ftell (fp); - - /* Restore file pointer */ + FileSize = UtGetFileSize (Gbl_Files[FileId].Handle); + if (FileSize == -1) + { + AslAbort(); + } - fseek (fp, Offset, SEEK_SET); - return (FileSize); + return ((UINT32) FileSize); } Modified: vendor-sys/acpica/dist/source/compiler/aslglobal.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslglobal.h Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslglobal.h Mon Feb 17 17:10:41 2014 (r262091) @@ -159,7 +159,6 @@ ASL_EXTERN BOOLEAN ASL_ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_WarningsAsErrors, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoResourceChecking, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisasmFlag, FALSE); -ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_GetAllTables, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ReferenceOptimizationFlag, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayRemarks, TRUE); @@ -170,6 +169,7 @@ ASL_EXTERN BOOLEAN ASL_ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseTemplates, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileGeneric, FALSE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AllExceptionsDisabled, FALSE); #define HEX_OUTPUT_NONE 0 Modified: vendor-sys/acpica/dist/source/compiler/aslmain.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmain.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslmain.c Mon Feb 17 17:10:41 2014 (r262091) @@ -158,7 +158,6 @@ Usage ( ACPI_OPTION ("", " (Obtain DSDT from current system if no input file)"); ACPI_OPTION ("-e ", "Include ACPI table(s) for external symbol resolution"); ACPI_OPTION ("-fe ", "Specify external symbol declaration file"); - ACPI_OPTION ("-g", "Get ACPI tables and write to files (*.dat)"); ACPI_OPTION ("-in", "Ignore NoOp opcodes"); ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file"); @@ -319,16 +318,6 @@ main ( /* Perform global actions first/only */ - if (Gbl_GetAllTables) - { - Status = AslDoOneFile (NULL); - if (ACPI_FAILURE (Status)) - { - return (-1); - } - return (0); - } - if (Gbl_DisassembleAll) { while (argv[Index1]) Modified: vendor-sys/acpica/dist/source/compiler/aslmessages.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.h Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.h Mon Feb 17 17:10:41 2014 (r262091) @@ -445,7 +445,7 @@ char *AslMessages /* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name", /* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant", /* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents", -/* ASL_MSG_RESERVED_VALUE */ "Reserved field must be zero", +/* ASL_MSG_RESERVED_VALUE */ "Reserved field", /* ASL_MSG_UNKNOWN_LABEL */ "Label is undefined", /* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type", /* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature", Modified: vendor-sys/acpica/dist/source/compiler/asloptions.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asloptions.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/asloptions.c Mon Feb 17 17:10:41 2014 (r262091) @@ -118,8 +118,7 @@ AslCommandLine ( /* Next parameter must be the input filename */ if (!argv[AcpiGbl_Optind] && - !Gbl_DisasmFlag && - !Gbl_GetAllTables) + !Gbl_DisasmFlag) { printf ("Missing input filename\n"); BadCommandLine = TRUE; @@ -318,9 +317,8 @@ AslDoOptions ( case 'g': /* Get all ACPI tables */ - Gbl_GetAllTables = TRUE; - Gbl_DoCompile = FALSE; - break; + printf ("-g option is deprecated, use acpidump utility instead\n"); + exit (1); case 'h': Modified: vendor-sys/acpica/dist/source/compiler/aslpredef.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslpredef.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslpredef.c Mon Feb 17 17:10:41 2014 (r262091) @@ -251,10 +251,16 @@ ApCheckPredefinedReturnValue ( const ACPI_PREDEFINED_INFO *ThisName; - /* Check parent method for a match against the predefined name list */ - + /* + * Check parent method for a match against the predefined name list. + * + * Note: Disable compiler errors/warnings because any errors will be + * caught when analyzing the parent method. Eliminates duplicate errors. + */ + Gbl_AllExceptionsDisabled = TRUE; Index = ApCheckForPredefinedName (MethodInfo->Op, MethodInfo->Op->Asl.NameSeg); + Gbl_AllExceptionsDisabled = FALSE; switch (Index) { Modified: vendor-sys/acpica/dist/source/compiler/aslprepkg.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslprepkg.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslprepkg.c Mon Feb 17 17:10:41 2014 (r262091) @@ -169,7 +169,7 @@ ApCheckPackage ( { case ACPI_PTYPE1_FIXED: /* - * The package count is fixed and there are no sub-packages + * The package count is fixed and there are no subpackages * * If package is too small, exit. * If package is larger than expected, issue warning but continue @@ -194,7 +194,7 @@ ApCheckPackage ( case ACPI_PTYPE1_VAR: /* - * The package count is variable, there are no sub-packages, + * The package count is variable, there are no subpackages, * and all elements must be of the same type */ for (i = 0; i < Count; i++) @@ -207,7 +207,7 @@ ApCheckPackage ( case ACPI_PTYPE1_OPTION: /* - * The package count is variable, there are no sub-packages. + * The package count is variable, there are no subpackages. * There are a fixed number of required elements, and a variable * number of optional elements. * @@ -251,7 +251,7 @@ ApCheckPackage ( Op = Op->Asl.Next; Count--; - /* Examine the sub-packages */ + /* Examine the subpackages */ ApCheckPackageList (Predefined->Info.Name, Op, Package, 1, Count); @@ -259,7 +259,7 @@ ApCheckPackage ( case ACPI_PTYPE2_PKG_COUNT: - /* First element is the (Integer) count of sub-packages to follow */ + /* First element is the (Integer) count of subpackages to follow */ Status = ApCheckObjectType (Predefined->Info.Name, Op, ACPI_RTYPE_INTEGER, 0); @@ -283,7 +283,7 @@ ApCheckPackage ( Op = Op->Asl.Next; - /* Examine the sub-packages */ + /* Examine the subpackages */ ApCheckPackageList (Predefined->Info.Name, Op, Package, 1, Count); @@ -296,10 +296,10 @@ ApCheckPackage ( case ACPI_PTYPE2_FIX_VAR: /* * These types all return a single Package that consists of a - * variable number of sub-Packages. + * variable number of subpackages. */ - /* Examine the sub-packages */ + /* Examine the subpackages */ ApCheckPackageList (Predefined->Info.Name, Op, Package, 0, Count); @@ -494,7 +494,7 @@ ApCheckPackageList ( case ACPI_PTYPE2_FIXED: - /* Each sub-package has a fixed length */ + /* Each subpackage has a fixed length */ ExpectedCount = Package->RetInfo2.Count; if (Count < ExpectedCount) @@ -517,7 +517,7 @@ ApCheckPackageList ( case ACPI_PTYPE2_MIN: - /* Each sub-package has a variable but minimum length */ + /* Each subpackage has a variable but minimum length */ ExpectedCount = Package->RetInfo.Count1; if (Count < ExpectedCount) @@ -527,7 +527,7 @@ ApCheckPackageList ( break; } - /* Check the type of each sub-package element */ + /* Check the type of each subpackage element */ ApCheckPackageElements (PredefinedName, Op, Package->RetInfo.ObjectType1, Count, 0, 0); @@ -576,7 +576,7 @@ ApCheckPackageList ( Count = ExpectedCount; } - /* Check the type of each sub-package element */ + /* Check the type of each subpackage element */ Op = Op->Asl.Next; ApCheckPackageElements (PredefinedName, Op, Modified: vendor-sys/acpica/dist/source/compiler/aslstartup.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslstartup.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/aslstartup.c Mon Feb 17 17:10:41 2014 (r262091) @@ -251,7 +251,7 @@ AslDoDisassembly ( AcpiGbl_DbOpt_disasm = TRUE; Status = AdAmlDisassemble (AslToFile, Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_OutputFilenamePrefix, - &Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_GetAllTables); + &Gbl_Files[ASL_FILE_INPUT].Filename); if (ACPI_FAILURE (Status)) { return (Status); @@ -331,7 +331,7 @@ AslDoOneFile ( /* * AML Disassembly (Optional) */ - if (Gbl_DisasmFlag || Gbl_GetAllTables) + if (Gbl_DisasmFlag) { Status = AslDoDisassembly (); if (Status != AE_CTRL_CONTINUE) Modified: vendor-sys/acpica/dist/source/compiler/asltransform.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asltransform.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/asltransform.c Mon Feb 17 17:10:41 2014 (r262091) @@ -450,10 +450,6 @@ TrDoSwitch ( { /* Add an ELSE to complete the previous CASE */ - if (!Conditional) - { - return; - } NewOp = TrCreateLeafNode (PARSEOP_ELSE); NewOp->Asl.Parent = Conditional->Asl.Parent; TrAmlInitLineNumbers (NewOp, NewOp->Asl.Parent); @@ -620,11 +616,6 @@ TrDoSwitch ( { /* Convert the DEFAULT node to an ELSE */ - if (!Conditional) - { - return; - } - TrAmlInitNode (DefaultOp, PARSEOP_ELSE); DefaultOp->Asl.Parent = Conditional->Asl.Parent; Modified: vendor-sys/acpica/dist/source/compiler/dtfield.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dtfield.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/dtfield.c Mon Feb 17 17:10:41 2014 (r262091) @@ -311,21 +311,37 @@ DtCompileInteger ( return; } - /* Ensure that reserved fields are set to zero */ - /* TBD: should we set to zero, or just make this an ERROR? */ - /* TBD: Probably better to use a flag */ + /* + * Ensure that reserved fields are set properly. Note: uses + * the DT_NON_ZERO flag to indicate that the reserved value + * must be exactly one. Otherwise, the value must be zero. + * This is sufficient for now. + */ + + /* TBD: Should use a flag rather than compare "Reserved" */ - if (!ACPI_STRCMP (Field->Name, "Reserved") && - (Value != 0)) + if (!ACPI_STRCMP (Field->Name, "Reserved")) { - DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field, - "Setting to zero"); - Value = 0; + if (Flags & DT_NON_ZERO) + { + if (Value != 1) + { + DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field, + "Must be one, setting to one"); + Value = 1; + } + } + else if (Value != 0) + { + DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field, + "Must be zero, setting to zero"); + Value = 0; + } } /* Check if the value must be non-zero */ - if ((Value == 0) && (Flags & DT_NON_ZERO)) + else if ((Flags & DT_NON_ZERO) && (Value == 0)) { DtError (ASL_ERROR, ASL_MSG_ZERO_VALUE, Field, NULL); } Modified: vendor-sys/acpica/dist/source/compiler/dttemplate.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dttemplate.h Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/dttemplate.h Mon Feb 17 17:10:41 2014 (r262091) @@ -897,10 +897,10 @@ const unsigned char TemplateSpcr[] = const unsigned char TemplateSpmi[] = { 0x53,0x50,0x4D,0x49,0x41,0x00,0x00,0x00, /* 00000000 "SPMIA..." */ - 0x04,0xED,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x04,0x00,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x14,0x01,0x14,0x20,0x00,0x01,0x00,0x00, /* 00000020 "... ...." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ Modified: vendor-sys/acpica/dist/source/compiler/prmacros.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/prmacros.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/compiler/prmacros.c Mon Feb 17 17:10:41 2014 (r262091) @@ -360,7 +360,7 @@ PrAddMacro ( if (ArgCount >= PR_MAX_MACRO_ARGS) { PrError (ASL_ERROR, ASL_MSG_TOO_MANY_ARGUMENTS, TokenOffset); - return; + goto ErrorExit; } } @@ -400,7 +400,7 @@ PrAddMacro ( PrError (ASL_ERROR, ASL_MSG_TOO_MANY_ARGUMENTS, THIS_TOKEN_OFFSET (Token)); - return; + goto ErrorExit; } break; } @@ -432,7 +432,7 @@ AddMacroToList: THIS_TOKEN_OFFSET (Name)); } - return; + goto ErrorExit; } DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID @@ -451,6 +451,13 @@ AddMacroToList: DefineInfo->Args = Args; DefineInfo->ArgCount = ArgCount; } + + return; + + +ErrorExit: + ACPI_FREE (Args); + return; } Modified: vendor-sys/acpica/dist/source/components/debugger/dbdisply.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbdisply.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/components/debugger/dbdisply.c Mon Feb 17 17:10:41 2014 (r262091) @@ -303,6 +303,10 @@ AcpiDbDecodeAndDisplayObject ( /* Is not a recognizeable object */ + AcpiOsPrintf ( + "Not a known ACPI internal object, descriptor type %2.2X\n", + ACPI_GET_DESCRIPTOR_TYPE (ObjPtr)); + Size = 16; if (AcpiOsReadable (ObjPtr, 64)) { Modified: vendor-sys/acpica/dist/source/components/dispatcher/dsinit.c ============================================================================== --- vendor-sys/acpica/dist/source/components/dispatcher/dsinit.c Mon Feb 17 17:01:41 2014 (r262090) +++ vendor-sys/acpica/dist/source/components/dispatcher/dsinit.c Mon Feb 17 17:10:41 2014 (r262091) @@ -52,6 +52,7 @@ #define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dsinit") + /* Local prototypes */ static ACPI_STATUS @@ -91,8 +92,8 @@ AcpiDsInitOneObject ( { ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context; ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; - ACPI_OBJECT_TYPE Type; ACPI_STATUS Status; + ACPI_OPERAND_OBJECT *ObjDesc; ACPI_FUNCTION_ENTRY (); @@ -111,9 +112,7 @@ AcpiDsInitOneObject ( /* And even then, we are only interested in a few object types */ - Type = AcpiNsGetType (ObjHandle); - - switch (Type) + switch (AcpiNsGetType (ObjHandle)) { case ACPI_TYPE_REGION: @@ -129,8 +128,45 @@ AcpiDsInitOneObject ( break; case ACPI_TYPE_METHOD: - + /* + * Auto-serialization support. We will examine each method that is + * NotSerialized to determine if it creates any Named objects. If + * it does, it will be marked serialized to prevent problems if + * the method is entered by two or more threads and an attempt is + * made to create the same named object twice -- which results in + * an AE_ALREADY_EXISTS exception and method abort. + */ Info->MethodCount++; + ObjDesc = AcpiNsGetAttachedObject (Node); + if (!ObjDesc) + { + break; + } + + /* Ignore if already serialized */ + + if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED) + { + Info->SerialMethodCount++; + break; + } + + if (AcpiGbl_AutoSerializeMethods) + { + /* Parse/scan method and serialize it if necessary */ + + AcpiDsAutoSerializeMethod (Node, ObjDesc); + if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED) + { + /* Method was just converted to Serialized */ + + Info->SerialMethodCount++; + Info->SerializedMethodCount++; + break; + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***