From owner-svn-src-all@FreeBSD.ORG Fri Aug 6 23:11:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8596D1065678; Fri, 6 Aug 2010 23:11:19 +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 6D4088FC14; Fri, 6 Aug 2010 23:11:19 +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 o76NBJQj059524; Fri, 6 Aug 2010 23:11:19 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o76NBJmR059509; Fri, 6 Aug 2010 23:11:19 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201008062311.o76NBJmR059509@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 6 Aug 2010 23:11:19 +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: r210976 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/debugger sys/contrib/dev/acpica/events sys/contri... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 06 Aug 2010 23:11:19 -0000 Author: jkim Date: Fri Aug 6 23:11:19 2010 New Revision: 210976 URL: http://svn.freebsd.org/changeset/base/210976 Log: Merge ACPICA 20100806. Added: head/sys/contrib/dev/acpica/utilities/utosi.c - copied, changed from r210945, vendor-sys/acpica/dist/utilities/utosi.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/debugger/dbcmds.c head/sys/contrib/dev/acpica/debugger/dbinput.c head/sys/contrib/dev/acpica/events/evxfevnt.c head/sys/contrib/dev/acpica/executer/exfldio.c head/sys/contrib/dev/acpica/executer/exprep.c 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/acobject.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/osunixxf.c head/sys/contrib/dev/acpica/utilities/uteval.c head/sys/contrib/dev/acpica/utilities/utglobal.c head/sys/contrib/dev/acpica/utilities/utinit.c head/sys/contrib/dev/acpica/utilities/utmutex.c head/sys/contrib/dev/acpica/utilities/utxface.c head/sys/dev/acpica/Osd/OsdHardware.c head/sys/dev/acpica/Osd/OsdMemory.c head/sys/modules/acpi/acpi/Makefile head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 6 22:06:12 2010 (r210975) +++ head/sys/conf/files Fri Aug 6 23:11:19 2010 (r210976) @@ -285,6 +285,7 @@ contrib/dev/acpica/utilities/utmath.c o contrib/dev/acpica/utilities/utmisc.c optional acpi contrib/dev/acpica/utilities/utmutex.c optional acpi contrib/dev/acpica/utilities/utobject.c optional acpi +contrib/dev/acpica/utilities/utosi.c optional acpi contrib/dev/acpica/utilities/utresrc.c optional acpi contrib/dev/acpica/utilities/utstate.c optional acpi contrib/dev/acpica/utilities/utxface.c optional acpi Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Fri Aug 6 22:06:12 2010 (r210975) +++ head/sys/contrib/dev/acpica/changes.txt Fri Aug 6 23:11:19 2010 (r210976) @@ -1,7 +1,68 @@ ---------------------------------------- -02 July 2010. Summary of changes for version 20100702: +06 August 2010. Summary of changes for version 20100806: + +1) ACPI CA Core Subsystem: + +Designed and implemented a new host interface to the _OSI support code. This +will allow the host to dynamically add or remove multiple _OSI strings, as +well as install an optional handler that is called for each _OSI invocation. +Also added a new AML debugger command, 'osi' to display and modify the global +_OSI string table, and test support in the AcpiExec utility. See the ACPICA +reference manual for full details. Lin Ming, Bob Moore. ACPICA BZ 836. +New Functions: + AcpiInstallInterface - Add an _OSI string. + AcpiRemoveInterface - Delete an _OSI string. + AcpiInstallInterfaceHandler - Install optional _OSI handler. +Obsolete Functions: + AcpiOsValidateInterface - no longer used. +New Files: + source/components/utilities/utosi.c + +Re-introduced the support to enable multi-byte transfers for Embedded +Controller (EC) operation regions. A reported problem was found to be a bug +in the host OS, not in the multi-byte support. Previously, the maximum data +size passed to the EC operation region handler was a single byte. There are +often EC Fields larger than one byte that need to be transferred, and it is +useful for the EC driver to lock these as a single transaction. This change +enables single transfers larger than 8 bits. This effectively changes the +access to the EC space from ByteAcc to AnyAcc, and will probably require +changes to the host OS Embedded Controller driver to enable 16/32/64/256-bit +transfers in addition to 8-bit transfers. Alexey Starikovskiy, Lin Ming. + +Fixed a problem with the prototype for AcpiOsReadPciConfiguration. The +prototype in acpiosxf.h had the output value pointer as a (void *). +It should be a (UINT64 *). This may affect some host OSL code. + +Fixed a couple problems with the recently modified Linux makefiles for iASL +and AcpiExec. These new makefiles place the generated object files in the +local directory so that there can be no collisions between the files that are +shared between them that are compiled with different options. + +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: 88.3K Code, 18.8K Data, 107.1K Total + Debug Version: 164.0K Code, 51.5K Data, 215.5K Total + Current Release: + Non-Debug Version: 89.1K Code, 19.0K Data, 108.1K Total + Debug Version: 165.1K Code, 51.9K Data, 217.0K Total -This release is available at www.acpica.org/downloads +2) iASL Compiler/Disassembler and Tools: + +iASL/Disassembler: Added a new option (-da, "disassemble all") to load the +namespace from and disassemble an entire group of AML files. Useful for +loading all of the AML tables for a given machine (DSDT, SSDT1...SSDTn) and +disassembling with one simple command. ACPICA BZ 865. Lin Ming. + +iASL: Allow multiple invocations of -e option. This change allows multiple +uses of -e on the command line: "-e ssdt1.dat -e ssdt2.dat". ACPICA BZ 834. +Lin Ming. + +---------------------------------------- +02 July 2010. Summary of changes for version 20100702: 1) ACPI CA Core Subsystem: @@ -77,8 +138,6 @@ the #define __APPLE__ to enable this sup ---------------------------------------- 28 May 2010. Summary of changes for version 20100528: -This release is available at www.acpica.org/downloads - Note: The ACPI 4.0a specification was released on April 5, 2010 and is available at www.acpi.info. This is primarily an errata release. Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Fri Aug 6 22:06:12 2010 (r210975) +++ head/sys/contrib/dev/acpica/common/adisasm.c Fri Aug 6 23:11:19 2010 (r210976) @@ -134,7 +134,6 @@ extern int AslCompilerdebug; -extern char *Gbl_ExternalFilename; ACPI_STATUS @@ -313,6 +312,7 @@ AdAmlDisassemble ( ACPI_STATUS Status; char *DisasmFilename = NULL; char *ExternalFilename; + ACPI_EXTERNAL_FILE *ExternalFileList = AcpiGbl_ExternalFileList; FILE *File = NULL; ACPI_TABLE_HEADER *Table = NULL; ACPI_TABLE_HEADER *ExternalTable; @@ -335,46 +335,54 @@ AdAmlDisassemble ( * External filenames separated by commas * Example: iasl -e file1,file2,file3 -d xxx.aml */ - if (Gbl_ExternalFilename) + while (ExternalFileList) { - ExternalFilename = strtok (Gbl_ExternalFilename, ","); + ExternalFilename = ExternalFileList->Path; + if (!ACPI_STRCMP (ExternalFilename, Filename)) + { + /* Next external file */ + + ExternalFileList = ExternalFileList->Next; - while (ExternalFilename) + continue; + } + + Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable); + if (ACPI_FAILURE (Status)) { - Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable); + return Status; + } + + /* Load external table for symbol resolution */ + + if (ExternalTable) + { + Status = AdParseTable (ExternalTable, &OwnerId, TRUE, TRUE); if (ACPI_FAILURE (Status)) { + AcpiOsPrintf ("Could not parse external ACPI tables, %s\n", + AcpiFormatException (Status)); return Status; } - /* Load external table for symbol resolution */ - - if (ExternalTable) - { - Status = AdParseTable (ExternalTable, &OwnerId, TRUE, TRUE); - if (ACPI_FAILURE (Status)) - { - AcpiOsPrintf ("Could not parse external ACPI tables, %s\n", - AcpiFormatException (Status)); - return Status; - } - - /* - * Load namespace from names created within control methods - * Set owner id of nodes in external table - */ - AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot, - AcpiGbl_RootNode, OwnerId); - AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot); - } + /* + * Load namespace from names created within control methods + * Set owner id of nodes in external table + */ + AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot, + AcpiGbl_RootNode, OwnerId); + AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot); + } - /* Next external file name */ + /* Next external file */ - ExternalFilename = strtok (NULL, ","); - } + ExternalFileList = ExternalFileList->Next; + } - /* Clear external list generated by Scope in external tables */ + /* Clear external list generated by Scope in external tables */ + if (AcpiGbl_ExternalFileList) + { AcpiDmClearExternalList (); } } Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Fri Aug 6 22:06:12 2010 (r210975) +++ head/sys/contrib/dev/acpica/common/dmextern.c Fri Aug 6 23:11:19 2010 (r210976) @@ -312,6 +312,95 @@ Cleanup: /******************************************************************************* * + * FUNCTION: AcpiDmAddToExternalFileList + * + * PARAMETERS: PathList - Single path or list separated by comma + * + * RETURN: None + * + * DESCRIPTION: Add external files to global list + * + ******************************************************************************/ + +ACPI_STATUS +AcpiDmAddToExternalFileList ( + char *PathList) +{ + ACPI_EXTERNAL_FILE *ExternalFile; + char *Path; + char *TmpPath; + + + if (!PathList) + { + return (AE_OK); + } + + Path = strtok (PathList, ","); + + while (Path) + { + TmpPath = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (Path) + 1); + if (!TmpPath) + { + return (AE_NO_MEMORY); + } + + ACPI_STRCPY (TmpPath, Path); + + ExternalFile = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_FILE)); + if (!ExternalFile) + { + ACPI_FREE (TmpPath); + return (AE_NO_MEMORY); + } + + ExternalFile->Path = TmpPath; + + if (AcpiGbl_ExternalFileList) + { + ExternalFile->Next = AcpiGbl_ExternalFileList; + } + + AcpiGbl_ExternalFileList = ExternalFile; + Path = strtok (NULL, ","); + } + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmClearExternalFileList + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Clear the external file list + * + ******************************************************************************/ + +void +AcpiDmClearExternalFileList ( + void) +{ + ACPI_EXTERNAL_FILE *NextExternal; + + + while (AcpiGbl_ExternalFileList) + { + NextExternal = AcpiGbl_ExternalFileList->Next; + ACPI_FREE (AcpiGbl_ExternalFileList->Path); + ACPI_FREE (AcpiGbl_ExternalFileList); + AcpiGbl_ExternalFileList = NextExternal; + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmAddToExternalList * * PARAMETERS: Op - Current parser Op Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Fri Aug 6 22:06:12 2010 (r210975) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Fri Aug 6 23:11:19 2010 (r210976) @@ -195,9 +195,14 @@ void AslInitializeGlobals ( void); +typedef +ACPI_STATUS (*ASL_PATHNAME_CALLBACK) ( + char *); + ACPI_STATUS AslDoOnePathname ( - char *Pathname); + char *Pathname, + ASL_PATHNAME_CALLBACK Callback); ACPI_STATUS AslDoOneFile ( Modified: head/sys/contrib/dev/acpica/compiler/aslglobal.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslglobal.h Fri Aug 6 22:06:12 2010 (r210975) +++ head/sys/contrib/dev/acpica/compiler/aslglobal.h Fri Aug 6 23:11:19 2010 (r210976) @@ -171,6 +171,7 @@ ASL_EXTERN ASL_ERROR_MSG ASL_ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoCompile, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoSignon, TRUE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisassembleAll, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_Acpi2, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, TRUE); @@ -214,7 +215,6 @@ ASL_EXTERN BOOLEAN ASL_ ASL_EXTERN ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES]; ASL_EXTERN char *Gbl_DirectoryPath; -ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_ExternalFilename, NULL); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_IncludeFilename, NULL); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_OutputFilenamePrefix, NULL); ASL_EXTERN ASL_INCLUDE_DIR ASL_INIT_GLOBAL (*Gbl_IncludeDirList, NULL); Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Fri Aug 6 22:06:12 2010 (r210975) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Fri Aug 6 23:11:19 2010 (r210976) @@ -119,6 +119,7 @@ #include #include +#include #ifdef _DEBUG #include @@ -224,6 +225,7 @@ Options ( printf ("\nAML Disassembler:\n"); printf (" -d [file] Disassemble or decode binary ACPI table to file (*.dsl)\n"); + printf (" -da [f1,f2] Disassemble multiple tables from single namespace\n"); printf (" -dc [file] Disassemble AML and immediately compile it\n"); printf (" (Obtain DSDT from current system if no input file)\n"); printf (" -e [f1,f2] Include ACPI table(s) for external symbol resolution\n"); @@ -534,6 +536,11 @@ AslDoOptions ( Gbl_DoCompile = FALSE; break; + case 'a': + Gbl_DoCompile = FALSE; + Gbl_DisassembleAll = TRUE; + break; + case 'c': break; @@ -547,7 +554,7 @@ AslDoOptions ( case 'e': - Gbl_ExternalFilename = AcpiGbl_Optarg; + AcpiDmAddToExternalFileList (AcpiGbl_Optarg); break; @@ -952,9 +959,12 @@ main ( char **argv) { ACPI_STATUS Status; - int Index; + int Index1; + int Index2; + AcpiGbl_ExternalFileList = NULL; + #ifdef _DEBUG _CrtSetDbgFlag (_CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_LEAK_CHECK_DF | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)); @@ -963,7 +973,7 @@ main ( /* Init and command line */ AslInitialize (); - Index = AslCommandLine (argc, argv); + Index1 = Index2 = AslCommandLine (argc, argv); /* Options that have no additional parameters or pathnames */ @@ -977,17 +987,36 @@ main ( return (0); } + if (Gbl_DisassembleAll) + { + while (argv[Index1]) + { + Status = AslDoOnePathname (argv[Index1], AcpiDmAddToExternalFileList); + if (ACPI_FAILURE (Status)) + { + return (-1); + } + + Index1++; + } + } + /* Process each pathname/filename in the list, with possible wildcards */ - while (argv[Index]) + while (argv[Index2]) { - Status = AslDoOnePathname (argv[Index]); + Status = AslDoOnePathname (argv[Index2], AslDoOneFile); if (ACPI_FAILURE (Status)) { return (-1); } - Index++; + Index2++; + } + + if (AcpiGbl_ExternalFileList) + { + AcpiDmClearExternalFileList(); } return (0); Modified: head/sys/contrib/dev/acpica/compiler/aslstartup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslstartup.c Fri Aug 6 22:06:12 2010 (r210975) +++ head/sys/contrib/dev/acpica/compiler/aslstartup.c Fri Aug 6 23:11:19 2010 (r210976) @@ -529,7 +529,8 @@ AslDoOneFile ( ACPI_STATUS AslDoOnePathname ( - char *Pathname) + char *Pathname, + ASL_PATHNAME_CALLBACK PathCallback) { ACPI_STATUS Status = AE_OK; char **FileList; @@ -569,7 +570,7 @@ AslDoOnePathname ( /* Save status from all compiles */ - Status |= AslDoOneFile (FullPathname); + Status |= (*PathCallback) (FullPathname); ACPI_FREE (FullPathname); ACPI_FREE (*FileList); Modified: head/sys/contrib/dev/acpica/debugger/dbcmds.c ============================================================================== --- head/sys/contrib/dev/acpica/debugger/dbcmds.c Fri Aug 6 22:06:12 2010 (r210975) +++ head/sys/contrib/dev/acpica/debugger/dbcmds.c Fri Aug 6 23:11:19 2010 (r210976) @@ -1336,6 +1336,98 @@ AcpiDbDisplayObjects ( /******************************************************************************* * + * FUNCTION: AcpiDbDisplayInterfaces + * + * PARAMETERS: ActionArg - Null, "install", or "remove" + * InterfaceNameArg - Name for install/remove options + * + * RETURN: None + * + * DESCRIPTION: Display or modify the global _OSI interface list + * + ******************************************************************************/ + +void +AcpiDbDisplayInterfaces ( + char *ActionArg, + char *InterfaceNameArg) +{ + ACPI_INTERFACE_INFO *NextInterface; + char *SubString; + ACPI_STATUS Status; + + + /* If no arguments, just display current interface list */ + + if (!ActionArg) + { + (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, + ACPI_WAIT_FOREVER); + + NextInterface = AcpiGbl_SupportedInterfaces; + + while (NextInterface) + { + if (!(NextInterface->Flags & ACPI_OSI_INVALID)) + { + AcpiOsPrintf ("%s\n", NextInterface->Name); + } + NextInterface = NextInterface->Next; + } + + AcpiOsReleaseMutex (AcpiGbl_OsiMutex); + return; + } + + /* If ActionArg exists, so must InterfaceNameArg */ + + if (!InterfaceNameArg) + { + AcpiOsPrintf ("Missing Interface Name argument\n"); + return; + } + + /* Uppercase the action for match below */ + + AcpiUtStrupr (ActionArg); + + /* Install - install an interface */ + + SubString = ACPI_STRSTR ("INSTALL", ActionArg); + if (SubString) + { + Status = AcpiInstallInterface (InterfaceNameArg); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("%s, while installing \"%s\"\n", + AcpiFormatException (Status), InterfaceNameArg); + } + return; + } + + /* Remove - remove an interface */ + + SubString = ACPI_STRSTR ("REMOVE", ActionArg); + if (SubString) + { + Status = AcpiRemoveInterface (InterfaceNameArg); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("%s, while removing \"%s\"\n", + AcpiFormatException (Status), InterfaceNameArg); + } + return; + } + + /* Invalid ActionArg */ + + AcpiOsPrintf ("Invalid action argument: %s\n", ActionArg); + return; +} + + +/******************************************************************************* + * * FUNCTION: AcpiDbWalkAndMatchName * * PARAMETERS: Callback from WalkNamespace Modified: head/sys/contrib/dev/acpica/debugger/dbinput.c ============================================================================== --- head/sys/contrib/dev/acpica/debugger/dbinput.c Fri Aug 6 22:06:12 2010 (r210975) +++ head/sys/contrib/dev/acpica/debugger/dbinput.c Fri Aug 6 23:11:19 2010 (r210976) @@ -194,6 +194,7 @@ enum AcpiExDebuggerCommands CMD_NOTIFY, CMD_OBJECT, CMD_OPEN, + CMD_OSI, CMD_OWNER, CMD_PREDEFINED, CMD_PREFIX, @@ -260,6 +261,7 @@ static const COMMAND_INFO AcpiGbl_ {"NOTIFY", 2}, {"OBJECT", 1}, {"OPEN", 1}, + {"OSI", 0}, {"OWNER", 1}, {"PREDEFINED", 0}, {"PREFIX", 0}, @@ -333,6 +335,7 @@ AcpiDbDisplayHelp ( AcpiOsPrintf ("History Display command history buffer\n"); AcpiOsPrintf ("Level [] [console] Get/Set debug level for file or console\n"); AcpiOsPrintf ("Locks Current status of internal mutexes\n"); + AcpiOsPrintf ("Osi [Install|Remove ] Display or modify global _OSI list\n"); AcpiOsPrintf ("Quit or Exit Exit this command\n"); AcpiOsPrintf ("Stats [Allocations|Memory|Misc\n"); AcpiOsPrintf (" |Objects|Sizes|Stack|Tables] Display namespace and memory statistics\n"); @@ -455,13 +458,30 @@ AcpiDbGetNextToken ( } } - Start = String; + if (*String == '"') + { + /* This is a quoted string, scan until closing quote */ + + String++; + Start = String; - /* Find end of token */ + /* Find end of token */ - while (*String && (*String != ' ')) + while (*String && (*String != '"')) + { + String++; + } + } + else { - String++; + Start = String; + + /* Find end of token */ + + while (*String && (*String != ' ')) + { + String++; + } } if (!(*String)) @@ -820,6 +840,10 @@ AcpiDbCommandDispatch ( AcpiDbOpenDebugFile (AcpiGbl_DbArgs[1]); break; + case CMD_OSI: + AcpiDbDisplayInterfaces (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); + break; + case CMD_OWNER: AcpiDbDumpNamespaceByOwner (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); break; Modified: head/sys/contrib/dev/acpica/events/evxfevnt.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evxfevnt.c Fri Aug 6 22:06:12 2010 (r210975) +++ head/sys/contrib/dev/acpica/events/evxfevnt.c Fri Aug 6 23:11:19 2010 (r210976) @@ -305,7 +305,6 @@ AcpiEnableEvent ( ACPI_EXPORT_SYMBOL (AcpiEnableEvent) - /******************************************************************************* * * FUNCTION: AcpiGpeWakeup Modified: head/sys/contrib/dev/acpica/executer/exfldio.c ============================================================================== --- head/sys/contrib/dev/acpica/executer/exfldio.c Fri Aug 6 22:06:12 2010 (r210975) +++ head/sys/contrib/dev/acpica/executer/exfldio.c Fri Aug 6 23:11:19 2010 (r210976) @@ -202,8 +202,8 @@ AcpiExSetupRegion ( } /* - * Exit now for SMBus or IPMI address space, it has a non-linear address space - * and the request cannot be directly validated + * Exit now for SMBus or IPMI address space, it has a non-linear + * address space and the request cannot be directly validated */ if (RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_IPMI) @@ -233,8 +233,7 @@ AcpiExSetupRegion ( * (Region length is specified in bytes) */ if (RgnDesc->Region.Length < - (ObjDesc->CommonField.BaseByteOffset + - FieldDatumByteOffset + + (ObjDesc->CommonField.BaseByteOffset + FieldDatumByteOffset + ObjDesc->CommonField.AccessByteWidth)) { if (AcpiGbl_EnableInterpreterSlack) @@ -794,6 +793,7 @@ AcpiExExtractFromField ( UINT32 BufferTailBits; UINT32 DatumCount; UINT32 FieldDatumCount; + UINT32 AccessBitWidth; UINT32 i; @@ -803,7 +803,7 @@ AcpiExExtractFromField ( /* Validate target buffer and clear it */ if (BufferLength < - ACPI_ROUND_BITS_UP_TO_BYTES (ObjDesc->CommonField.BitLength)) + ACPI_ROUND_BITS_UP_TO_BYTES (ObjDesc->CommonField.BitLength)) { ACPI_ERROR ((AE_INFO, "Field size %u (bits) is too large for buffer (%u)", @@ -811,17 +811,37 @@ AcpiExExtractFromField ( return_ACPI_STATUS (AE_BUFFER_OVERFLOW); } + ACPI_MEMSET (Buffer, 0, BufferLength); + AccessBitWidth = ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth); + + /* Handle the simple case here */ + + if ((ObjDesc->CommonField.StartFieldBitOffset == 0) && + (ObjDesc->CommonField.BitLength == AccessBitWidth)) + { + Status = AcpiExFieldDatumIo (ObjDesc, 0, Buffer, ACPI_READ); + return_ACPI_STATUS (Status); + } + +/* TBD: Move to common setup code */ + + /* Field algorithm is limited to sizeof(UINT64), truncate if needed */ + + if (ObjDesc->CommonField.AccessByteWidth > sizeof (UINT64)) + { + ObjDesc->CommonField.AccessByteWidth = sizeof (UINT64); + AccessBitWidth = sizeof (UINT64) * 8; + } /* Compute the number of datums (access width data items) */ DatumCount = ACPI_ROUND_UP_TO ( - ObjDesc->CommonField.BitLength, - ObjDesc->CommonField.AccessBitWidth); + ObjDesc->CommonField.BitLength, AccessBitWidth); + FieldDatumCount = ACPI_ROUND_UP_TO ( - ObjDesc->CommonField.BitLength + - ObjDesc->CommonField.StartFieldBitOffset, - ObjDesc->CommonField.AccessBitWidth); + ObjDesc->CommonField.BitLength + + ObjDesc->CommonField.StartFieldBitOffset, AccessBitWidth); /* Priming read from the field */ @@ -854,12 +874,11 @@ AcpiExExtractFromField ( * This avoids the differences in behavior between different compilers * concerning shift values larger than the target data width. */ - if ((ObjDesc->CommonField.AccessBitWidth - - ObjDesc->CommonField.StartFieldBitOffset) < ACPI_INTEGER_BIT_SIZE) + if (AccessBitWidth - ObjDesc->CommonField.StartFieldBitOffset < + ACPI_INTEGER_BIT_SIZE) { MergedDatum |= RawDatum << - (ObjDesc->CommonField.AccessBitWidth - - ObjDesc->CommonField.StartFieldBitOffset); + (AccessBitWidth - ObjDesc->CommonField.StartFieldBitOffset); } if (i == DatumCount) @@ -879,8 +898,7 @@ AcpiExExtractFromField ( /* Mask off any extra bits in the last datum */ - BufferTailBits = ObjDesc->CommonField.BitLength % - ObjDesc->CommonField.AccessBitWidth; + BufferTailBits = ObjDesc->CommonField.BitLength % AccessBitWidth; if (BufferTailBits) { MergedDatum &= ACPI_MASK_BITS_ABOVE (BufferTailBits); @@ -916,6 +934,7 @@ AcpiExInsertIntoField ( void *Buffer, UINT32 BufferLength) { + void *NewBuffer; ACPI_STATUS Status; UINT64 Mask; UINT64 WidthMask; @@ -926,9 +945,9 @@ AcpiExInsertIntoField ( UINT32 BufferTailBits; UINT32 DatumCount; UINT32 FieldDatumCount; - UINT32 i; + UINT32 AccessBitWidth; UINT32 RequiredLength; - void *NewBuffer; + UINT32 i; ACPI_FUNCTION_TRACE (ExInsertIntoField); @@ -965,31 +984,41 @@ AcpiExInsertIntoField ( BufferLength = RequiredLength; } +/* TBD: Move to common setup code */ + + /* Algo is limited to sizeof(UINT64), so cut the AccessByteWidth */ + if (ObjDesc->CommonField.AccessByteWidth > sizeof (UINT64)) + { + ObjDesc->CommonField.AccessByteWidth = sizeof (UINT64); + } + + AccessBitWidth = ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth); + /* * Create the bitmasks used for bit insertion. * Note: This if/else is used to bypass compiler differences with the * shift operator */ - if (ObjDesc->CommonField.AccessBitWidth == ACPI_INTEGER_BIT_SIZE) + if (AccessBitWidth == ACPI_INTEGER_BIT_SIZE) { WidthMask = ACPI_UINT64_MAX; } else { - WidthMask = ACPI_MASK_BITS_ABOVE (ObjDesc->CommonField.AccessBitWidth); + WidthMask = ACPI_MASK_BITS_ABOVE (AccessBitWidth); } Mask = WidthMask & - ACPI_MASK_BITS_BELOW (ObjDesc->CommonField.StartFieldBitOffset); + ACPI_MASK_BITS_BELOW (ObjDesc->CommonField.StartFieldBitOffset); /* Compute the number of datums (access width data items) */ DatumCount = ACPI_ROUND_UP_TO (ObjDesc->CommonField.BitLength, - ObjDesc->CommonField.AccessBitWidth); + AccessBitWidth); FieldDatumCount = ACPI_ROUND_UP_TO (ObjDesc->CommonField.BitLength + - ObjDesc->CommonField.StartFieldBitOffset, - ObjDesc->CommonField.AccessBitWidth); + ObjDesc->CommonField.StartFieldBitOffset, + AccessBitWidth); /* Get initial Datum from the input buffer */ @@ -1024,12 +1053,11 @@ AcpiExInsertIntoField ( * This avoids the differences in behavior between different compilers * concerning shift values larger than the target data width. */ - if ((ObjDesc->CommonField.AccessBitWidth - - ObjDesc->CommonField.StartFieldBitOffset) < ACPI_INTEGER_BIT_SIZE) + if ((AccessBitWidth - ObjDesc->CommonField.StartFieldBitOffset) < + ACPI_INTEGER_BIT_SIZE) { MergedDatum = RawDatum >> - (ObjDesc->CommonField.AccessBitWidth - - ObjDesc->CommonField.StartFieldBitOffset); + (AccessBitWidth - ObjDesc->CommonField.StartFieldBitOffset); } else { @@ -1048,15 +1076,15 @@ AcpiExInsertIntoField ( BufferOffset += ObjDesc->CommonField.AccessByteWidth; ACPI_MEMCPY (&RawDatum, ((char *) Buffer) + BufferOffset, ACPI_MIN(ObjDesc->CommonField.AccessByteWidth, - BufferLength - BufferOffset)); + BufferLength - BufferOffset)); + MergedDatum |= RawDatum << ObjDesc->CommonField.StartFieldBitOffset; } /* Mask off any extra bits in the last datum */ BufferTailBits = (ObjDesc->CommonField.BitLength + - ObjDesc->CommonField.StartFieldBitOffset) % - ObjDesc->CommonField.AccessBitWidth; + ObjDesc->CommonField.StartFieldBitOffset) % AccessBitWidth; if (BufferTailBits) { Mask &= ACPI_MASK_BITS_ABOVE (BufferTailBits); Modified: head/sys/contrib/dev/acpica/executer/exprep.c ============================================================================== --- head/sys/contrib/dev/acpica/executer/exprep.c Fri Aug 6 22:06:12 2010 (r210975) +++ head/sys/contrib/dev/acpica/executer/exprep.c Fri Aug 6 23:11:19 2010 (r210976) @@ -193,12 +193,12 @@ AcpiExGenerateAccess ( FieldByteLength = FieldByteEndOffset - FieldByteOffset; ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - "Bit length %u, Bit offset %u\n", - FieldBitLength, FieldBitOffset)); + "Bit length %u, Bit offset %u\n", + FieldBitLength, FieldBitOffset)); ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - "Byte Length %u, Byte Offset %u, End Offset %u\n", - FieldByteLength, FieldByteOffset, FieldByteEndOffset)); + "Byte Length %u, Byte Offset %u, End Offset %u\n", + FieldByteLength, FieldByteOffset, FieldByteEndOffset)); /* * Iterative search for the maximum access width that is both aligned @@ -228,11 +228,11 @@ AcpiExGenerateAccess ( Accesses = FieldEndOffset - FieldStartOffset; ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - "AccessWidth %u end is within region\n", AccessByteWidth)); + "AccessWidth %u end is within region\n", AccessByteWidth)); ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - "Field Start %u, Field End %u -- requires %u accesses\n", - FieldStartOffset, FieldEndOffset, Accesses)); + "Field Start %u, Field End %u -- requires %u accesses\n", + FieldStartOffset, FieldEndOffset, Accesses)); /* Single access is optimal */ @@ -261,7 +261,7 @@ AcpiExGenerateAccess ( if (AccessByteWidth == 1) { ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - "Field goes beyond end-of-region!\n")); + "Field goes beyond end-of-region!\n")); /* Field does not fit in the region at all */ @@ -273,8 +273,8 @@ AcpiExGenerateAccess ( * previous access */ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - "Backing off to previous optimal access width of %u\n", - MinimumAccessWidth)); + "Backing off to previous optimal access width of %u\n", + MinimumAccessWidth)); return_VALUE (MinimumAccessWidth); } } @@ -284,7 +284,7 @@ AcpiExGenerateAccess ( * just use max access width */ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - "Cannot access field in one operation, using width 8\n")); + "Cannot access field in one operation, using width 8\n")); return_VALUE (8); } #endif /* ACPI_UNDER_DEVELOPMENT */ @@ -444,18 +444,16 @@ AcpiExPrepCommonFieldObject ( * the same (equivalent) as the ByteAlignment. */ AccessBitWidth = AcpiExDecodeFieldAccess (ObjDesc, FieldFlags, - &ByteAlignment); + &ByteAlignment); if (!AccessBitWidth) { return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } - /* Setup width (access granularity) fields */ + /* Setup width (access granularity) fields (values are: 1, 2, 4, 8) */ ObjDesc->CommonField.AccessByteWidth = (UINT8) - ACPI_DIV_8 (AccessBitWidth); /* 1, 2, 4, 8 */ - - ObjDesc->CommonField.AccessBitWidth = (UINT8) AccessBitWidth; + ACPI_DIV_8 (AccessBitWidth); /* * BaseByteOffset is the address of the start of the field within the @@ -468,9 +466,9 @@ AcpiExPrepCommonFieldObject ( * region or buffer. */ NearestByteAddress = - ACPI_ROUND_BITS_DOWN_TO_BYTES (FieldBitPosition); + ACPI_ROUND_BITS_DOWN_TO_BYTES (FieldBitPosition); ObjDesc->CommonField.BaseByteOffset = (UINT32) - ACPI_ROUND_DOWN (NearestByteAddress, ByteAlignment); + ACPI_ROUND_DOWN (NearestByteAddress, ByteAlignment); /* * StartFieldBitOffset is the offset of the first bit of the field within @@ -502,8 +500,9 @@ AcpiExPrepFieldValue ( { ACPI_OPERAND_OBJECT *ObjDesc; ACPI_OPERAND_OBJECT *SecondDesc = NULL; - UINT32 Type; ACPI_STATUS Status; + UINT32 AccessByteWidth; + UINT32 Type; ACPI_FUNCTION_TRACE (ExPrepFieldValue); @@ -522,8 +521,7 @@ AcpiExPrepFieldValue ( Type = AcpiNsGetType (Info->RegionNode); if (Type != ACPI_TYPE_REGION) { - ACPI_ERROR ((AE_INFO, - "Needed Region, found type 0x%X (%s)", + ACPI_ERROR ((AE_INFO, "Needed Region, found type 0x%X (%s)", Type, AcpiUtGetTypeName (Type))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); @@ -541,8 +539,9 @@ AcpiExPrepFieldValue ( /* Initialize areas of the object that are common to all fields */ ObjDesc->CommonField.Node = Info->FieldNode; - Status = AcpiExPrepCommonFieldObject (ObjDesc, Info->FieldFlags, - Info->Attribute, Info->FieldBitPosition, Info->FieldBitLength); + Status = AcpiExPrepCommonFieldObject (ObjDesc, + Info->FieldFlags, Info->Attribute, + Info->FieldBitPosition, Info->FieldBitLength); if (ACPI_FAILURE (Status)) { AcpiUtDeleteObjectDesc (ObjDesc); @@ -557,6 +556,22 @@ AcpiExPrepFieldValue ( ObjDesc->Field.RegionObj = AcpiNsGetAttachedObject (Info->RegionNode); + /* Allow full data read from EC address space */ + + if ((ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) && + (ObjDesc->CommonField.BitLength > 8)) + { + AccessByteWidth = ACPI_ROUND_BITS_UP_TO_BYTES ( + ObjDesc->CommonField.BitLength); + + /* Maximum byte width supported is 255 */ + + if (AccessByteWidth < 256) + { + ObjDesc->CommonField.AccessByteWidth = (UINT8) AccessByteWidth; + } + } + /* An additional reference for the container */ AcpiUtAddReference (ObjDesc->Field.RegionObj); @@ -570,11 +585,11 @@ AcpiExPrepFieldValue ( *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***