From owner-svn-src-head@FreeBSD.ORG Mon Oct 19 16:12:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8652C106566C; Mon, 19 Oct 2009 16:12:58 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 718228FC16; Mon, 19 Oct 2009 16:12:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9JGCwO8006291; Mon, 19 Oct 2009 16:12:58 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9JGCwjK006277; Mon, 19 Oct 2009 16:12:58 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200910191612.n9JGCwjK006277@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 19 Oct 2009 16:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198237 - in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/debugger sys/contrib/dev/acpica/disassembler sys/contrib/d... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2009 16:12:58 -0000 Author: jkim Date: Mon Oct 19 16:12:58 2009 New Revision: 198237 URL: http://svn.freebsd.org/changeset/base/198237 Log: Merge ACPICA 20091013. Added: head/sys/contrib/dev/acpica/common/dmextern.c - copied, changed from r198235, vendor-sys/acpica/dist/common/dmextern.c Modified: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/getopt.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/debugger/dbcmds.c head/sys/contrib/dev/acpica/debugger/dbinput.c head/sys/contrib/dev/acpica/disassembler/dmutils.c head/sys/contrib/dev/acpica/disassembler/dmwalk.c head/sys/contrib/dev/acpica/dispatcher/dswload.c head/sys/contrib/dev/acpica/events/evregion.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/namespace/nsrepair.c head/sys/contrib/dev/acpica/utilities/utglobal.c head/usr.sbin/acpi/iasl/Makefile Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/changes.txt Mon Oct 19 16:12:58 2009 (r198237) @@ -1,10 +1,69 @@ ---------------------------------------- -03 September 2009. Summary of changes for version 20090903: +13 October 2009. Summary of changes for version 20091013: This release is available at www.acpica.org/downloads 1) ACPI CA Core Subsystem: +Fixed a problem where an Operation Region _REG method could be executed more +than once. If a custom address space handler is installed by the host before +the "initialize operation regions" phase of the ACPICA initialization, any +_REG methods for that address space could be executed twice. This change +fixes the problem. ACPICA BZ 427. Lin Ming. + +Fixed a possible memory leak for the Scope() ASL operator. When the exact +invocation of "Scope(\)" is executed (change scope to root), one internal +operand object was leaked. Lin Ming. + +Implemented a run-time repair for the _MAT predefined method. If the _MAT +return value is defined as a Field object in the AML, and the field +size is less than or equal to the default width of an integer (32 or 64),_MAT +can incorrectly return an Integer instead of a Buffer. ACPICA now +automatically repairs this problem. ACPICA BZ 810. + +Implemented a run-time repair for the _BIF and _BIX predefined methods. The +"OEM Information" field is often incorrectly returned as an Integer with +value zero if the field is not supported by the platform. This is due to an +ambiguity in the ACPI specification. The field should always be a string. +ACPICA now automatically repairs this problem by returning a NULL string +within the returned Package. ACPICA BZ 807. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 85.6K Code, 18.0K Data, 103.6K Total + Debug Version: 161.7K Code, 50.9K Data, 212.6K Total + Current Release: + Non-Debug Version: 85.8K Code, 18.0K Data, 103.8K Total + Debug Version: 161.8K Code, 50.6K Data, 212.4K Total + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Fixed a problem where references to external symbols that +contained one or more parent-prefixes (carats) were not handled correctly, +possibly causing a fault. ACPICA BZ 806. Lin Ming. + +Disassembler: Restructured the code so that all functions that handle +external symbols are in a single module. One new file is added, +common/dmextern.c. + +AML Debugger: Added a max count argument for the Batch command (which +executes multiple predefined methods within the namespace.) + +iASL: Updated the compiler documentation (User Reference.) Available at +http://www.acpica.org/documentation/. ACPICA BZ 750. + +AcpiXtract: Updated for Lint and other formatting changes. Close all open +files. + +---------------------------------------- +03 September 2009. Summary of changes for version 20090903: + +1) ACPI CA Core Subsystem: + For Windows Vista compatibility, added the automatic execution of an _INI method located at the namespace root (\_INI). This method is executed at table load time. This support is in addition to the automatic execution of @@ -74,8 +133,6 @@ subtables. ---------------------------------------- 30 July 2009. Summary of changes for version 20090730: -This release is available at www.acpica.org/downloads - The ACPI 4.0 implementation for ACPICA is complete with this release. 1) ACPI CA Core Subsystem: @@ -146,8 +203,6 @@ changes to existing tables. ACPICA BZ 77 ---------------------------------------- 25 June 2009. Summary of changes for version 20090625: -This release is available at www.acpica.org/downloads - The ACPI 4.0 Specification was released on June 16 and is available at www.acpi.info. ACPICA implementation of ACPI 4.0 is underway and will continue for the next few releases. @@ -224,8 +279,6 @@ predefined names and control methods (31 ---------------------------------------- 21 May 2009. Summary of changes for version 20090521: -This release is available at www.acpica.org/downloads - 1) ACPI CA Core Subsystem: Disabled the preservation of the SCI enable bit in the PM1 control register. @@ -297,8 +350,6 @@ after an invalid sub-table ID. ---------------------------------------- 22 April 2009. Summary of changes for version 20090422: -This release is available at www.acpica.org/downloads - 1) ACPI CA Core Subsystem: Fixed a compatibility issue with the recently released I/O port protection Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/common/adfile.c Mon Oct 19 16:12:58 2009 (r198237) @@ -119,7 +119,6 @@ #include #include -#include #define _COMPONENT ACPI_TOOLS @@ -135,12 +134,13 @@ AdWriteBuffer ( char FilenameBuf[20]; + /****************************************************************************** * * FUNCTION: AfGenerateFilename * - * PARAMETERS: Prefix - prefix string - * TableId - The table ID + * PARAMETERS: Prefix - prefix string + * TableId - The table ID * * RETURN: Pointer to the completed string * @@ -180,9 +180,9 @@ AdGenerateFilename ( * * FUNCTION: AfWriteBuffer * - * PARAMETERS: Filename - name of file - * Buffer - data to write - * Length - length of data + * PARAMETERS: Filename - name of file + * Buffer - data to write + * Length - length of data * * RETURN: Actual number of bytes written * @@ -217,10 +217,10 @@ AdWriteBuffer ( * * FUNCTION: AfWriteTable * - * PARAMETERS: Table - pointer to the ACPI table - * Length - length of the table - * TableName - the table signature - * OemTableID - from the table header + * PARAMETERS: Table - pointer to the ACPI table + * Length - length of the table + * TableName - the table signature + * OemTableID - from the table header * * RETURN: None * @@ -272,7 +272,7 @@ FlGenerateFilename ( * Copy the original filename to a new buffer. Leave room for the worst case * where we append the suffix, an added dot and the null terminator. */ - NewFilename = ACPI_ALLOCATE_ZEROED ( + NewFilename = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE) strlen (InputFilename) + strlen (Suffix) + 2); strcpy (NewFilename, InputFilename); @@ -314,7 +314,7 @@ FlStrdup ( char *NewString; - NewString = ACPI_ALLOCATE (strlen (String) + 1); + NewString = ACPI_ALLOCATE ((ACPI_SIZE) strlen (String) + 1); if (!NewString) { return (NULL); Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/common/adisasm.c Mon Oct 19 16:12:58 2009 (r198237) @@ -132,14 +132,18 @@ #define _COMPONENT ACPI_TOOLS ACPI_MODULE_NAME ("adisasm") -extern int AslCompilerdebug; + +extern int AslCompilerdebug; +extern char *Gbl_ExternalFilename; + ACPI_STATUS LsDisplayNamespace ( void); void -LsSetupNsList (void * Handle); +LsSetupNsList ( + void *Handle); /* Local prototypes */ @@ -153,14 +157,6 @@ void AdDisassemblerHeader ( char *Filename); -void -AdAddExternalsToNamespace ( - void); - -UINT32 -AdMethodExternalCount ( - void); - ACPI_STATUS AdDeferredParse ( ACPI_PARSE_OBJECT *Op, @@ -171,8 +167,6 @@ ACPI_STATUS AdParseDeferredOps ( ACPI_PARSE_OBJECT *Root); -ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot; - /* Stubs for ASL compiler */ @@ -192,7 +186,6 @@ AcpiDsMethodError ( { return (Status); } - #endif ACPI_STATUS @@ -238,18 +231,19 @@ AcpiDsMethodDataInitArgs ( } -ACPI_TABLE_DESC LocalTables[1]; +static ACPI_TABLE_DESC LocalTables[1]; +static ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot; /******************************************************************************* * * FUNCTION: AdInitialize * - * PARAMETERS: None. + * PARAMETERS: None * * RETURN: Status * - * DESCRIPTION: CA initialization + * DESCRIPTION: ACPICA and local initialization * ******************************************************************************/ @@ -296,89 +290,15 @@ AdInitialize ( } -/******************************************************************************* - * - * FUNCTION: AdAddExternalsToNamespace - * - * PARAMETERS: - * - * RETURN: None - * - * DESCRIPTION: - * - ******************************************************************************/ - -void -AdAddExternalsToNamespace ( - void) -{ - ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *Node; - ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; - ACPI_OPERAND_OBJECT *MethodDesc; - - - while (External) - { - Status = AcpiNsLookup (NULL, External->InternalPath, External->Type, - ACPI_IMODE_LOAD_PASS1, ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, - NULL, &Node); - - if (External->Type == ACPI_TYPE_METHOD) - { - MethodDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); - MethodDesc->Method.ParamCount = (UINT8) External->Value; - Node->Object = MethodDesc; - } - - External = External->Next; - } -} - - -/******************************************************************************* - * - * FUNCTION: AdMethodExternalCount - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Return the number of externals that have been generated - * - ******************************************************************************/ - -UINT32 -AdMethodExternalCount ( - void) -{ - ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; - UINT32 Count = 0; - - - while (External) - { - if (External->Type == ACPI_TYPE_METHOD) - { - Count++; - } - - External = External->Next; - } - - return (Count); -} - - /****************************************************************************** * * FUNCTION: AdAmlDisassemble * - * PARAMETERS: Filename - AML input filename - * 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 + * PARAMETERS: Filename - AML input filename + * 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 * @@ -386,8 +306,6 @@ AdMethodExternalCount ( * *****************************************************************************/ -extern char *Gbl_ExternalFilename; - ACPI_STATUS AdAmlDisassemble ( BOOLEAN OutToFile, @@ -403,12 +321,11 @@ AdAmlDisassemble ( ACPI_TABLE_HEADER *Table = NULL; ACPI_TABLE_HEADER *ExternalTable; ACPI_OWNER_ID OwnerId; - ACPI_EXTERNAL_LIST *NextExternal; /* - * Input: AML Code from either a file, - * or via GetTables (memory or registry) + * Input: AML code from either a file or via GetTables (memory or + * registry) */ if (Filename) { @@ -462,13 +379,7 @@ AdAmlDisassemble ( /* Clear external list generated by Scope in external tables */ - while (AcpiGbl_ExternalList) - { - NextExternal = AcpiGbl_ExternalList->Next; - ACPI_FREE (AcpiGbl_ExternalList->Path); - ACPI_FREE (AcpiGbl_ExternalList); - AcpiGbl_ExternalList = NextExternal; - } + AcpiDmClearExternalList (); } } else @@ -501,8 +412,7 @@ AdAmlDisassemble ( } /* - * Output: ASL code. - * Redirect to a file if requested + * Output: ASL code. Redirect to a file if requested */ if (OutToFile) { @@ -589,11 +499,11 @@ AdAmlDisassemble ( * tree with the new information (namely, the number of arguments per * method) */ - if (AdMethodExternalCount ()) + if (AcpiDmGetExternalMethodCount ()) { fprintf (stderr, "\nFound %d external control methods, reparsing with new information\n", - AdMethodExternalCount()); + AcpiDmGetExternalMethodCount ()); /* * Reparse, rebuild namespace. no need to xref namespace @@ -611,7 +521,7 @@ AdAmlDisassemble ( AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST; Status = AcpiNsRootInitialize (); - AdAddExternalsToNamespace (); + AcpiDmAddExternalsToNamespace (); /* Parse table. No need to reload it, however (FALSE) */ @@ -855,9 +765,9 @@ AdDisplayTables ( * * FUNCTION: AdDeferredParse * - * PARAMETERS: Op - Root Op of the deferred opcode - * Aml - Pointer to the raw AML - * AmlLength - Length of the AML + * PARAMETERS: Op - Root Op of the deferred opcode + * Aml - Pointer to the raw AML + * AmlLength - Length of the AML * * RETURN: Status * @@ -981,7 +891,7 @@ AdDeferredParse ( * * FUNCTION: AdParseDeferredOps * - * PARAMETERS: Root - Root of the parse tree + * PARAMETERS: Root - Root of the parse tree * * RETURN: Status * @@ -1055,8 +965,8 @@ AdParseDeferredOps ( * * FUNCTION: AdGetLocalTables * - * PARAMETERS: Filename - Not used - * GetAllTables - TRUE if all tables are desired + * PARAMETERS: Filename - Not used + * GetAllTables - TRUE if all tables are desired * * RETURN: Status * @@ -1138,6 +1048,11 @@ AdGetLocalTables ( 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 { @@ -1169,10 +1084,10 @@ AdGetLocalTables ( * * FUNCTION: AdParseTable * - * PARAMETERS: Table - Pointer to the raw table - * OwnerId - Returned OwnerId of the table - * LoadTable - If add table to the global table list - * External - If this is an external table + * PARAMETERS: Table - Pointer to the raw table + * OwnerId - Returned OwnerId of the table + * LoadTable - If add table to the global table list + * External - If this is an external table * * RETURN: Status * Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/common/adwalk.c Mon Oct 19 16:12:58 2009 (r198237) @@ -118,7 +118,6 @@ #include #include #include -#include #include #include #include @@ -184,7 +183,7 @@ AcpiDmResourceDescendingOp ( * * FUNCTION: AcpiDmDumpTree * - * PARAMETERS: Origin - Starting object + * PARAMETERS: Origin - Starting object * * RETURN: None * @@ -218,7 +217,7 @@ AcpiDmDumpTree ( * * FUNCTION: AcpiDmFindOrphanMethods * - * PARAMETERS: Origin - Starting object + * PARAMETERS: Origin - Starting object * * RETURN: None * @@ -426,7 +425,6 @@ AcpiDmDumpDescending ( void *Context) { ACPI_OP_WALK_INFO *Info = Context; - const ACPI_OPCODE_INFO *OpInfo; char *Path; @@ -435,11 +433,9 @@ AcpiDmDumpDescending ( return (AE_OK); } - OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - Info->Count++; - /* Most of the information (count, level, name) here */ + Info->Count++; AcpiOsPrintf ("% 5d [%2.2d] ", Info->Count, Level); AcpiDmIndent (Level); AcpiOsPrintf ("%-28s", AcpiPsGetOpcodeName (Op->Common.AmlOpcode)); @@ -472,7 +468,7 @@ AcpiDmDumpDescending ( case AML_METHOD_OP: case AML_DEVICE_OP: case AML_INT_NAMEDFIELD_OP: - AcpiOsPrintf ("%4.4s", &Op->Named.Name); + AcpiOsPrintf ("%4.4s", ACPI_CAST_PTR (char, &Op->Named.Name)); break; default: @@ -536,7 +532,7 @@ AcpiDmFindOrphanDescending ( { /* This NamePath has no args, assume it is an integer */ - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); return (AE_OK); } @@ -547,11 +543,11 @@ AcpiDmFindOrphanDescending ( { /* One Arg means this is just a Store(Name,Target) */ - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); return (AE_OK); } - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); } break; #endif @@ -567,7 +563,7 @@ AcpiDmFindOrphanDescending ( { /* This NamePath has no args, assume it is an integer */ - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); return (AE_OK); } @@ -576,11 +572,11 @@ AcpiDmFindOrphanDescending ( { /* One Arg means this is just a Store(Name,Target) */ - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); return (AE_OK); } - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); } break; @@ -611,7 +607,7 @@ AcpiDmFindOrphanDescending ( /* And namepath is the first argument */ (ParentOp->Common.Value.Arg == Op)) { - AcpiDmAddToExternalList (Op->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_INTEGER, 0); break; } } @@ -621,7 +617,7 @@ AcpiDmFindOrphanDescending ( * operator) - it *must* be a method invocation, nothing else is * grammatically possible. */ - AcpiDmAddToExternalList (Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); + AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); } break; @@ -858,7 +854,7 @@ AcpiDmXrefDescendingOp ( { if (Status == AE_NOT_FOUND) { - AcpiDmAddToExternalList (Path, (UINT8) ObjectType, 0); + AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType, 0); /* * We could install this into the namespace, but we catch duplicate @@ -888,12 +884,12 @@ AcpiDmXrefDescendingOp ( if (ObjectType2 == ACPI_TYPE_METHOD) { - AcpiDmAddToExternalList (Path, ACPI_TYPE_METHOD, + AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_METHOD, Object->Method.ParamCount); } else { - AcpiDmAddToExternalList (Path, (UINT8) ObjectType2, 0); + AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, 0); } Op->Common.Node = Node; Copied and modified: head/sys/contrib/dev/acpica/common/dmextern.c (from r198235, vendor-sys/acpica/dist/common/dmextern.c) ============================================================================== --- vendor-sys/acpica/dist/common/dmextern.c Mon Oct 19 15:50:59 2009 (r198235, copy source) +++ head/sys/contrib/dev/acpica/common/dmextern.c Mon Oct 19 16:12:58 2009 (r198237) @@ -113,11 +113,11 @@ * *****************************************************************************/ -#include "acpi.h" -#include "accommon.h" -#include "amlcode.h" -#include "acnamesp.h" -#include "acdisasm.h" +#include +#include +#include +#include +#include /* Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/common/dmtable.c Mon Oct 19 16:12:58 2009 (r198237) @@ -218,7 +218,6 @@ static const char *AcpiDmIvrsS }; - #define ACPI_FADT_PM_RESERVED 8 static const char *AcpiDmFadtProfiles[] = @@ -954,7 +953,7 @@ AcpiDmCheckAscii ( for (i = 0; i < Count; i++) { - RepairedName[i] = Name[i]; + RepairedName[i] = (char) Name[i]; if (!Name[i]) { Modified: head/sys/contrib/dev/acpica/common/getopt.c ============================================================================== --- head/sys/contrib/dev/acpica/common/getopt.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/common/getopt.c Mon Oct 19 16:12:58 2009 (r198237) @@ -195,9 +195,9 @@ AcpiGetopt( if (*++OptsPtr == ':') { - if (argv[AcpiGbl_Optind][CurrentCharPtr+1] != '\0') + if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0') { - AcpiGbl_Optarg = &argv[AcpiGbl_Optind++][CurrentCharPtr+1]; + AcpiGbl_Optarg = &argv[AcpiGbl_Optind++][(int) (CurrentCharPtr+1)]; } else if (++AcpiGbl_Optind >= argc) { @@ -218,9 +218,9 @@ AcpiGetopt( else if (*OptsPtr == '^') { - if (argv[AcpiGbl_Optind][CurrentCharPtr+1] != '\0') + if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0') { - AcpiGbl_Optarg = &argv[AcpiGbl_Optind][CurrentCharPtr+1]; + AcpiGbl_Optarg = &argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)]; } else { Modified: head/sys/contrib/dev/acpica/compiler/aslload.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslload.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/compiler/aslload.c Mon Oct 19 16:12:58 2009 (r198237) @@ -575,7 +575,9 @@ LdNamespace1Begin ( goto FinishNode; } - AslCoreSubsystemError (Op, Status, "Failure from lookup\n", FALSE); + AslCoreSubsystemError (Op, Status, + "Failure from namespace lookup", FALSE); + goto Exit; } @@ -718,7 +720,7 @@ LdNamespace1Begin ( else { AslCoreSubsystemError (Op, Status, - "Failure from lookup %s\n", FALSE); + "Failure from namespace lookup", FALSE); goto Exit; } } @@ -885,7 +887,8 @@ LdNamespace2Begin ( return (AE_OK); } - AslCoreSubsystemError (Op, Status, "Failure from lookup\n", FALSE); + AslCoreSubsystemError (Op, Status, + "Failure from namespace lookup", FALSE); return (AE_OK); } Modified: head/sys/contrib/dev/acpica/debugger/dbcmds.c ============================================================================== --- head/sys/contrib/dev/acpica/debugger/dbcmds.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/debugger/dbcmds.c Mon Oct 19 16:12:58 2009 (r198237) @@ -130,6 +130,7 @@ #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbcmds") + /* Local prototypes */ static ACPI_STATUS @@ -501,7 +502,7 @@ AcpiDbWalkForExecute ( void **ReturnValue) { ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; - UINT32 *Count = (UINT32 *) Context; + ACPI_EXECUTE_WALK *Info = (ACPI_EXECUTE_WALK *) Context; ACPI_BUFFER ReturnObj; ACPI_STATUS Status; char *Pathname; @@ -542,7 +543,6 @@ AcpiDbWalkForExecute ( if (ObjInfo->Type == ACPI_TYPE_METHOD) { - /* Setup default parameters */ for (i = 0; i < ObjInfo->ParamCount; i++) @@ -556,11 +556,9 @@ AcpiDbWalkForExecute ( } ACPI_FREE (ObjInfo); - ReturnObj.Pointer = NULL; ReturnObj.Length = ACPI_ALLOCATE_BUFFER; - /* Do the actual method execution */ AcpiGbl_MethodExecuting = TRUE; @@ -569,11 +567,21 @@ AcpiDbWalkForExecute ( AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status)); AcpiGbl_MethodExecuting = FALSE; - ACPI_FREE (Pathname); - (*Count)++; - return (AE_OK); + /* Ignore status from method execution */ + + Status = AE_OK; + + /* Update count, check if we have executed enough methods */ + + Info->Count++; + if (Info->Count >= Info->MaxCount) + { + Status = AE_CTRL_TERMINATE; + } + + return (Status); } @@ -581,27 +589,37 @@ AcpiDbWalkForExecute ( * * FUNCTION: AcpiDbBatchExecute * - * PARAMETERS: None + * PARAMETERS: CountArg - Max number of methods to execute * * RETURN: None * - * DESCRIPTION: Namespace batch execution. + * DESCRIPTION: Namespace batch execution. Execute predefined names in the + * namespace, up to the max count, if specified. * ******************************************************************************/ void AcpiDbBatchExecute ( - void) + char *CountArg) { - UINT32 Count = 0; + ACPI_EXECUTE_WALK Info; + + + Info.Count = 0; + Info.MaxCount = ACPI_UINT32_MAX; + + if (CountArg) + { + Info.MaxCount = ACPI_STRTOUL (CountArg, NULL, 0); + } /* Search all nodes in namespace */ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbWalkForExecute, (void *) &Count, NULL); + AcpiDbWalkForExecute, (void *) &Info, NULL); - AcpiOsPrintf ("Executed %d predefined names in the namespace\n", Count); + AcpiOsPrintf ("Executed %d predefined names in the namespace\n", Info.Count); } Modified: head/sys/contrib/dev/acpica/debugger/dbinput.c ============================================================================== --- head/sys/contrib/dev/acpica/debugger/dbinput.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/debugger/dbinput.c Mon Oct 19 16:12:58 2009 (r198237) @@ -644,7 +644,7 @@ AcpiDbCommandDispatch ( break; case CMD_BATCH: - AcpiDbBatchExecute (); + AcpiDbBatchExecute (AcpiGbl_DbArgs[1]); break; case CMD_BREAKPOINT: Modified: head/sys/contrib/dev/acpica/disassembler/dmutils.c ============================================================================== --- head/sys/contrib/dev/acpica/disassembler/dmutils.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/disassembler/dmutils.c Mon Oct 19 16:12:58 2009 (r198237) @@ -129,9 +129,6 @@ ACPI_MODULE_NAME ("dmutils") -ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList = NULL; - - /* Data used in keeping track of fields */ #if 0 const char *AcpiGbl_FENames[] = @@ -202,121 +199,6 @@ const char *AcpiGbl }; -#ifdef ACPI_ASL_COMPILER -/******************************************************************************* - * - * FUNCTION: AcpiDmAddToExternalList - * - * PARAMETERS: Path - Internal (AML) path to the object - * - * RETURN: None - * - * DESCRIPTION: Insert a new path into the list of Externals which will in - * turn be emitted as an External() declaration in the disassembled - * output. - * - ******************************************************************************/ - -void -AcpiDmAddToExternalList ( - char *Path, - UINT8 Type, - UINT32 Value) -{ - char *ExternalPath; - ACPI_EXTERNAL_LIST *NewExternal; - ACPI_EXTERNAL_LIST *NextExternal; - ACPI_EXTERNAL_LIST *PrevExternal = NULL; - ACPI_STATUS Status; - - - if (!Path) - { - return; - } - - /* Externalize the ACPI path */ - - Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path, - NULL, &ExternalPath); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Ensure that we don't have duplicate externals */ - - NextExternal = AcpiGbl_ExternalList; - while (NextExternal) - { - /* Allow upgrade of type from ANY */ - - if (!ACPI_STRCMP (ExternalPath, NextExternal->Path)) - { - /* Duplicate method, check that the Value (ArgCount) is the same */ - - if ((NextExternal->Type == ACPI_TYPE_METHOD) && - (NextExternal->Value != Value)) - { - ACPI_ERROR ((AE_INFO, "Argument count mismatch for method %s %d %d", - NextExternal->Path, NextExternal->Value, Value)); - } - if (NextExternal->Type == ACPI_TYPE_ANY) - { - NextExternal->Type = Type; - NextExternal->Value = Value; - } - ACPI_FREE (ExternalPath); - return; - } - NextExternal = NextExternal->Next; - } - - /* Allocate and init a new External() descriptor */ - - NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST)); - NewExternal->InternalPath = Path; - NewExternal->Path = ExternalPath; - NewExternal->Type = Type; - NewExternal->Value = Value; - NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath); - - /* Link the new descriptor into the global list, ordered by string length */ - - NextExternal = AcpiGbl_ExternalList; - while (NextExternal) - { - if (NewExternal->Length <= NextExternal->Length) - { - if (PrevExternal) - { - PrevExternal->Next = NewExternal; - } - else - { - AcpiGbl_ExternalList = NewExternal; - } - - NewExternal->Next = NextExternal; - return; - } - - PrevExternal = NextExternal; - NextExternal = NextExternal->Next; - } - - if (PrevExternal) - { - PrevExternal->Next = NewExternal; - } - else - { - AcpiGbl_ExternalList = NewExternal; - } -} -#endif - - /******************************************************************************* * * FUNCTION: AcpiDmDecodeAttribute Modified: head/sys/contrib/dev/acpica/disassembler/dmwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/disassembler/dmwalk.c Mon Oct 19 16:00:24 2009 (r198236) +++ head/sys/contrib/dev/acpica/disassembler/dmwalk.c Mon Oct 19 16:12:58 2009 (r198237) @@ -130,6 +130,17 @@ #define DB_FULL_OP_INFO "[%4.4s] @%5.5X #%4.4X: " +/* Stub for non-compiler code */ + +#ifndef ACPI_ASL_COMPILER +void +AcpiDmEmitExternals ( + void) +{ + return; +} +#endif + /* Local prototypes */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***