From 5eb20ec0efedaa5c449001fed0391ff67b8af8bb Mon Sep 17 00:00:00 2001 From: jkim Date: Mon, 14 Dec 2009 22:07:33 +0000 Subject: [PATCH 1/3] Import ACPICA 20091214. --- changes.txt | 67 +++++ compiler/aslcompile.c | 35 ++- debugger/dbutils.c | 4 + disassembler/dmwalk.c | 1 - dispatcher/dsmethod.c | 2 +- dispatcher/dswload.c | 67 +++-- events/evregion.c | 4 +- events/evrgnini.c | 14 + events/evxface.c | 4 +- events/evxfevnt.c | 4 +- events/evxfregn.c | 4 +- executer/exmutex.c | 18 +- include/acnamesp.h | 11 +- include/acobject.h | 7 +- include/acoutput.h | 8 +- include/acpixf.h | 2 +- namespace/nsaccess.c | 2 +- namespace/nsdump.c | 2 +- namespace/nseval.c | 20 ++ namespace/nsnames.c | 2 +- namespace/nspredef.c | 101 +++---- namespace/nsrepair.c | 536 +++++++++++++++++++++++++++++------- namespace/nsrepair2.c | 209 +++++++++++--- namespace/nsutils.c | 63 +---- namespace/nsxfeval.c | 10 +- namespace/nsxfname.c | 10 +- namespace/nsxfobj.c | 12 +- parser/psxface.c | 2 +- resources/rsxface.c | 2 +- tools/acpiexec/aecommon.h | 5 +- tools/acpiexec/aehandlers.c | 5 +- tools/acpiexec/aemain.c | 9 +- utilities/utcopy.c | 27 +- 33 files changed, 903 insertions(+), 366 deletions(-) diff --git a/changes.txt b/changes.txt index a615bdde09ac..d8127f24da8b 100644 --- a/changes.txt +++ b/changes.txt @@ -1,3 +1,70 @@ +---------------------------------------- +14 December 2009. Summary of changes for version 20091214: + +This release is available at www.acpica.org/downloads + +1) ACPI CA Core Subsystem: + +Enhanced automatic data type conversions for predefined name repairs. This +change expands the automatic repairs/conversions for predefined name return +values to make Integers, Strings, and Buffers fully interchangeable. Also, a +Buffer can be converted to a Package of Integers if necessary. The nsrepair.c +module was completely restructured. Lin Ming, Bob Moore. + +Implemented automatic removal of null package elements during predefined name +repairs. This change will automatically remove embedded and trailing NULL +package elements from returned package objects that are defined to contain a +variable number of sub-packages. The driver is then presented with a package +with no null elements to deal with. ACPICA BZ 819. + +Implemented a repair for the predefined _FDE and _GTM names. The expected +return value for both names is a Buffer of 5 DWORDs. This repair fixes two +possible problems (both seen in the field), where a package of integers is +returned, or a buffer of BYTEs is returned. With assistance from Jung-uk Kim. + +Implemented additional module-level code support. This change will properly +execute module-level code that is not at the root of the namespace (under a +Device object, etc.). Now executes the code within the current scope instead +of the root. ACPICA BZ 762. Lin Ming. + +Fixed possible mutex acquisition errors when running _REG methods. Fixes a +problem where mutex errors can occur when running a _REG method that is in +the same scope as a method-defined operation region or an operation region +under a module-level IF block. This type of code is rare, so the problem has +not been seen before. ACPICA BZ 826. Lin Ming, Bob Moore. + +Fixed a possible memory leak during module-level code execution. An object +could be leaked for each block of executed module-level code if the +interpreter slack mode is enabled This change deletes any implicitly returned +object from the module-level code block. Lin Ming. + +Removed messages for successful predefined repair(s). The repair mechanism +was considered too wordy. Now, messages are only unconditionally emitted if +the return object cannot be repaired. Existing messages for successful +repairs were converted to ACPI_DEBUG_PRINT messages for now. ACPICA BZ 827. + +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: 86.6K Code, 18.2K Data, 104.8K Total + Debug Version: 162.7K Code, 50.8K Data, 213.5K Total + Current Release: + Non-Debug Version: 87.0K Code, 18.0K Data, 105.0K Total + Debug Version: 163.4K Code, 50.8K Data, 214.2K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a regression introduced in 20091112 where intermediate .SRC files +were no longer automatically removed at the termination of the compile. + +acpiexec: Implemented the -f option to specify default region fill value. +This option specifies the value used to initialize buffers that simulate +operation regions. Default value is zero. Useful for debugging problems that +depend on a specific initial value for a region or field. + ---------------------------------------- 12 November 2009. Summary of changes for version 20091112: diff --git a/compiler/aslcompile.c b/compiler/aslcompile.c index d9836ca908e4..bdff08c8965d 100644 --- a/compiler/aslcompile.c +++ b/compiler/aslcompile.c @@ -895,20 +895,6 @@ CmCleanupAndExit ( 10) / Gbl_NsLookupCount); } - /* - * TBD: SourceOutput should be .TMP, then rename if we want to keep it? - */ - if (!Gbl_SourceOutputFlag) - { - remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); - } - - /* Delete AML file if there are errors */ - - if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors)) - { - remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename); - } if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { @@ -923,6 +909,27 @@ CmCleanupAndExit ( { FlCloseFile (i); } + + /* Delete AML file if there are errors */ + + if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors)) + { + remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename); + } + + /* + * Delete intermediate ("combined") source file (if -ls flag not set) + * + * TBD: SourceOutput should be .TMP, then rename if we want to keep it? + */ + if (!Gbl_SourceOutputFlag) + { + if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename)) + { + printf ("Could not remove SRC file, %s\n", + Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); + } + } } diff --git a/debugger/dbutils.c b/debugger/dbutils.c index b49726369b8b..15799eb7b4c9 100644 --- a/debugger/dbutils.c +++ b/debugger/dbutils.c @@ -275,6 +275,10 @@ AcpiDbDumpExternalObject ( AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length); if (ObjDesc->Buffer.Length) { + if (ObjDesc->Buffer.Length > 16) + { + AcpiOsPrintf ("\n"); + } AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT); } diff --git a/disassembler/dmwalk.c b/disassembler/dmwalk.c index ddc0e35cd620..85477fede960 100644 --- a/disassembler/dmwalk.c +++ b/disassembler/dmwalk.c @@ -160,7 +160,6 @@ AcpiDmBlockType ( ACPI_PARSE_OBJECT *Op); - /******************************************************************************* * * FUNCTION: AcpiDmDisassemble diff --git a/dispatcher/dsmethod.c b/dispatcher/dsmethod.c index 1766fc353d4c..48172e962e29 100644 --- a/dispatcher/dsmethod.c +++ b/dispatcher/dsmethod.c @@ -519,7 +519,7 @@ AcpiDsCallControlMethod ( if (ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY) { - Status = ObjDesc->Method.Implementation (NextWalkState); + Status = ObjDesc->Method.Extra.Implementation (NextWalkState); if (Status == AE_OK) { Status = AE_CTRL_TERMINATE; diff --git a/dispatcher/dswload.c b/dispatcher/dswload.c index bb92847e788f..48c4ae6f163a 100644 --- a/dispatcher/dswload.c +++ b/dispatcher/dswload.c @@ -296,18 +296,19 @@ AcpiDsLoad1BeginOp ( case ACPI_TYPE_BUFFER: /* - * These types we will allow, but we will change the type. This - * enables some existing code of the form: + * These types we will allow, but we will change the type. + * This enables some existing code of the form: * * Name (DEB, 0) * Scope (DEB) { ... } * - * Note: silently change the type here. On the second pass, we will report - * a warning + * Note: silently change the type here. On the second pass, + * we will report a warning */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n", - Path, AcpiUtGetTypeName (Node->Type))); + "Type override - [%4.4s] had invalid type (%s) " + "for Scope operator, changed to type ANY\n", + AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type))); Node->Type = ACPI_TYPE_ANY; WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; @@ -318,8 +319,9 @@ AcpiDsLoad1BeginOp ( /* All other types are an error */ ACPI_ERROR ((AE_INFO, - "Invalid type (%s) for target of Scope operator [%4.4s] (Cannot override)", - AcpiUtGetTypeName (Node->Type), Path)); + "Invalid type (%s) for target of " + "Scope operator [%4.4s] (Cannot override)", + AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -794,15 +796,16 @@ AcpiDsLoad2BeginOp ( case ACPI_TYPE_BUFFER: /* - * These types we will allow, but we will change the type. This - * enables some existing code of the form: + * These types we will allow, but we will change the type. + * This enables some existing code of the form: * * Name (DEB, 0) * Scope (DEB) { ... } */ ACPI_WARNING ((AE_INFO, - "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)", - BufferPtr, AcpiUtGetTypeName (Node->Type))); + "Type override - [%4.4s] had invalid type (%s) " + "for Scope operator, changed to type ANY\n", + AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type))); Node->Type = ACPI_TYPE_ANY; WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; @@ -813,8 +816,9 @@ AcpiDsLoad2BeginOp ( /* All other types are an error */ ACPI_ERROR ((AE_INFO, - "Invalid type (%s) for target of Scope operator [%4.4s]", - AcpiUtGetTypeName (Node->Type), BufferPtr)); + "Invalid type (%s) for target of " + "Scope operator [%4.4s] (Cannot override)", + AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node))); return (AE_AML_OPERAND_TYPE); } @@ -1154,33 +1158,40 @@ AcpiDsLoad2EndOp ( } /* - * If we are executing a method, initialize the region + * The OpRegion is not fully parsed at this time. The only valid + * argument is the SpaceId. (We must save the address of the + * AML of the address and length operands) + * + * If we have a valid region, initialize it. The namespace is + * unlocked at this point. + * + * Need to unlock interpreter if it is locked (if we are running + * a control method), in order to allow _REG methods to be run + * during AcpiEvInitializeRegion. */ if (WalkState->MethodNode) { + /* + * Executing a method: initialize the region and unlock + * the interpreter + */ Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length, RegionSpace, WalkState); if (ACPI_FAILURE (Status)) { return (Status); } + + AcpiExExitInterpreter (); } - /* - * The OpRegion is not fully parsed at this time. Only valid - * argument is the SpaceId. (We must save the address of the - * AML of the address and length operands) - */ - - /* - * If we have a valid region, initialize it - * Namespace is NOT locked at this point. - * - * TBD: need to unlock interpreter if it is locked, in order - * to allow _REG methods to be run. - */ Status = AcpiEvInitializeRegion (AcpiNsGetAttachedObject (Node), FALSE); + if (WalkState->MethodNode) + { + AcpiExEnterInterpreter (); + } + if (ACPI_FAILURE (Status)) { /* diff --git a/events/evregion.c b/events/evregion.c index 50edaa49a399..2bdfb872fe0b 100644 --- a/events/evregion.c +++ b/events/evregion.c @@ -845,7 +845,7 @@ AcpiEvInstallHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { return (AE_BAD_PARAMETER); @@ -1243,7 +1243,7 @@ AcpiEvRegRun ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { return (AE_BAD_PARAMETER); diff --git a/events/evrgnini.c b/events/evrgnini.c index 9c45ee84f028..67f6cddf66d8 100644 --- a/events/evrgnini.c +++ b/events/evrgnini.c @@ -716,6 +716,20 @@ AcpiEvInitializeRegion ( HandlerObj = ObjDesc->ThermalZone.Handler; break; + case ACPI_TYPE_METHOD: + /* + * If we are executing module level code, the original + * Node's object was replaced by this Method object and we + * saved the handler in the method object. + * + * See AcpiNsExecModuleCode + */ + if (ObjDesc->Method.Flags & AOPOBJ_MODULE_LEVEL) + { + HandlerObj = ObjDesc->Method.Extra.Handler; + } + break; + default: /* Ignore other objects */ break; diff --git a/events/evxface.c b/events/evxface.c index f816abad3a51..6eb5a14af068 100644 --- a/events/evxface.c +++ b/events/evxface.c @@ -368,7 +368,7 @@ AcpiInstallNotifyHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; @@ -555,7 +555,7 @@ AcpiRemoveNotifyHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; diff --git a/events/evxfevnt.c b/events/evxfevnt.c index bc24f18c51e2..27066a399468 100644 --- a/events/evxfevnt.c +++ b/events/evxfevnt.c @@ -805,7 +805,7 @@ AcpiInstallGpeBlock ( return (Status); } - Node = AcpiNsMapHandleToNode (GpeDevice); + Node = AcpiNsValidateHandle (GpeDevice); if (!Node) { Status = AE_BAD_PARAMETER; @@ -905,7 +905,7 @@ AcpiRemoveGpeBlock ( return (Status); } - Node = AcpiNsMapHandleToNode (GpeDevice); + Node = AcpiNsValidateHandle (GpeDevice); if (!Node) { Status = AE_BAD_PARAMETER; diff --git a/events/evxfregn.c b/events/evxfregn.c index d4f499130a4c..3b60589b71a4 100644 --- a/events/evxfregn.c +++ b/events/evxfregn.c @@ -171,7 +171,7 @@ AcpiInstallAddressSpaceHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; @@ -244,7 +244,7 @@ AcpiRemoveAddressSpaceHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node || ((Node->Type != ACPI_TYPE_DEVICE) && (Node->Type != ACPI_TYPE_PROCESSOR) && diff --git a/executer/exmutex.c b/executer/exmutex.c index db5ab9e77a33..8b1bebf1e917 100644 --- a/executer/exmutex.c +++ b/executer/exmutex.c @@ -490,6 +490,15 @@ AcpiExReleaseMutex ( return_ACPI_STATUS (AE_AML_MUTEX_NOT_ACQUIRED); } + /* Must have a valid thread ID */ + + if (!WalkState->Thread) + { + ACPI_ERROR ((AE_INFO, "Cannot release Mutex [%4.4s], null thread info", + AcpiUtGetNodeName (ObjDesc->Mutex.Node))); + return_ACPI_STATUS (AE_AML_INTERNAL); + } + /* * The Mutex is owned, but this thread must be the owner. * Special case for Global Lock, any thread can release @@ -505,15 +514,6 @@ AcpiExReleaseMutex ( return_ACPI_STATUS (AE_AML_NOT_OWNER); } - /* Must have a valid thread ID */ - - if (!WalkState->Thread) - { - ACPI_ERROR ((AE_INFO, "Cannot release Mutex [%4.4s], null thread info", - AcpiUtGetNodeName (ObjDesc->Mutex.Node))); - return_ACPI_STATUS (AE_AML_INTERNAL); - } - /* * The sync level of the mutex must be equal to the current sync level. In * other words, the current level means that at least one mutex at that diff --git a/include/acnamesp.h b/include/acnamesp.h index 5ea23da0d28b..65798662d596 100644 --- a/include/acnamesp.h +++ b/include/acnamesp.h @@ -456,6 +456,11 @@ AcpiNsComplexRepairs ( ACPI_STATUS ValidateStatus, ACPI_OPERAND_OBJECT **ReturnObjectPtr); +void +AcpiNsRemoveNullElements ( + ACPI_PREDEFINED_DATA *Data, + UINT8 PackageType, + ACPI_OPERAND_OBJECT *ObjDesc); /* * nssearch - Namespace searching and entry @@ -542,13 +547,9 @@ AcpiNsExternalizeName ( char **ConvertedName); ACPI_NAMESPACE_NODE * -AcpiNsMapHandleToNode ( +AcpiNsValidateHandle ( ACPI_HANDLE Handle); -ACPI_HANDLE -AcpiNsConvertEntryToHandle( - ACPI_NAMESPACE_NODE *Node); - void AcpiNsTerminate ( void); diff --git a/include/acobject.h b/include/acobject.h index 5a33fdcf7b97..76f623c83db8 100644 --- a/include/acobject.h +++ b/include/acobject.h @@ -288,7 +288,12 @@ typedef struct acpi_object_method UINT8 SyncLevel; union acpi_operand_object *Mutex; UINT8 *AmlStart; - ACPI_INTERNAL_METHOD Implementation; + union + { + ACPI_INTERNAL_METHOD Implementation; + union acpi_operand_object *Handler; + } Extra; + UINT32 AmlLength; UINT8 ThreadCount; ACPI_OWNER_ID OwnerId; diff --git a/include/acoutput.h b/include/acoutput.h index 2b796b541a61..4f4b1d9c69dd 100644 --- a/include/acoutput.h +++ b/include/acoutput.h @@ -158,7 +158,8 @@ #define ACPI_LV_INIT 0x00000001 #define ACPI_LV_DEBUG_OBJECT 0x00000002 #define ACPI_LV_INFO 0x00000004 -#define ACPI_LV_ALL_EXCEPTIONS 0x00000007 +#define ACPI_LV_REPAIR 0x00000008 +#define ACPI_LV_ALL_EXCEPTIONS 0x0000000F /* Trace verbosity level 1 [Standard Trace Level] */ @@ -217,6 +218,7 @@ #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) +#define ACPI_DB_REPAIR ACPI_DEBUG_LEVEL (ACPI_LV_REPAIR) #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) /* Trace level -- also used in the global "DebugLevel" */ @@ -248,8 +250,8 @@ /* Defaults for DebugLevel, debug and normal */ -#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT) -#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT) +#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) +#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) diff --git a/include/acpixf.h b/include/acpixf.h index 17c5bd3d061b..a961009465a2 100644 --- a/include/acpixf.h +++ b/include/acpixf.h @@ -120,7 +120,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20091112 +#define ACPI_CA_VERSION 0x20091214 #include "actypes.h" #include "actbl.h" diff --git a/namespace/nsaccess.c b/namespace/nsaccess.c index 172b26d3abcd..2bc7d8d71182 100644 --- a/namespace/nsaccess.c +++ b/namespace/nsaccess.c @@ -251,7 +251,7 @@ AcpiNsRootInitialize ( /* Mark this as a very SPECIAL method */ ObjDesc->Method.MethodFlags = AML_METHOD_INTERNAL_ONLY; - ObjDesc->Method.Implementation = AcpiUtOsiImplementation; + ObjDesc->Method.Extra.Implementation = AcpiUtOsiImplementation; #endif break; diff --git a/namespace/nsdump.c b/namespace/nsdump.c index 96510564ee4a..d799f7c64ce9 100644 --- a/namespace/nsdump.c +++ b/namespace/nsdump.c @@ -286,7 +286,7 @@ AcpiNsDumpOneObject ( return (AE_OK); } - ThisNode = AcpiNsMapHandleToNode (ObjHandle); + ThisNode = AcpiNsValidateHandle (ObjHandle); if (!ThisNode) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n", diff --git a/namespace/nseval.c b/namespace/nseval.c index e5d4cf327e53..07af96ed93dc 100644 --- a/namespace/nseval.c +++ b/namespace/nseval.c @@ -477,6 +477,19 @@ AcpiNsExecModuleCode ( MethodObj->Method.NextObject); Type = AcpiNsGetType (ParentNode); + /* + * Get the region handler and save it in the method object. We may need + * this if an operation region declaration causes a _REG method to be run. + * + * We can't do this in AcpiPsLinkModuleCode because + * AcpiGbl_RootNode->Object is NULL at PASS1. + */ + if ((Type == ACPI_TYPE_DEVICE) && ParentNode->Object) + { + MethodObj->Method.Extra.Handler = + ParentNode->Object->Device.Handler; + } + /* Must clear NextObject (AcpiNsAttachObject needs the field) */ MethodObj->Method.NextObject = NULL; @@ -513,6 +526,13 @@ AcpiNsExecModuleCode ( ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "Executed module-level code at %p\n", MethodObj->Method.AmlStart)); + /* Delete a possible implicit return value (in slack mode) */ + + if (Info->ReturnObject) + { + AcpiUtRemoveReference (Info->ReturnObject); + } + /* Detach the temporary method object */ AcpiNsDetachObject (ParentNode); diff --git a/namespace/nsnames.c b/namespace/nsnames.c index 0dd148fa7ca1..c00a4457b2a8 100644 --- a/namespace/nsnames.c +++ b/namespace/nsnames.c @@ -337,7 +337,7 @@ AcpiNsHandleToPathname ( ACPI_FUNCTION_TRACE_PTR (NsHandleToPathname, TargetHandle); - Node = AcpiNsMapHandleToNode (TargetHandle); + Node = AcpiNsValidateHandle (TargetHandle); if (!Node) { return_ACPI_STATUS (AE_BAD_PARAMETER); diff --git a/namespace/nspredef.c b/namespace/nspredef.c index ae4e17d43826..d979c43e93f9 100644 --- a/namespace/nspredef.c +++ b/namespace/nspredef.c @@ -313,31 +313,40 @@ AcpiNsCheckPredefinedNames ( Data->Pathname = Pathname; /* - * Check that the type of the return object is what is expected for - * this predefined name + * Check that the type of the main return object is what is expected + * for this predefined name */ Status = AcpiNsCheckObjectType (Data, ReturnObjectPtr, Predefined->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT); if (ACPI_FAILURE (Status)) { - goto CheckValidationStatus; - } - - /* For returned Package objects, check the type of all sub-objects */ - - if (ReturnObject->Common.Type == ACPI_TYPE_PACKAGE) - { - Status = AcpiNsCheckPackage (Data, ReturnObjectPtr); + goto Exit; } /* - * Perform additional, more complicated repairs on a per-name - * basis. + * For returned Package objects, check the type of all sub-objects. + * Note: Package may have been newly created by call above. + */ + if ((*ReturnObjectPtr)->Common.Type == ACPI_TYPE_PACKAGE) + { + Status = AcpiNsCheckPackage (Data, ReturnObjectPtr); + if (ACPI_FAILURE (Status)) + { + goto Exit; + } + } + + /* + * The return object was OK, or it was successfully repaired above. + * Now make some additional checks such as verifying that package + * objects are sorted correctly (if required) or buffer objects have + * the correct data width (bytes vs. dwords). These repairs are + * performed on a per-name basis, i.e., the code is specific to + * particular predefined names. */ Status = AcpiNsComplexRepairs (Data, Node, Status, ReturnObjectPtr); - -CheckValidationStatus: +Exit: /* * If the object validation failed or if we successfully repaired one * or more objects, mark the parent node to suppress further warning @@ -349,7 +358,6 @@ AcpiNsCheckPredefinedNames ( } ACPI_FREE (Data); - Cleanup: ACPI_FREE (Pathname); return (Status); @@ -544,6 +552,12 @@ AcpiNsCheckPackage ( "%s Validating return Package of Type %X, Count %X\n", Data->Pathname, Package->RetInfo.Type, ReturnObject->Package.Count)); + /* + * For variable-length Packages, we can safely remove all embedded + * and trailing NULL package elements + */ + AcpiNsRemoveNullElements (Data, Package->RetInfo.Type, ReturnObject); + /* Extract package count and elements array */ Elements = ReturnObject->Package.Elements; @@ -582,9 +596,10 @@ AcpiNsCheckPackage ( } else if (Count > ExpectedCount) { - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Return Package is larger than needed - " - "found %u, expected %u", Count, ExpectedCount)); + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Return Package is larger than needed - " + "found %u, expected %u\n", + Data->Pathname, Count, ExpectedCount)); } /* Validate all elements of the returned package */ @@ -800,56 +815,20 @@ AcpiNsCheckPackageList ( ACPI_OPERAND_OBJECT *SubPackage; ACPI_OPERAND_OBJECT **SubElements; ACPI_STATUS Status; - BOOLEAN NonTrailingNull = FALSE; UINT32 ExpectedCount; UINT32 i; UINT32 j; - /* Validate each sub-Package in the parent Package */ - + /* + * Validate each sub-Package in the parent Package + * + * NOTE: assumes list of sub-packages contains no NULL elements. + * Any NULL elements should have been removed by earlier call + * to AcpiNsRemoveNullElements. + */ for (i = 0; i < Count; i++) { - /* - * Handling for NULL package elements. For now, we will simply allow - * a parent package with trailing NULL elements. This can happen if - * the package was defined to be longer than the initializer list. - * This is legal as per the ACPI specification. It is often used - * to allow for dynamic initialization of a Package. - * - * A future enhancement may be to simply truncate the package to - * remove the trailing NULL elements. - */ - if (!(*Elements)) - { - if (!NonTrailingNull) - { - /* Ensure the remaining elements are all NULL */ - - for (j = 1; j < (Count - i + 1); j++) - { - if (Elements[j]) - { - NonTrailingNull = TRUE; - } - } - - if (!NonTrailingNull) - { - /* Ignore the trailing NULL elements */ - - return (AE_OK); - } - } - - /* There are trailing non-null elements, issue warning */ - - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Found NULL element at package index %u", i)); - Elements++; - continue; - } - SubPackage = *Elements; SubElements = SubPackage->Package.Elements; diff --git a/namespace/nsrepair.c b/namespace/nsrepair.c index 3e3a23125d91..5c402df36b56 100644 --- a/namespace/nsrepair.c +++ b/namespace/nsrepair.c @@ -119,12 +119,59 @@ #include "accommon.h" #include "acnamesp.h" #include "acinterp.h" -#include "acpredef.h" #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsrepair") +/******************************************************************************* + * + * This module attempts to repair or convert objects returned by the + * predefined methods to an object type that is expected, as per the ACPI + * specification. The need for this code is dictated by the many machines that + * return incorrect types for the standard predefined methods. Performing these + * conversions here, in one place, eliminates the need for individual ACPI + * device drivers to do the same. Note: Most of these conversions are different + * than the internal object conversion routines used for implicit object + * conversion. + * + * The following conversions can be performed as necessary: + * + * Integer -> String + * Integer -> Buffer + * String -> Integer + * String -> Buffer + * Buffer -> Integer + * Buffer -> String + * Buffer -> Package of Integers + * Package -> Package of one Package + * + ******************************************************************************/ + + +/* Local prototypes */ + +static ACPI_STATUS +AcpiNsConvertToInteger ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +static ACPI_STATUS +AcpiNsConvertToString ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +static ACPI_STATUS +AcpiNsConvertToBuffer ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +static ACPI_STATUS +AcpiNsConvertToPackage ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + + /******************************************************************************* * * FUNCTION: AcpiNsRepairObject @@ -153,110 +200,57 @@ AcpiNsRepairObject ( { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; ACPI_OPERAND_OBJECT *NewObject; - ACPI_SIZE Length; ACPI_STATUS Status; + ACPI_FUNCTION_NAME (NsRepairObject); + + /* * At this point, we know that the type of the returned object was not * one of the expected types for this predefined name. Attempt to - * repair the object. Only a limited number of repairs are possible. + * repair the object by converting it to one of the expected object + * types for this predefined name. */ - switch (ReturnObject->Common.Type) + if (ExpectedBtypes & ACPI_RTYPE_INTEGER) { - case ACPI_TYPE_BUFFER: - - /* Does the method/object legally return a string? */ - - if (!(ExpectedBtypes & ACPI_RTYPE_STRING)) + Status = AcpiNsConvertToInteger (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) { - return (AE_AML_OPERAND_TYPE); + goto ObjectRepaired; } - - /* - * Have a Buffer, expected a String, convert. Use a ToString - * conversion, no transform performed on the buffer data. The best - * example of this is the _BIF method, where the string data from - * the battery is often (incorrectly) returned as buffer object(s). - */ - Length = 0; - while ((Length < ReturnObject->Buffer.Length) && - (ReturnObject->Buffer.Pointer[Length])) - { - Length++; - } - - /* Allocate a new string object */ - - NewObject = AcpiUtCreateStringObject (Length); - if (!NewObject) - { - return (AE_NO_MEMORY); - } - - /* - * Copy the raw buffer data with no transform. String is already NULL - * terminated at Length+1. - */ - ACPI_MEMCPY (NewObject->String.Pointer, - ReturnObject->Buffer.Pointer, Length); - break; - - - case ACPI_TYPE_INTEGER: - - /* 1) Does the method/object legally return a buffer? */ - - if (ExpectedBtypes & ACPI_RTYPE_BUFFER) - { - /* - * Convert the Integer to a packed-byte buffer. _MAT needs - * this sometimes, if a read has been performed on a Field - * object that is less than or equal to the global integer - * size (32 or 64 bits). - */ - Status = AcpiExConvertToBuffer (ReturnObject, &NewObject); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - } - - /* 2) Does the method/object legally return a string? */ - - else if (ExpectedBtypes & ACPI_RTYPE_STRING) - { - /* - * The only supported Integer-to-String conversion is to convert - * an integer of value 0 to a NULL string. The last element of - * _BIF and _BIX packages occasionally need this fix. - */ - if (ReturnObject->Integer.Value != 0) - { - return (AE_AML_OPERAND_TYPE); - } - - /* Allocate a new NULL string object */ - - NewObject = AcpiUtCreateStringObject (0); - if (!NewObject) - { - return (AE_NO_MEMORY); - } - } - else - { - return (AE_AML_OPERAND_TYPE); - } - break; - - - default: - - /* We cannot repair this object */ - - return (AE_AML_OPERAND_TYPE); } + if (ExpectedBtypes & ACPI_RTYPE_STRING) + { + Status = AcpiNsConvertToString (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + if (ExpectedBtypes & ACPI_RTYPE_BUFFER) + { + Status = AcpiNsConvertToBuffer (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + if (ExpectedBtypes & ACPI_RTYPE_PACKAGE) + { + Status = AcpiNsConvertToPackage (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + + /* We cannot repair this object */ + + return (AE_AML_OPERAND_TYPE); + + +ObjectRepaired: /* Object was successfully repaired */ @@ -276,16 +270,16 @@ AcpiNsRepairObject ( ReturnObject->Common.ReferenceCount--; } - ACPI_INFO_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Converted %s to expected %s at index %u", - AcpiUtGetObjectTypeName (ReturnObject), + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Converted %s to expected %s at index %u\n", + Data->Pathname, AcpiUtGetObjectTypeName (ReturnObject), AcpiUtGetObjectTypeName (NewObject), PackageIndex)); } else { - ACPI_INFO_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Converted %s to expected %s", - AcpiUtGetObjectTypeName (ReturnObject), + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Converted %s to expected %s\n", + Data->Pathname, AcpiUtGetObjectTypeName (ReturnObject), AcpiUtGetObjectTypeName (NewObject))); } @@ -298,6 +292,341 @@ AcpiNsRepairObject ( } +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToInteger + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a String/Buffer object to an Integer. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsConvertToInteger ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_STATUS Status; + UINT64 Value = 0; + UINT32 i; + + + switch (OriginalObject->Common.Type) + { + case ACPI_TYPE_STRING: + + /* String-to-Integer conversion */ + + Status = AcpiUtStrtoul64 (OriginalObject->String.Pointer, + ACPI_ANY_BASE, &Value); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + + case ACPI_TYPE_BUFFER: + + /* Buffer-to-Integer conversion. Max buffer size is 64 bits. */ + + if (OriginalObject->Buffer.Length > 8) + { + return (AE_AML_OPERAND_TYPE); + } + + /* Extract each buffer byte to create the integer */ + + for (i = 0; i < OriginalObject->Buffer.Length; i++) + { + Value |= ((UINT64) OriginalObject->Buffer.Pointer[i] << (i * 8)); + } + break; + + default: + return (AE_AML_OPERAND_TYPE); + } + + NewObject = AcpiUtCreateIntegerObject (Value); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + *ReturnObject = NewObject; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToString + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a Integer/Buffer object to a String. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsConvertToString ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_SIZE Length; + ACPI_STATUS Status; + + + switch (OriginalObject->Common.Type) + { + case ACPI_TYPE_INTEGER: + /* + * Integer-to-String conversion. Commonly, convert + * an integer of value 0 to a NULL string. The last element of + * _BIF and _BIX packages occasionally need this fix. + */ + if (OriginalObject->Integer.Value == 0) + { + /* Allocate a new NULL string object */ + + NewObject = AcpiUtCreateStringObject (0); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + } + else + { + Status = AcpiExConvertToString (OriginalObject, &NewObject, + ACPI_IMPLICIT_CONVERT_HEX); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + } + break; + + case ACPI_TYPE_BUFFER: + /* + * Buffer-to-String conversion. Use a ToString + * conversion, no transform performed on the buffer data. The best + * example of this is the _BIF method, where the string data from + * the battery is often (incorrectly) returned as buffer object(s). + */ + Length = 0; + while ((Length < OriginalObject->Buffer.Length) && + (OriginalObject->Buffer.Pointer[Length])) + { + Length++; + } + + /* Allocate a new string object */ + + NewObject = AcpiUtCreateStringObject (Length); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + /* + * Copy the raw buffer data with no transform. String is already NULL + * terminated at Length+1. + */ + ACPI_MEMCPY (NewObject->String.Pointer, + OriginalObject->Buffer.Pointer, Length); + break; + + default: + return (AE_AML_OPERAND_TYPE); + } + + *ReturnObject = NewObject; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToBuffer + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a Integer/String/Package object to a Buffer. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsConvertToBuffer ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_STATUS Status; + ACPI_OPERAND_OBJECT **Elements; + UINT32 *DwordBuffer; + UINT32 Count; + UINT32 i; + + + switch (OriginalObject->Common.Type) + { + case ACPI_TYPE_INTEGER: + /* + * Integer-to-Buffer conversion. + * Convert the Integer to a packed-byte buffer. _MAT and other + * objects need this sometimes, if a read has been performed on a + * Field object that is less than or equal to the global integer + * size (32 or 64 bits). + */ + Status = AcpiExConvertToBuffer (OriginalObject, &NewObject); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + + case ACPI_TYPE_STRING: + + /* String-to-Buffer conversion. Simple data copy */ + + NewObject = AcpiUtCreateBufferObject (OriginalObject->String.Length); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + ACPI_MEMCPY (NewObject->Buffer.Pointer, + OriginalObject->String.Pointer, OriginalObject->String.Length); + break; + + case ACPI_TYPE_PACKAGE: + /* + * This case is often seen for predefined names that must return a + * Buffer object with multiple DWORD integers within. For example, + * _FDE and _GTM. The Package can be converted to a Buffer. + */ + + /* All elements of the Package must be integers */ + + Elements = OriginalObject->Package.Elements; + Count = OriginalObject->Package.Count; + + for (i = 0; i < Count; i++) + { + if ((!*Elements) || + ((*Elements)->Common.Type != ACPI_TYPE_INTEGER)) + { + return (AE_AML_OPERAND_TYPE); + } + Elements++; + } + + /* Create the new buffer object to replace the Package */ + + NewObject = AcpiUtCreateBufferObject (ACPI_MUL_4 (Count)); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + /* Copy the package elements (integers) to the buffer as DWORDs */ + + Elements = OriginalObject->Package.Elements; + DwordBuffer = ACPI_CAST_PTR (UINT32, NewObject->Buffer.Pointer); + + for (i = 0; i < Count; i++) + { + *DwordBuffer = (UINT32) (*Elements)->Integer.Value; + DwordBuffer++; + Elements++; + } + break; + + default: + return (AE_AML_OPERAND_TYPE); + } + + *ReturnObject = NewObject; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToPackage + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a Buffer object to a Package. Each byte of + * the buffer is converted to a single integer package element. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsConvertToPackage ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_OPERAND_OBJECT **Elements; + UINT32 Length; + UINT8 *Buffer; + + + switch (OriginalObject->Common.Type) + { + case ACPI_TYPE_BUFFER: + + /* Buffer-to-Package conversion */ + + Length = OriginalObject->Buffer.Length; + NewObject = AcpiUtCreatePackageObject (Length); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + /* Convert each buffer byte to an integer package element */ + + Elements = NewObject->Package.Elements; + Buffer = OriginalObject->Buffer.Pointer; + + while (Length--) + { + *Elements = AcpiUtCreateIntegerObject ((UINT64) *Buffer); + if (!*Elements) + { + AcpiUtRemoveReference (NewObject); + return (AE_NO_MEMORY); + } + Elements++; + Buffer++; + } + break; + + default: + return (AE_AML_OPERAND_TYPE); + } + + *ReturnObject = NewObject; + return (AE_OK); +} + + /******************************************************************************* * * FUNCTION: AcpiNsRepairPackageList @@ -330,6 +659,9 @@ AcpiNsRepairPackageList ( ACPI_OPERAND_OBJECT *PkgObjDesc; + ACPI_FUNCTION_NAME (NsRepairPackageList); + + /* * Create the new outer package and populate it. The new package will * have a single element, the lone subpackage. @@ -347,8 +679,8 @@ AcpiNsRepairPackageList ( *ObjDescPtr = PkgObjDesc; Data->Flags |= ACPI_OBJECT_REPAIRED; - ACPI_INFO_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Repaired Incorrectly formed Package")); + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Repaired incorrectly formed Package\n", Data->Pathname)); return (AE_OK); } diff --git a/namespace/nsrepair2.c b/namespace/nsrepair2.c index d248906182b8..c08028452b4c 100644 --- a/namespace/nsrepair2.c +++ b/namespace/nsrepair2.c @@ -119,6 +119,7 @@ #include "acpi.h" #include "accommon.h" #include "acnamesp.h" +#include "acpredef.h" #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsrepair2") @@ -152,6 +153,11 @@ AcpiNsRepair_ALR ( ACPI_PREDEFINED_DATA *Data, ACPI_OPERAND_OBJECT **ReturnObjectPtr); +static ACPI_STATUS +AcpiNsRepair_FDE ( + ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); + static ACPI_STATUS AcpiNsRepair_PSS ( ACPI_PREDEFINED_DATA *Data, @@ -171,10 +177,6 @@ AcpiNsCheckSortedList ( UINT8 SortDirection, char *SortKeyName); -static ACPI_STATUS -AcpiNsRemoveNullElements ( - ACPI_OPERAND_OBJECT *Package); - static ACPI_STATUS AcpiNsSortList ( ACPI_OPERAND_OBJECT **Elements, @@ -192,19 +194,30 @@ AcpiNsSortList ( * This table contains the names of the predefined methods for which we can * perform more complex repairs. * - * _ALR: Sort the list ascending by AmbientIlluminance if necessary - * _PSS: Sort the list descending by Power if necessary - * _TSS: Sort the list descending by Power if necessary + * As necessary: + * + * _ALR: Sort the list ascending by AmbientIlluminance + * _FDE: Convert Buffer of BYTEs to a Buffer of DWORDs + * _GTM: Convert Buffer of BYTEs to a Buffer of DWORDs + * _PSS: Sort the list descending by Power + * _TSS: Sort the list descending by Power */ static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] = { {"_ALR", AcpiNsRepair_ALR}, + {"_FDE", AcpiNsRepair_FDE}, + {"_GTM", AcpiNsRepair_FDE}, /* _GTM has same repair as _FDE */ {"_PSS", AcpiNsRepair_PSS}, {"_TSS", AcpiNsRepair_TSS}, - {{0,0,0,0}, NULL} /* Table terminator */ + {{0,0,0,0}, NULL} /* Table terminator */ }; +#define ACPI_FDE_FIELD_COUNT 5 +#define ACPI_FDE_BYTE_BUFFER_SIZE 5 +#define ACPI_FDE_DWORD_BUFFER_SIZE (ACPI_FDE_FIELD_COUNT * sizeof (UINT32)) + + /****************************************************************************** * * FUNCTION: AcpiNsComplexRepairs @@ -215,7 +228,7 @@ static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] = * ReturnObjectPtr - Pointer to the object returned from the * evaluation of a method or object * - * RETURN: Status. AE_OK if repair was successful. If name is not + * RETURN: Status. AE_OK if repair was successful. If name is not * matched, ValidateStatus is returned. * * DESCRIPTION: Attempt to repair/convert a return object of a type that was @@ -313,6 +326,99 @@ AcpiNsRepair_ALR ( } +/****************************************************************************** + * + * FUNCTION: AcpiNsRepair_FDE + * + * PARAMETERS: Data - Pointer to validation data structure + * ReturnObjectPtr - Pointer to the object returned from the + * evaluation of a method or object + * + * RETURN: Status. AE_OK if object is OK or was repaired successfully + * + * DESCRIPTION: Repair for the _FDE and _GTM objects. The expected return + * value is a Buffer of 5 DWORDs. This function repairs a common + * problem where the return value is a Buffer of BYTEs, not + * DWORDs. + * + *****************************************************************************/ + +static ACPI_STATUS +AcpiNsRepair_FDE ( + ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT **ReturnObjectPtr) +{ + ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; + ACPI_OPERAND_OBJECT *BufferObject; + UINT8 *ByteBuffer; + UINT32 *DwordBuffer; + UINT32 i; + + + ACPI_FUNCTION_NAME (NsRepair_FDE); + + + switch (ReturnObject->Common.Type) + { + case ACPI_TYPE_BUFFER: + + /* This is the expected type. Length should be (at least) 5 DWORDs */ + + if (ReturnObject->Buffer.Length >= ACPI_FDE_DWORD_BUFFER_SIZE) + { + return (AE_OK); + } + + /* We can only repair if we have exactly 5 BYTEs */ + + if (ReturnObject->Buffer.Length != ACPI_FDE_BYTE_BUFFER_SIZE) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + "Incorrect return buffer length %u, expected %u", + ReturnObject->Buffer.Length, ACPI_FDE_DWORD_BUFFER_SIZE)); + + return (AE_AML_OPERAND_TYPE); + } + + /* Create the new (larger) buffer object */ + + BufferObject = AcpiUtCreateBufferObject (ACPI_FDE_DWORD_BUFFER_SIZE); + if (!BufferObject) + { + return (AE_NO_MEMORY); + } + + /* Expand each byte to a DWORD */ + + ByteBuffer = ReturnObject->Buffer.Pointer; + DwordBuffer = ACPI_CAST_PTR (UINT32, BufferObject->Buffer.Pointer); + + for (i = 0; i < ACPI_FDE_FIELD_COUNT; i++) + { + *DwordBuffer = (UINT32) *ByteBuffer; + DwordBuffer++; + ByteBuffer++; + } + + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s Expanded Byte Buffer to expected DWord Buffer\n", + Data->Pathname)); + break; + + default: + return (AE_AML_OPERAND_TYPE); + } + + /* Delete the original return object, return the new buffer object */ + + AcpiUtRemoveReference (ReturnObject); + *ReturnObjectPtr = BufferObject; + + Data->Flags |= ACPI_OBJECT_REPAIRED; + return (AE_OK); +} + + /****************************************************************************** * * FUNCTION: AcpiNsRepair_TSS @@ -454,6 +560,9 @@ AcpiNsCheckSortedList ( ACPI_STATUS Status; + ACPI_FUNCTION_NAME (NsCheckSortedList); + + /* The top-level object must be a package */ if (ReturnObject->Common.Type != ACPI_TYPE_PACKAGE) @@ -462,26 +571,10 @@ AcpiNsCheckSortedList ( } /* - * Detect any NULL package elements and remove them from the - * package. - * - * TBD: We may want to do this for all predefined names that - * return a variable-length package of packages. + * NOTE: assumes list of sub-packages contains no NULL elements. + * Any NULL elements should have been removed by earlier call + * to AcpiNsRemoveNullElements. */ - Status = AcpiNsRemoveNullElements (ReturnObject); - if (Status == AE_NULL_ENTRY) - { - ACPI_INFO_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "NULL elements removed from package")); - - /* Exit if package is now zero length */ - - if (!ReturnObject->Package.Count) - { - return (AE_NULL_ENTRY); - } - } - OuterElements = ReturnObject->Package.Elements; OuterElementCount = ReturnObject->Package.Count; if (!OuterElementCount) @@ -539,8 +632,9 @@ AcpiNsCheckSortedList ( Data->Flags |= ACPI_OBJECT_REPAIRED; - ACPI_INFO_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Repaired unsorted list - now sorted by %s", SortKeyName)); + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Repaired unsorted list - now sorted by %s\n", + Data->Pathname, SortKeyName)); return (AE_OK); } @@ -556,40 +650,69 @@ AcpiNsCheckSortedList ( * * FUNCTION: AcpiNsRemoveNullElements * - * PARAMETERS: ObjDesc - A Package object + * PARAMETERS: Data - Pointer to validation data structure + * PackageType - An AcpiReturnPackageTypes value + * ObjDesc - A Package object * - * RETURN: Status. AE_NULL_ENTRY means that one or more elements were - * removed. + * RETURN: None. * - * DESCRIPTION: Remove all NULL package elements and update the package count. + * DESCRIPTION: Remove all NULL package elements from packages that contain + * a variable number of sub-packages. * *****************************************************************************/ -static ACPI_STATUS +void AcpiNsRemoveNullElements ( + ACPI_PREDEFINED_DATA *Data, + UINT8 PackageType, ACPI_OPERAND_OBJECT *ObjDesc) { ACPI_OPERAND_OBJECT **Source; ACPI_OPERAND_OBJECT **Dest; - ACPI_STATUS Status = AE_OK; UINT32 Count; UINT32 NewCount; UINT32 i; + ACPI_FUNCTION_NAME (NsRemoveNullElements); + + + /* + * PTYPE1 packages contain no subpackages. + * PTYPE2 packages contain a variable number of sub-packages. We can + * safely remove all NULL elements from the PTYPE2 packages. + */ + switch (PackageType) + { + case ACPI_PTYPE1_FIXED: + case ACPI_PTYPE1_VAR: + case ACPI_PTYPE1_OPTION: + return; + + case ACPI_PTYPE2: + case ACPI_PTYPE2_COUNT: + case ACPI_PTYPE2_PKG_COUNT: + case ACPI_PTYPE2_FIXED: + case ACPI_PTYPE2_MIN: + case ACPI_PTYPE2_REV_FIXED: + break; + + default: + return; + } + Count = ObjDesc->Package.Count; NewCount = Count; Source = ObjDesc->Package.Elements; Dest = Source; - /* Examine all elements of the package object */ + /* Examine all elements of the package object, remove nulls */ for (i = 0; i < Count; i++) { if (!*Source) { - Status = AE_NULL_ENTRY; NewCount--; } else @@ -600,15 +723,19 @@ AcpiNsRemoveNullElements ( Source++; } - if (Status == AE_NULL_ENTRY) + /* Update parent package if any null elements were removed */ + + if (NewCount < Count) { + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Found and removed %u NULL elements\n", + Data->Pathname, (Count - NewCount))); + /* NULL terminate list and update the package count */ *Dest = NULL; ObjDesc->Package.Count = NewCount; } - - return (Status); } diff --git a/namespace/nsutils.c b/namespace/nsutils.c index dffc0d4432b1..ed0c3f7ec810 100644 --- a/namespace/nsutils.c +++ b/namespace/nsutils.c @@ -857,25 +857,26 @@ AcpiNsExternalizeName ( /******************************************************************************* * - * FUNCTION: AcpiNsMapHandleToNode + * FUNCTION: AcpiNsValidateHandle * - * PARAMETERS: Handle - Handle to be converted to an Node + * PARAMETERS: Handle - Handle to be validated and typecast to a + * namespace node. * - * RETURN: A Name table entry pointer + * RETURN: A pointer to a namespace node * - * DESCRIPTION: Convert a namespace handle to a real Node + * DESCRIPTION: Convert a namespace handle to a namespace node. Handles special + * cases for the root node. * - * Note: Real integer handles would allow for more verification + * NOTE: Real integer handles would allow for more verification * and keep all pointers within this subsystem - however this introduces - * more (and perhaps unnecessary) overhead. - * - * The current implemenation is basically a placeholder until such time comes - * that it is needed. + * more overhead and has not been necessary to this point. Drivers + * holding handles are typically notified before a node becomes invalid + * due to a table unload. * ******************************************************************************/ ACPI_NAMESPACE_NODE * -AcpiNsMapHandleToNode ( +AcpiNsValidateHandle ( ACPI_HANDLE Handle) { @@ -900,48 +901,6 @@ AcpiNsMapHandleToNode ( } -/******************************************************************************* - * - * FUNCTION: AcpiNsConvertEntryToHandle - * - * PARAMETERS: Node - Node to be converted to a Handle - * - * RETURN: A user handle - * - * DESCRIPTION: Convert a real Node to a namespace handle - * - ******************************************************************************/ - -ACPI_HANDLE -AcpiNsConvertEntryToHandle ( - ACPI_NAMESPACE_NODE *Node) -{ - - - /* - * Simple implementation for now; - */ - return ((ACPI_HANDLE) Node); - - -/* Example future implementation --------------------- - - if (!Node) - { - return (NULL); - } - - if (Node == AcpiGbl_RootNode) - { - return (ACPI_ROOT_OBJECT); - } - - - return ((ACPI_HANDLE) Node); -------------------------------------------------------*/ -} - - /******************************************************************************* * * FUNCTION: AcpiNsTerminate diff --git a/namespace/nsxfeval.c b/namespace/nsxfeval.c index 1ba85ab05fd7..a0f96a04ee09 100644 --- a/namespace/nsxfeval.c +++ b/namespace/nsxfeval.c @@ -281,7 +281,7 @@ AcpiEvaluateObject ( /* Convert and validate the device handle */ - Info->PrefixNode = AcpiNsMapHandleToNode (Handle); + Info->PrefixNode = AcpiNsValidateHandle (Handle); if (!Info->PrefixNode) { Status = AE_BAD_PARAMETER; @@ -676,7 +676,7 @@ AcpiNsGetDeviceCallback ( return (Status); } - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { @@ -888,7 +888,7 @@ AcpiAttachData ( /* Convert and validate the handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { Status = AE_BAD_PARAMETER; @@ -943,7 +943,7 @@ AcpiDetachData ( /* Convert and validate the handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { Status = AE_BAD_PARAMETER; @@ -1001,7 +1001,7 @@ AcpiGetData ( /* Convert and validate the handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { Status = AE_BAD_PARAMETER; diff --git a/namespace/nsxfname.c b/namespace/nsxfname.c index 166862bc2a9c..cb7aaa6f941f 100644 --- a/namespace/nsxfname.c +++ b/namespace/nsxfname.c @@ -178,7 +178,7 @@ AcpiGetHandle ( if (Parent) { - PrefixNode = AcpiNsMapHandleToNode (Parent); + PrefixNode = AcpiNsValidateHandle (Parent); if (!PrefixNode) { return (AE_BAD_PARAMETER); @@ -200,7 +200,7 @@ AcpiGetHandle ( if (!ACPI_STRCMP (Pathname, ACPI_NS_ROOT_PATH)) { - *RetHandle = AcpiNsConvertEntryToHandle (AcpiGbl_RootNode); + *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, AcpiGbl_RootNode); return (AE_OK); } } @@ -216,7 +216,7 @@ AcpiGetHandle ( Status = AcpiNsGetNode (PrefixNode, Pathname, ACPI_NS_NO_UPSEARCH, &Node); if (ACPI_SUCCESS (Status)) { - *RetHandle = AcpiNsConvertEntryToHandle (Node); + *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, Node); } return (Status); @@ -282,7 +282,7 @@ AcpiGetName ( return (Status); } - Node = AcpiNsMapHandleToNode (Handle); + Node = AcpiNsValidateHandle (Handle); if (!Node) { Status = AE_BAD_PARAMETER; @@ -399,7 +399,7 @@ AcpiGetObjectInfo ( goto Cleanup; } - Node = AcpiNsMapHandleToNode (Handle); + Node = AcpiNsValidateHandle (Handle); if (!Node) { (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); diff --git a/namespace/nsxfobj.c b/namespace/nsxfobj.c index 023cb6990b0d..9c42a33f8b21 100644 --- a/namespace/nsxfobj.c +++ b/namespace/nsxfobj.c @@ -172,7 +172,7 @@ AcpiGetType ( /* Convert and validate the handle */ - Node = AcpiNsMapHandleToNode (Handle); + Node = AcpiNsValidateHandle (Handle); if (!Node) { (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); @@ -233,7 +233,7 @@ AcpiGetParent ( /* Convert and validate the handle */ - Node = AcpiNsMapHandleToNode (Handle); + Node = AcpiNsValidateHandle (Handle); if (!Node) { Status = AE_BAD_PARAMETER; @@ -243,7 +243,7 @@ AcpiGetParent ( /* Get the parent entry */ ParentNode = AcpiNsGetParentNode (Node); - *RetHandle = AcpiNsConvertEntryToHandle (ParentNode); + *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, ParentNode); /* Return exception if parent is null */ @@ -312,7 +312,7 @@ AcpiGetNextObject ( { /* Start search at the beginning of the specified scope */ - ParentNode = AcpiNsMapHandleToNode (Parent); + ParentNode = AcpiNsValidateHandle (Parent); if (!ParentNode) { Status = AE_BAD_PARAMETER; @@ -324,7 +324,7 @@ AcpiGetNextObject ( /* Non-null handle, ignore the parent */ /* Convert and validate the handle */ - ChildNode = AcpiNsMapHandleToNode (Child); + ChildNode = AcpiNsValidateHandle (Child); if (!ChildNode) { Status = AE_BAD_PARAMETER; @@ -343,7 +343,7 @@ AcpiGetNextObject ( if (RetHandle) { - *RetHandle = AcpiNsConvertEntryToHandle (Node); + *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, Node); } diff --git a/parser/psxface.c b/parser/psxface.c index 5f6f663d8d7f..1bf36e01c93a 100644 --- a/parser/psxface.c +++ b/parser/psxface.c @@ -403,7 +403,7 @@ AcpiPsExecuteMethod ( if (Info->ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY) { - Status = Info->ObjDesc->Method.Implementation (WalkState); + Status = Info->ObjDesc->Method.Extra.Implementation (WalkState); Info->ReturnObject = WalkState->ReturnDesc; /* Cleanup states */ diff --git a/resources/rsxface.c b/resources/rsxface.c index 32ed559569f3..a509c7afc7a4 100644 --- a/resources/rsxface.c +++ b/resources/rsxface.c @@ -191,7 +191,7 @@ AcpiRsValidateParameters ( return_ACPI_STATUS (AE_BAD_PARAMETER); } - Node = AcpiNsMapHandleToNode (DeviceHandle); + Node = AcpiNsValidateHandle (DeviceHandle); if (!Node) { return_ACPI_STATUS (AE_BAD_PARAMETER); diff --git a/tools/acpiexec/aecommon.h b/tools/acpiexec/aecommon.h index 3ad0d0f4064a..53f7a17bace7 100644 --- a/tools/acpiexec/aecommon.h +++ b/tools/acpiexec/aecommon.h @@ -135,8 +135,9 @@ #include "acinterp.h" #include "acapps.h" -extern FILE *AcpiGbl_DebugFile; -extern BOOLEAN AcpiGbl_IgnoreErrors; +extern FILE *AcpiGbl_DebugFile; +extern BOOLEAN AcpiGbl_IgnoreErrors; +extern UINT8 AcpiGbl_RegionFillValue; typedef struct ae_table_desc diff --git a/tools/acpiexec/aehandlers.c b/tools/acpiexec/aehandlers.c index 9e00f5b30f5f..ae57483c49f0 100644 --- a/tools/acpiexec/aehandlers.c +++ b/tools/acpiexec/aehandlers.c @@ -877,7 +877,10 @@ AeRegionHandler ( return AE_NO_MEMORY; } - ACPI_MEMSET (RegionElement->Buffer, 0, Length); + /* Initialize the region with the default fill value */ + + ACPI_MEMSET (RegionElement->Buffer, AcpiGbl_RegionFillValue, Length); + RegionElement->Address = BaseAddress; RegionElement->Length = Length; RegionElement->SpaceId = SpaceId; diff --git a/tools/acpiexec/aemain.c b/tools/acpiexec/aemain.c index 1a2dd7cdb367..777c5741e739 100644 --- a/tools/acpiexec/aemain.c +++ b/tools/acpiexec/aemain.c @@ -123,6 +123,7 @@ ACPI_MODULE_NAME ("aemain") UINT8 AcpiGbl_BatchMode = 0; +UINT8 AcpiGbl_RegionFillValue = 0; BOOLEAN AcpiGbl_IgnoreErrors = FALSE; BOOLEAN AcpiGbl_DbOpt_NoRegionSupport = FALSE; BOOLEAN AcpiGbl_DebugTimeout = FALSE; @@ -134,8 +135,7 @@ char *FileList[ASL_MAX_FILES]; int FileCount; - -#define AE_SUPPORTED_OPTIONS "?ab:de^ghimo:rstvx:z" +#define AE_SUPPORTED_OPTIONS "?ab:de^f:ghimo:rstvx:z" /****************************************************************************** @@ -160,6 +160,7 @@ usage (void) printf (" -a Do not abort methods on error\n"); printf (" -b Batch mode command execution\n"); printf (" -e [Method] Batch mode method execution\n"); + printf (" -f Specify OpRegion initialization fill value\n"); printf (" -i Do not run STA/INI methods during init\n"); printf (" -m Display final memory use statistics\n"); printf (" -o Send output to this file\n"); @@ -497,6 +498,10 @@ main ( } break; + case 'f': + AcpiGbl_RegionFillValue = (UINT8) strtoul (AcpiGbl_Optarg, NULL, 0); + break; + case 'g': AcpiGbl_DbOpt_tables = TRUE; AcpiGbl_DbFilename = NULL; diff --git a/utilities/utcopy.c b/utilities/utcopy.c index 20a0e34324f7..5423eff9dec4 100644 --- a/utilities/utcopy.c +++ b/utilities/utcopy.c @@ -422,11 +422,11 @@ AcpiUtCopyIelementToEelement ( * RETURN: Status * * DESCRIPTION: This function is called to place a package object in a user - * buffer. A package object by definition contains other objects. + * buffer. A package object by definition contains other objects. * * The buffer is assumed to have sufficient space for the object. - * The caller must have verified the buffer length needed using the - * AcpiUtGetObjectSize function before calling this function. + * The caller must have verified the buffer length needed using + * the AcpiUtGetObjectSize function before calling this function. * ******************************************************************************/ @@ -485,12 +485,12 @@ AcpiUtCopyIpackageToEpackage ( * FUNCTION: AcpiUtCopyIobjectToEobject * * PARAMETERS: InternalObject - The internal object to be converted - * BufferPtr - Where the object is returned + * RetBuffer - Where the object is returned * * RETURN: Status * - * DESCRIPTION: This function is called to build an API object to be returned to - * the caller. + * DESCRIPTION: This function is called to build an API object to be returned + * to the caller. * ******************************************************************************/ @@ -742,7 +742,7 @@ AcpiUtCopyEpackageToIpackage ( * PARAMETERS: ExternalObject - The external object to be converted * InternalObject - Where the internal object is returned * - * RETURN: Status - the status of the call + * RETURN: Status * * DESCRIPTION: Converts an external object to an internal object. * @@ -784,7 +784,7 @@ AcpiUtCopyEobjectToIobject ( * * RETURN: Status * - * DESCRIPTION: Simple copy of one internal object to another. Reference count + * DESCRIPTION: Simple copy of one internal object to another. Reference count * of the destination object is preserved. * ******************************************************************************/ @@ -1034,10 +1034,11 @@ AcpiUtCopyIelementToIelement ( * * FUNCTION: AcpiUtCopyIpackageToIpackage * - * PARAMETERS: *SourceObj - Pointer to the source package object - * *DestObj - Where the internal object is returned + * PARAMETERS: SourceObj - Pointer to the source package object + * DestObj - Where the internal object is returned + * WalkState - Current Walk state descriptor * - * RETURN: Status - the status of the call + * RETURN: Status * * DESCRIPTION: This function is called to copy an internal package object * into another internal package object. @@ -1093,9 +1094,9 @@ AcpiUtCopyIpackageToIpackage ( * * FUNCTION: AcpiUtCopyIobjectToIobject * - * PARAMETERS: WalkState - Current walk state - * SourceDesc - The internal object to be copied + * PARAMETERS: SourceDesc - The internal object to be copied * DestDesc - Where the copied object is returned + * WalkState - Current walk state * * RETURN: Status * From fc2ff8b4ae15e9952d34803553e9917c8091d72a Mon Sep 17 00:00:00 2001 From: jkim Date: Thu, 21 Jan 2010 20:56:18 +0000 Subject: [PATCH 2/3] Import ACPICA 20100121. --- changes.txt | 62 ++++++-- common/adfile.c | 2 +- common/adisasm.c | 2 +- common/adwalk.c | 2 +- common/dmextern.c | 2 +- common/dmrestag.c | 2 +- common/dmtable.c | 2 +- common/dmtbdump.c | 2 +- common/dmtbinfo.c | 2 +- common/getopt.c | 2 +- compiler/aslanalyze.c | 10 +- compiler/aslcodegen.c | 2 +- compiler/aslcompile.c | 2 +- compiler/aslcompiler.h | 6 +- compiler/aslcompiler.l | 2 +- compiler/aslcompiler.y | 4 +- compiler/asldefine.h | 4 +- compiler/aslerror.c | 16 +-- compiler/aslfiles.c | 2 +- compiler/aslfold.c | 2 +- compiler/aslglobal.h | 10 +- compiler/asllength.c | 2 +- compiler/asllisting.c | 2 +- compiler/aslload.c | 14 +- compiler/asllookup.c | 2 +- compiler/aslmain.c | 5 +- compiler/aslmap.c | 2 +- compiler/aslopcodes.c | 10 +- compiler/asloperands.c | 6 +- compiler/aslopt.c | 2 +- compiler/aslresource.c | 4 +- compiler/aslrestype1.c | 2 +- compiler/aslrestype2.c | 2 +- compiler/aslstartup.c | 2 +- compiler/aslstubs.c | 2 +- compiler/asltransform.c | 20 +-- compiler/asltree.c | 4 +- compiler/asltypes.h | 9 +- compiler/aslutils.c | 28 ++-- debugger/dbcmds.c | 2 +- debugger/dbdisply.c | 2 +- debugger/dbexec.c | 6 +- debugger/dbfileio.c | 7 +- debugger/dbhistry.c | 2 +- debugger/dbinput.c | 2 +- debugger/dbstats.c | 2 +- debugger/dbutils.c | 2 +- debugger/dbxface.c | 2 +- disassembler/dmbuffer.c | 2 +- disassembler/dmnames.c | 2 +- disassembler/dmobject.c | 2 +- disassembler/dmopcode.c | 6 +- disassembler/dmresrc.c | 2 +- disassembler/dmresrcl.c | 2 +- disassembler/dmresrcs.c | 2 +- disassembler/dmutils.c | 2 +- disassembler/dmwalk.c | 2 +- dispatcher/dsfield.c | 12 +- dispatcher/dsinit.c | 2 +- dispatcher/dsmethod.c | 2 +- dispatcher/dsmthdat.c | 2 +- dispatcher/dsobject.c | 4 +- dispatcher/dsopcode.c | 2 +- dispatcher/dsutils.c | 2 +- dispatcher/dswexec.c | 2 +- dispatcher/dswload.c | 2 +- dispatcher/dswscope.c | 2 +- dispatcher/dswstate.c | 2 +- events/evevent.c | 2 +- events/evgpe.c | 2 +- events/evgpeblk.c | 2 +- events/evmisc.c | 2 +- events/evregion.c | 6 +- events/evrgnini.c | 4 +- events/evsci.c | 2 +- events/evxface.c | 2 +- events/evxfevnt.c | 2 +- events/evxfregn.c | 2 +- executer/exconfig.c | 16 +-- executer/exconvrt.c | 14 +- executer/excreate.c | 2 +- executer/exdump.c | 2 +- executer/exfield.c | 8 +- executer/exfldio.c | 50 +++---- executer/exmisc.c | 16 +-- executer/exmutex.c | 2 +- executer/exnames.c | 2 +- executer/exoparg1.c | 16 +-- executer/exoparg2.c | 6 +- executer/exoparg3.c | 4 +- executer/exoparg6.c | 10 +- executer/exprep.c | 2 +- executer/exregion.c | 30 ++-- executer/exresnte.c | 2 +- executer/exresolv.c | 2 +- executer/exresop.c | 2 +- executer/exstore.c | 2 +- executer/exstoren.c | 2 +- executer/exstorob.c | 2 +- executer/exsystem.c | 4 +- executer/exutils.c | 24 ++-- hardware/hwacpi.c | 2 +- hardware/hwgpe.c | 9 +- hardware/hwregs.c | 2 +- hardware/hwsleep.c | 2 +- hardware/hwtimer.c | 4 +- hardware/hwvalid.c | 2 +- hardware/hwxface.c | 2 +- include/acapps.h | 8 +- include/accommon.h | 2 +- include/acconfig.h | 2 +- include/acdebug.h | 2 +- include/acdisasm.h | 2 +- include/acdispat.h | 2 +- include/acevents.h | 4 +- include/acexcep.h | 2 +- include/acglobal.h | 2 +- include/achware.h | 2 +- include/acinterp.h | 44 +++--- include/aclocal.h | 6 +- include/acmacros.h | 14 +- include/acnames.h | 2 +- include/acnamesp.h | 20 ++- include/acobject.h | 4 +- include/acopcode.h | 2 +- include/acoutput.h | 2 +- include/acparser.h | 2 +- include/acpi.h | 2 +- include/acpiosxf.h | 6 +- include/acpixf.h | 4 +- include/acpredef.h | 2 +- include/acresrc.h | 2 +- include/acrestyp.h | 4 +- include/acstruct.h | 2 +- include/actables.h | 2 +- include/actbl.h | 2 +- include/actbl1.h | 2 +- include/actbl2.h | 2 +- include/actypes.h | 36 +++-- include/acutils.h | 22 +-- include/amlcode.h | 2 +- include/amlresrc.h | 2 +- include/platform/accygwin.h | 5 +- include/platform/acefi.h | 2 +- include/platform/acenv.h | 10 +- include/platform/acfreebsd.h | 2 +- include/platform/acgcc.h | 2 +- include/platform/acintel.h | 2 +- include/platform/aclinux.h | 2 +- include/platform/acmsvc.h | 2 +- include/platform/acnetbsd.h | 2 +- include/platform/acos2.h | 2 +- include/platform/acwin.h | 2 +- include/platform/acwin64.h | 2 +- namespace/nsaccess.c | 2 +- namespace/nsalloc.c | 2 +- namespace/nsdump.c | 2 +- namespace/nsdumpdv.c | 2 +- namespace/nseval.c | 2 +- namespace/nsinit.c | 2 +- namespace/nsload.c | 2 +- namespace/nsnames.c | 2 +- namespace/nsobject.c | 2 +- namespace/nsparse.c | 2 +- namespace/nspredef.c | 53 ++++--- namespace/nsrepair.c | 192 ++++++++++++++++++++++++- namespace/nsrepair2.c | 118 ++------------- namespace/nssearch.c | 2 +- namespace/nsutils.c | 2 +- namespace/nswalk.c | 2 +- namespace/nsxfeval.c | 56 +++++--- namespace/nsxfname.c | 2 +- namespace/nsxfobj.c | 2 +- os_specific/service_layers/osunixdir.c | 6 +- os_specific/service_layers/osunixxf.c | 6 +- os_specific/service_layers/oswindir.c | 2 +- os_specific/service_layers/oswintbl.c | 2 +- os_specific/service_layers/oswinxf.c | 6 +- osunixxf.c | 6 +- parser/psargs.c | 4 +- parser/psloop.c | 2 +- parser/psopcode.c | 2 +- parser/psparse.c | 2 +- parser/psscope.c | 2 +- parser/pstree.c | 2 +- parser/psutils.c | 2 +- parser/pswalk.c | 2 +- parser/psxface.c | 2 +- resources/rsaddr.c | 2 +- resources/rscalc.c | 2 +- resources/rscreate.c | 4 +- resources/rsdump.c | 2 +- resources/rsinfo.c | 2 +- resources/rsio.c | 2 +- resources/rsirq.c | 2 +- resources/rslist.c | 2 +- resources/rsmemory.c | 2 +- resources/rsmisc.c | 2 +- resources/rsutils.c | 2 +- resources/rsxface.c | 2 +- tables/tbfadt.c | 2 +- tables/tbfind.c | 2 +- tables/tbinstal.c | 2 +- tables/tbutils.c | 2 +- tables/tbxface.c | 2 +- tables/tbxfroot.c | 2 +- tools/acpiexec/aecommon.h | 4 +- tools/acpiexec/aeexec.c | 2 +- tools/acpiexec/aehandlers.c | 10 +- tools/acpiexec/aemain.c | 12 +- tools/acpiexec/aetables.c | 2 +- tools/acpiexec/osunixdir.c | 6 +- tools/acpisrc/acpisrc.h | 2 +- tools/acpisrc/ascase.c | 42 +++--- tools/acpisrc/asconvrt.c | 8 +- tools/acpisrc/asfile.c | 2 +- tools/acpisrc/asmain.c | 6 +- tools/acpisrc/asremove.c | 2 +- tools/acpisrc/astable.c | 13 +- tools/acpisrc/asutils.c | 2 +- tools/acpisrc/osunixdir.c | 6 +- tools/acpixtract/acpixtract.c | 6 +- tools/examples/examples.c | 2 +- utilities/utalloc.c | 2 +- utilities/utcache.c | 2 +- utilities/utclib.c | 2 +- utilities/utcopy.c | 2 +- utilities/utdebug.c | 4 +- utilities/utdelete.c | 2 +- utilities/uteval.c | 4 +- utilities/utglobal.c | 4 +- utilities/utids.c | 2 +- utilities/utinit.c | 2 +- utilities/utlock.c | 2 +- utilities/utmath.c | 30 ++-- utilities/utmisc.c | 12 +- utilities/utmutex.c | 20 +-- utilities/utobject.c | 2 +- utilities/utresrc.c | 2 +- utilities/utstate.c | 2 +- utilities/uttrack.c | 2 +- utilities/utxface.c | 2 +- 242 files changed, 884 insertions(+), 739 deletions(-) diff --git a/changes.txt b/changes.txt index d8127f24da8b..60620ce4f76b 100644 --- a/changes.txt +++ b/changes.txt @@ -1,8 +1,56 @@ +---------------------------------------- +21 January 2010. Summary of changes for version 20100121: + +1) ACPI CA Core Subsystem: + +Added the 2010 copyright to all module headers and signons. This affects +virtually every file in the ACPICA core subsystem, the iASL compiler, the +tools/utilities, and the test suites. + +Implemented a change to the AcpiGetDevices interface to eliminate unnecessary +invocations of the _STA method. In the case where a specific _HID is +requested, do not run _STA until a _HID match is found. This eliminates +potentially dozens of _STA calls during a search for a particular device/HID, +which in turn can improve boot times. ACPICA BZ 828. Lin Ming. + +Implemented an additional repair for predefined method return values. Attempt +to repair unexpected NULL elements within returned Package objects. Create an +Integer of value zero, a NULL String, or a zero-length Buffer as appropriate. +ACPICA BZ 818. Lin Ming, Bob Moore. + +Removed the obsolete ACPI_INTEGER data type. This type was introduced as the +code was migrated from ACPI 1.0 (with 32-bit AML integers) to ACPI 2.0 (with +64-bit AML integers). It is now obsolete and this change removes it from the +ACPICA code base, replaced by UINT64. The original typedef has been retained +for now for compatibility with existing device driver code. ACPICA BZ 824. + +Removed the unused UINT32_STRUCT type, and the obsolete Integer64 field in +the parse tree object. + +Added additional warning options for the gcc-4 generation. Updated the source +accordingly. This includes some code restructuring to eliminate unreachable +code, elimination of some gotos, elimination of unused return values, some +additional casting, and removal of redundant declarations. + +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: 87.0K Code, 18.0K Data, 105.0K Total + Debug Version: 163.4K Code, 50.8K Data, 214.2K Total + Current Release: + Non-Debug Version: 87.1K Code, 18.0K Data, 105.1K Total + Debug Version: 163.5K Code, 50.9K Data, 214.4K Total + +2) iASL Compiler/Disassembler and Tools: + +No functional changes for this release. + ---------------------------------------- 14 December 2009. Summary of changes for version 20091214: -This release is available at www.acpica.org/downloads - 1) ACPI CA Core Subsystem: Enhanced automatic data type conversions for predefined name repairs. This @@ -68,8 +116,6 @@ depend on a specific initial value for a region or field. ---------------------------------------- 12 November 2009. Summary of changes for version 20091112: -This release is available at www.acpica.org/downloads - 1) ACPI CA Core Subsystem: Implemented a post-order callback to AcpiWalkNamespace. The existing @@ -141,8 +187,6 @@ level set very high. ---------------------------------------- 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 @@ -1037,9 +1081,6 @@ header. 29 July 2008. Summary of changes for version 20080729: -This release is available at http://acpica.org/downloads -Direct git access via http://www.acpica.org/repos/acpica.git - 1) ACPI CA Core Subsystem: Fix a possible deadlock in the GPE dispatch. Remove call to @@ -1129,9 +1170,6 @@ completion message. Previously, no message was displayed in this case. ---------------------------------------- 01 July 2008. Summary of changes for version 20080701: -This release is available at http://acpica.org/downloads -Direct git access via http://www.acpica.org/repos/acpica.git - 0) Git source tree / acpica.org Fixed a problem where a git-clone from http would not transfer the entire diff --git a/common/adfile.c b/common/adfile.c index b5a6afcd3fe3..c7f3dfb47602 100644 --- a/common/adfile.c +++ b/common/adfile.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/common/adisasm.c b/common/adisasm.c index 63c56840b483..093cfe5536eb 100644 --- a/common/adisasm.c +++ b/common/adisasm.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/common/adwalk.c b/common/adwalk.c index e69eadb2df09..09411faeec0e 100644 --- a/common/adwalk.c +++ b/common/adwalk.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/common/dmextern.c b/common/dmextern.c index 74dc65a3a528..29b15d805e94 100644 --- a/common/dmextern.c +++ b/common/dmextern.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/common/dmrestag.c b/common/dmrestag.c index e314b318af87..97f6c476e575 100644 --- a/common/dmrestag.c +++ b/common/dmrestag.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/common/dmtable.c b/common/dmtable.c index 0c83a4e99931..dd82016fef9e 100644 --- a/common/dmtable.c +++ b/common/dmtable.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/common/dmtbdump.c b/common/dmtbdump.c index e2dd8090fa16..30d86708ce97 100644 --- a/common/dmtbdump.c +++ b/common/dmtbdump.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/common/dmtbinfo.c b/common/dmtbinfo.c index 832914905d9f..805c81f65347 100644 --- a/common/dmtbinfo.c +++ b/common/dmtbinfo.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/common/getopt.c b/common/getopt.c index d675583fd9ff..db1eb167d1f3 100644 --- a/common/getopt.c +++ b/common/getopt.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/compiler/aslanalyze.c b/compiler/aslanalyze.c index d44adda8ff00..4cbfcd6e0681 100644 --- a/compiler/aslanalyze.c +++ b/compiler/aslanalyze.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -667,8 +667,8 @@ AnCheckForReservedName ( { /* The next two characters must be hex digits */ - if ((isxdigit (Name[2])) && - (isxdigit (Name[3]))) + if ((isxdigit ((int) Name[2])) && + (isxdigit ((int) Name[3]))) { return (ACPI_EVENT_RESERVED_NAME); } @@ -1236,7 +1236,7 @@ AnMethodAnalysisWalkBegin ( */ for (i = 0; Next->Asl.Value.String[i]; i++) { - if (!isalnum (Next->Asl.Value.String[i])) + if (!isalnum ((int) Next->Asl.Value.String[i])) { AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING, Next, Next->Asl.Value.String); @@ -2157,7 +2157,7 @@ AnOtherSemanticAnalysisWalkBegin ( */ if (((ArgNode->Asl.ParseOpcode == PARSEOP_WORDCONST) || (ArgNode->Asl.ParseOpcode == PARSEOP_INTEGER)) && - (ArgNode->Asl.Value.Integer >= (ACPI_INTEGER) ACPI_WAIT_FOREVER)) + (ArgNode->Asl.Value.Integer >= (UINT64) ACPI_WAIT_FOREVER)) { break; } diff --git a/compiler/aslcodegen.c b/compiler/aslcodegen.c index af3f292e3f23..dcd6997003ab 100644 --- a/compiler/aslcodegen.c +++ b/compiler/aslcodegen.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/compiler/aslcompile.c b/compiler/aslcompile.c index bdff08c8965d..90e90991b7e9 100644 --- a/compiler/aslcompile.c +++ b/compiler/aslcompile.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/compiler/aslcompiler.h b/compiler/aslcompiler.h index 2678c596a25f..76bf51a8b95d 100644 --- a/compiler/aslcompiler.h +++ b/compiler/aslcompiler.h @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -511,7 +511,7 @@ TrCreateLeafNode ( ACPI_PARSE_OBJECT * TrCreateValuedLeafNode ( UINT32 ParseOpcode, - ACPI_INTEGER Value); + UINT64 Value); ACPI_PARSE_OBJECT * TrLinkChildren ( @@ -718,7 +718,7 @@ UtCheckIntegerRange ( UINT32 LowValue, UINT32 HighValue); -ACPI_INTEGER +UINT64 UtDoConstant ( char *String); diff --git a/compiler/aslcompiler.l b/compiler/aslcompiler.l index d64dbf6a0a96..dd0473c75717 100644 --- a/compiler/aslcompiler.l +++ b/compiler/aslcompiler.l @@ -10,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/compiler/aslcompiler.y b/compiler/aslcompiler.y index 1d89f2c508a6..3c12a3dfc344 100644 --- a/compiler/aslcompiler.y +++ b/compiler/aslcompiler.y @@ -10,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -2388,7 +2388,7 @@ QWordConstExpr ConstExprTerm : PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);} | PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);} - | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_INTEGER_MAX);} + | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);} ; /* OptionalCount must appear before ByteList or an incorrect reduction will result */ diff --git a/compiler/asldefine.h b/compiler/asldefine.h index aeb368fa06b8..75345a5d7f4b 100644 --- a/compiler/asldefine.h +++ b/compiler/asldefine.h @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -127,7 +127,7 @@ #define IntelAcpiCA "Intel ACPI Component Architecture" #define CompilerId "ASL Optimizing Compiler" #define DisassemblerId "AML Disassembler" -#define CompilerCopyright "Copyright (C) 2000 - 2009 Intel Corporation" +#define CompilerCopyright "Copyright (c) 2000 - 2010 Intel Corporation" #define CompilerCompliance "Supports ACPI Specification Revision 4.0" #define CompilerName "iasl" #define CompilerCreatorId "INTL" diff --git a/compiler/aslerror.c b/compiler/aslerror.c index 5aa9e8c36a26..f90df3807f72 100644 --- a/compiler/aslerror.c +++ b/compiler/aslerror.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -169,13 +169,7 @@ AeAddToErrorLog ( ASL_ERROR_MSG *Prev; - if (!Gbl_ErrorLog) - { - Gbl_ErrorLog = Enode; - return; - } - - /* List is sorted according to line number */ + /* If Gbl_ErrorLog is null, this is the first error node */ if (!Gbl_ErrorLog) { @@ -183,8 +177,10 @@ AeAddToErrorLog ( return; } - /* Walk error list until we find a line number greater than ours */ - + /* + * Walk error list until we find a line number greater than ours. + * List is sorted according to line number. + */ Prev = NULL; Next = Gbl_ErrorLog; diff --git a/compiler/aslfiles.c b/compiler/aslfiles.c index 3d24ab397088..ebf59a408e8b 100644 --- a/compiler/aslfiles.c +++ b/compiler/aslfiles.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/compiler/aslfold.c b/compiler/aslfold.c index 4bb305ef1c50..c0644aa2a99b 100644 --- a/compiler/aslfold.c +++ b/compiler/aslfold.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/compiler/aslglobal.h b/compiler/aslglobal.h index 6aecfb6fb4f5..69fcf8438a1e 100644 --- a/compiler/aslglobal.h +++ b/compiler/aslglobal.h @@ -10,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -165,7 +165,6 @@ ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_LineBufPtr, Gbl_Curren ASL_EXTERN ASL_ERROR_MSG ASL_INIT_GLOBAL (*Gbl_ErrorLog,NULL); ASL_EXTERN ASL_ERROR_MSG ASL_INIT_GLOBAL (*Gbl_NextError,NULL); -extern UINT32 Gbl_ExceptionCount[]; /* Option flags */ @@ -278,5 +277,12 @@ ASL_EXTERN char MsgBuffer[ASL_MSG_BUFFER_SIZE]; ASL_EXTERN char StringBuffer[ASL_MSG_BUFFER_SIZE]; ASL_EXTERN char StringBuffer2[ASL_MSG_BUFFER_SIZE]; + +#ifdef _DECLARE_GLOBALS +UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0}; +#else +extern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS]; +#endif + #endif /* __ASLGLOBAL_H */ diff --git a/compiler/asllength.c b/compiler/asllength.c index bd222e68f4b1..5a9d1ce60380 100644 --- a/compiler/asllength.c +++ b/compiler/asllength.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/compiler/asllisting.c b/compiler/asllisting.c index f229d5fb7819..c4253c2e115f 100644 --- a/compiler/asllisting.c +++ b/compiler/asllisting.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/compiler/aslload.c b/compiler/aslload.c index fab67ccca95c..5e9fa1ba15c5 100644 --- a/compiler/aslload.c +++ b/compiler/aslload.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -534,7 +534,7 @@ LdNamespace1Begin ( if (Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC) { Status = LdLoadResourceElements (Op, WalkState); - goto Exit; + return_ACPI_STATUS (Status); } ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); @@ -578,7 +578,7 @@ LdNamespace1Begin ( AslCoreSubsystemError (Op, Status, "Failure from namespace lookup", FALSE); - goto Exit; + return_ACPI_STATUS (Status); } /* We found a node with this name, now check the type */ @@ -713,15 +713,14 @@ LdNamespace1Begin ( AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Op, Op->Asl.ExternalName); - Status = AE_OK; - goto Exit; + return_ACPI_STATUS (AE_OK); } } else { AslCoreSubsystemError (Op, Status, "Failure from namespace lookup", FALSE); - goto Exit; + return_ACPI_STATUS (Status); } } @@ -759,8 +758,7 @@ LdNamespace1Begin ( Node->Value = (UINT32) Op->Asl.Extra; } -Exit: - return (Status); + return_ACPI_STATUS (Status); } diff --git a/compiler/asllookup.c b/compiler/asllookup.c index b99d03787798..2c1253d2d4b6 100644 --- a/compiler/asllookup.c +++ b/compiler/asllookup.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/compiler/aslmain.c b/compiler/aslmain.c index aa29ab82f85b..45d7252c0a2f 100644 --- a/compiler/aslmain.c +++ b/compiler/aslmain.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -165,9 +165,6 @@ static int AslDoResponseFile ( char *Filename); -extern int AcpiGbl_Opterr; -extern int AcpiGbl_Optind; - #define ASL_TOKEN_SEPARATORS " \t\n" #define ASL_SUPPORTED_OPTIONS "@:2b:cd^e:fgh^i^I:l^o:p:r:s:t:v:w:x:" diff --git a/compiler/aslmap.c b/compiler/aslmap.c index 4c1fdf0c6f2d..6b3019a72680 100644 --- a/compiler/aslmap.c +++ b/compiler/aslmap.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/compiler/aslopcodes.c b/compiler/aslopcodes.c index e38626642794..1c6eef724804 100644 --- a/compiler/aslopcodes.c +++ b/compiler/aslopcodes.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -328,7 +328,7 @@ OpcSetOptimalIntegerSize ( } break; - case ACPI_INTEGER_MAX: + case ACPI_UINT64_MAX: /* Check for table integer width (32 or 64) */ @@ -568,7 +568,7 @@ OpcDoEisaId ( if (i < 3) { - if (!isupper (InString[i])) + if (!isupper ((int) InString[i])) { Status = AE_BAD_PARAMETER; } @@ -576,7 +576,7 @@ OpcDoEisaId ( /* Last 4 characters must be hex digits */ - else if (!isxdigit (InString[i])) + else if (!isxdigit ((int) InString[i])) { Status = AE_BAD_PARAMETER; } @@ -666,7 +666,7 @@ OpcDoUuId ( } else { - if (!isxdigit (InString[i])) + if (!isxdigit ((int) InString[i])) { Status = AE_BAD_PARAMETER; } diff --git a/compiler/asloperands.c b/compiler/asloperands.c index 8f2388e365bd..bf6dcf2cba57 100644 --- a/compiler/asloperands.c +++ b/compiler/asloperands.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -604,7 +604,7 @@ OpnDoRegion ( } else { - Op->Asl.Value.Integer = ACPI_INTEGER_MAX; + Op->Asl.Value.Integer = ACPI_UINT64_MAX; } } @@ -1007,7 +1007,7 @@ OpnDoDefinitionBlock ( for (i = 0; i < 4; i++) { - if (!isalnum (Gbl_TableSignature[i])) + if (!isalnum ((int) Gbl_TableSignature[i])) { AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child, "Contains non-alphanumeric characters"); diff --git a/compiler/aslopt.c b/compiler/aslopt.c index 3013f4cbd240..6f0b756c0f81 100644 --- a/compiler/aslopt.c +++ b/compiler/aslopt.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/compiler/aslresource.c b/compiler/aslresource.c index ceebd9c1e8d3..421fde3a3671 100644 --- a/compiler/aslresource.c +++ b/compiler/aslresource.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -184,7 +184,7 @@ RsCreateBitField ( { Op->Asl.ExternalName = Name; - Op->Asl.Value.Integer = ((ACPI_INTEGER) ByteOffset * 8) + BitOffset; + Op->Asl.Value.Integer = ((UINT64) ByteOffset * 8) + BitOffset; Op->Asl.CompileFlags |= (NODE_IS_RESOURCE_FIELD | NODE_IS_BIT_OFFSET); } diff --git a/compiler/aslrestype1.c b/compiler/aslrestype1.c index edc84054039e..1dbff0310fd8 100644 --- a/compiler/aslrestype1.c +++ b/compiler/aslrestype1.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/compiler/aslrestype2.c b/compiler/aslrestype2.c index 7074a5576eca..7ca8eeb70c8c 100644 --- a/compiler/aslrestype2.c +++ b/compiler/aslrestype2.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/compiler/aslstartup.c b/compiler/aslstartup.c index 87e102bd9ee0..ea61c9e392a4 100644 --- a/compiler/aslstartup.c +++ b/compiler/aslstartup.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/compiler/aslstubs.c b/compiler/aslstubs.c index b352a68a9dcd..66e3c0cce0d8 100644 --- a/compiler/aslstubs.c +++ b/compiler/aslstubs.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/compiler/asltransform.c b/compiler/asltransform.c index b6b22c52ec60..5327a907231c 100644 --- a/compiler/asltransform.c +++ b/compiler/asltransform.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -554,7 +554,7 @@ TrDoSwitch ( NewOp = NewOp2; NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, - (ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName)); + (UINT64) ACPI_TO_INTEGER (PredicateValueName)); NewOp->Asl.Next = NewOp2; TrAmlInitLineNumbers (NewOp2, Predicate); @@ -612,7 +612,7 @@ TrDoSwitch ( * CaseOp->Child->Peer is the beginning of the case block */ NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, - (ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName)); + (UINT64) ACPI_TO_INTEGER (PredicateValueName)); NewOp->Asl.Next = Predicate; TrAmlInitLineNumbers (NewOp, Predicate); @@ -761,7 +761,7 @@ TrDoSwitch ( /* Create the NameSeg child for the Name node */ NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESEG, - (ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName)); + (UINT64) ACPI_TO_INTEGER (PredicateValueName)); NewOp2->Asl.CompileFlags |= NODE_IS_NAME_DECLARATION; NewOp->Asl.Child = NewOp2; @@ -771,22 +771,22 @@ TrDoSwitch ( { case ACPI_BTYPE_INTEGER: NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_ZERO, - (ACPI_INTEGER) 0); + (UINT64) 0); break; case ACPI_BTYPE_STRING: NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, - (ACPI_INTEGER) ACPI_TO_INTEGER ("")); + (UINT64) ACPI_TO_INTEGER ("")); break; case ACPI_BTYPE_BUFFER: (void) TrLinkPeerNode (NewOp2, TrCreateValuedLeafNode (PARSEOP_BUFFER, - (ACPI_INTEGER) 0)); + (UINT64) 0)); Next = NewOp2->Asl.Next; (void) TrLinkChildren (Next, 1, TrCreateValuedLeafNode (PARSEOP_ZERO, - (ACPI_INTEGER) 1)); + (UINT64) 1)); (void) TrLinkPeerNode (Next->Asl.Child, - TrCreateValuedLeafNode (PARSEOP_DEFAULT_ARG, (ACPI_INTEGER) 0)); + TrCreateValuedLeafNode (PARSEOP_DEFAULT_ARG, (UINT64) 0)); TrAmlSetSubtreeParent (Next->Asl.Child, Next); break; @@ -821,7 +821,7 @@ TrDoSwitch ( Predicate->Asl.Parent = StoreOp; NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG, - (ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName)); + (UINT64) ACPI_TO_INTEGER (PredicateValueName)); NewOp->Asl.Parent = StoreOp; Predicate->Asl.Next = NewOp; diff --git a/compiler/asltree.c b/compiler/asltree.c index 30f59ee46d85..1167f51bec71 100644 --- a/compiler/asltree.c +++ b/compiler/asltree.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -490,7 +490,7 @@ TrCreateLeafNode ( ACPI_PARSE_OBJECT * TrCreateValuedLeafNode ( UINT32 ParseOpcode, - ACPI_INTEGER Value) + UINT64 Value) { ACPI_PARSE_OBJECT *Op; diff --git a/compiler/asltypes.h b/compiler/asltypes.h index 0500ba9d3776..9e1d426d2b75 100644 --- a/compiler/asltypes.h +++ b/compiler/asltypes.h @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -571,11 +571,6 @@ char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = { #define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings above */ -/* Exception counters */ - -UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0}; - -#endif - +#endif /* ASL_EXCEPTIONS */ #endif /* __ASLTYPES_H */ diff --git a/compiler/aslutils.c b/compiler/aslutils.c index ecba7c32cf9b..01db90a3066c 100644 --- a/compiler/aslutils.c +++ b/compiler/aslutils.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -142,7 +142,7 @@ static ACPI_STATUS UtStrtoul64 ( char *String, UINT32 Base, - ACPI_INTEGER *RetInteger); + UINT64 *RetInteger); static void UtPadNameWithUnderscores ( @@ -846,12 +846,12 @@ UtAttachNamepathToOwner ( * ******************************************************************************/ -ACPI_INTEGER +UINT64 UtDoConstant ( char *String) { ACPI_STATUS Status; - ACPI_INTEGER Converted; + UINT64 Converted; char ErrBuf[64]; @@ -888,11 +888,11 @@ static ACPI_STATUS UtStrtoul64 ( char *String, UINT32 Base, - ACPI_INTEGER *RetInteger) + UINT64 *RetInteger) { UINT32 Index; UINT32 Sign; - ACPI_INTEGER ReturnValue = 0; + UINT64 ReturnValue = 0; ACPI_STATUS Status = AE_OK; @@ -916,7 +916,7 @@ UtStrtoul64 ( /* Skip over any white space in the buffer: */ - while (isspace (*String) || *String == '\t') + while (isspace ((int) *String) || *String == '\t') { ++String; } @@ -948,7 +948,7 @@ UtStrtoul64 ( { if (*String == '0') { - if (tolower (*(++String)) == 'x') + if (tolower ((int) *(++String)) == 'x') { Base = 16; ++String; @@ -975,7 +975,7 @@ UtStrtoul64 ( if (Base == 16 && *String == '0' && - tolower (*(++String)) == 'x') + tolower ((int) *(++String)) == 'x') { String++; } @@ -984,14 +984,14 @@ UtStrtoul64 ( while (*String) { - if (isdigit (*String)) + if (isdigit ((int) *String)) { Index = ((UINT8) *String) - '0'; } else { - Index = (UINT8) toupper (*String); - if (isupper ((char) Index)) + Index = (UINT8) toupper ((int) *String); + if (isupper ((int) Index)) { Index = Index - 'A' + 10; } @@ -1008,8 +1008,8 @@ UtStrtoul64 ( /* Check to see if value is out of range: */ - if (ReturnValue > ((ACPI_INTEGER_MAX - (ACPI_INTEGER) Index) / - (ACPI_INTEGER) Base)) + if (ReturnValue > ((ACPI_UINT64_MAX - (UINT64) Index) / + (UINT64) Base)) { goto ErrorExit; } diff --git a/debugger/dbcmds.c b/debugger/dbcmds.c index 0a542d952f45..50a8b2e037e3 100644 --- a/debugger/dbcmds.c +++ b/debugger/dbcmds.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/debugger/dbdisply.c b/debugger/dbdisply.c index fbcb8f10d39a..7c04ffca8bc0 100644 --- a/debugger/dbdisply.c +++ b/debugger/dbdisply.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/debugger/dbexec.c b/debugger/dbexec.c index 7990890fc056..da21a12589c5 100644 --- a/debugger/dbexec.c +++ b/debugger/dbexec.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -243,7 +243,7 @@ AcpiDbExecuteMethod ( default: Params[i].Type = ACPI_TYPE_INTEGER; - Params[i].Integer.Value = i * (ACPI_INTEGER) 0x1000; + Params[i].Integer.Value = i * (UINT64) 0x1000; break; } } @@ -484,7 +484,7 @@ AcpiDbExecute ( * Allow any handlers in separate threads to complete. * (Such as Notify handlers invoked from AML executed above). */ - AcpiOsSleep ((ACPI_INTEGER) 10); + AcpiOsSleep ((UINT64) 10); #ifdef ACPI_DEBUG_OUTPUT diff --git a/debugger/dbfileio.c b/debugger/dbfileio.c index d52a72caa6a5..c6f2e253accf 100644 --- a/debugger/dbfileio.c +++ b/debugger/dbfileio.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -150,9 +150,6 @@ AcpiDbCheckTextModeCorruption ( UINT32 TableLength, UINT32 FileLength); -static ACPI_STATUS -AeLocalLoadTable ( - ACPI_TABLE_HEADER *TablePtr); #endif /******************************************************************************* @@ -424,7 +421,7 @@ AcpiDbReadTable ( { /* Now validate the checksum */ - Status = AcpiTbChecksum ((void *) *Table, + Status = AcpiTbVerifyChecksum ((void *) *Table, ACPI_CAST_PTR (ACPI_TABLE_HEADER, *Table)->Length); if (Status == AE_BAD_CHECKSUM) diff --git a/debugger/dbhistry.c b/debugger/dbhistry.c index e8e8a76bf104..613711e0fd23 100644 --- a/debugger/dbhistry.c +++ b/debugger/dbhistry.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/debugger/dbinput.c b/debugger/dbinput.c index 74b2dca6edd7..29b51b6d7523 100644 --- a/debugger/dbinput.c +++ b/debugger/dbinput.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/debugger/dbstats.c b/debugger/dbstats.c index 63a62ecbef8b..ace8263734ea 100644 --- a/debugger/dbstats.c +++ b/debugger/dbstats.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/debugger/dbutils.c b/debugger/dbutils.c index 15799eb7b4c9..19ff3f02a2ae 100644 --- a/debugger/dbutils.c +++ b/debugger/dbutils.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/debugger/dbxface.c b/debugger/dbxface.c index f3f7a4474601..1c0557ac3151 100644 --- a/debugger/dbxface.c +++ b/debugger/dbxface.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/disassembler/dmbuffer.c b/disassembler/dmbuffer.c index 5a4d1742f3e4..b9222f95336f 100644 --- a/disassembler/dmbuffer.c +++ b/disassembler/dmbuffer.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/disassembler/dmnames.c b/disassembler/dmnames.c index b09d3d35f503..bdfa15ac9e22 100644 --- a/disassembler/dmnames.c +++ b/disassembler/dmnames.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/disassembler/dmobject.c b/disassembler/dmobject.c index 0f569922addb..6156caed5952 100644 --- a/disassembler/dmobject.c +++ b/disassembler/dmobject.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/disassembler/dmopcode.c b/disassembler/dmopcode.c index 931ef6c0db89..bbc3a2d27f8f 100644 --- a/disassembler/dmopcode.c +++ b/disassembler/dmopcode.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -473,8 +473,8 @@ AcpiDmDisassembleOneOp ( case AML_QWORD_OP: - AcpiOsPrintf ("0x%8.8X%8.8X", Op->Common.Value.Integer64.Hi, - Op->Common.Value.Integer64.Lo); + AcpiOsPrintf ("0x%8.8X%8.8X", + ACPI_FORMAT_UINT64 (Op->Common.Value.Integer)); break; diff --git a/disassembler/dmresrc.c b/disassembler/dmresrc.c index f0fc4b1bd614..12bde688d4c9 100644 --- a/disassembler/dmresrc.c +++ b/disassembler/dmresrc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/disassembler/dmresrcl.c b/disassembler/dmresrcl.c index b1b86db2f321..d8a549b58cfd 100644 --- a/disassembler/dmresrcl.c +++ b/disassembler/dmresrcl.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/disassembler/dmresrcs.c b/disassembler/dmresrcs.c index 50898527fbce..6af288b1e8f8 100644 --- a/disassembler/dmresrcs.c +++ b/disassembler/dmresrcs.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/disassembler/dmutils.c b/disassembler/dmutils.c index 111c785ceea1..7eea82ed5f9e 100644 --- a/disassembler/dmutils.c +++ b/disassembler/dmutils.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/disassembler/dmwalk.c b/disassembler/dmwalk.c index 85477fede960..f460e6ac3f9e 100644 --- a/disassembler/dmwalk.c +++ b/disassembler/dmwalk.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/dispatcher/dsfield.c b/dispatcher/dsfield.c index 12d55f40c432..8453c8808711 100644 --- a/dispatcher/dsfield.c +++ b/dispatcher/dsfield.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -314,7 +314,7 @@ AcpiDsGetFieldNames ( ACPI_PARSE_OBJECT *Arg) { ACPI_STATUS Status; - ACPI_INTEGER Position; + UINT64 Position; ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info); @@ -338,8 +338,8 @@ AcpiDsGetFieldNames ( { case AML_INT_RESERVEDFIELD_OP: - Position = (ACPI_INTEGER) Info->FieldBitPosition - + (ACPI_INTEGER) Arg->Common.Value.Size; + Position = (UINT64) Info->FieldBitPosition + + (UINT64) Arg->Common.Value.Size; if (Position > ACPI_UINT32_MAX) { @@ -406,8 +406,8 @@ AcpiDsGetFieldNames ( /* Keep track of bit position for the next field */ - Position = (ACPI_INTEGER) Info->FieldBitPosition - + (ACPI_INTEGER) Arg->Common.Value.Size; + Position = (UINT64) Info->FieldBitPosition + + (UINT64) Arg->Common.Value.Size; if (Position > ACPI_UINT32_MAX) { diff --git a/dispatcher/dsinit.c b/dispatcher/dsinit.c index efea20e83d35..4525a0bc4fe4 100644 --- a/dispatcher/dsinit.c +++ b/dispatcher/dsinit.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/dispatcher/dsmethod.c b/dispatcher/dsmethod.c index 48172e962e29..29153b0754a0 100644 --- a/dispatcher/dsmethod.c +++ b/dispatcher/dsmethod.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/dispatcher/dsmthdat.c b/dispatcher/dsmthdat.c index 551e8480a984..128308286ca1 100644 --- a/dispatcher/dsmthdat.c +++ b/dispatcher/dsmthdat.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/dispatcher/dsobject.c b/dispatcher/dsobject.c index cf444a1df2bc..2796f66c70f4 100644 --- a/dispatcher/dsobject.c +++ b/dispatcher/dsobject.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -787,7 +787,7 @@ AcpiDsInitObjectFromOp ( case AML_ONES_OP: - ObjDesc->Integer.Value = ACPI_INTEGER_MAX; + ObjDesc->Integer.Value = ACPI_UINT64_MAX; /* Truncate value if we are executing from a 32-bit ACPI table */ diff --git a/dispatcher/dsopcode.c b/dispatcher/dsopcode.c index 3edbacc1d956..328a350092a5 100644 --- a/dispatcher/dsopcode.c +++ b/dispatcher/dsopcode.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/dispatcher/dsutils.c b/dispatcher/dsutils.c index 6c211ace8c60..8eb8b3dbbd6f 100644 --- a/dispatcher/dsutils.c +++ b/dispatcher/dsutils.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/dispatcher/dswexec.c b/dispatcher/dswexec.c index 9485c62bb1c0..d4b3f0c9280c 100644 --- a/dispatcher/dswexec.c +++ b/dispatcher/dswexec.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/dispatcher/dswload.c b/dispatcher/dswload.c index 48c4ae6f163a..1a02f9f1c868 100644 --- a/dispatcher/dswload.c +++ b/dispatcher/dswload.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/dispatcher/dswscope.c b/dispatcher/dswscope.c index 023f9ef6662e..5ab611ec67ef 100644 --- a/dispatcher/dswscope.c +++ b/dispatcher/dswscope.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/dispatcher/dswstate.c b/dispatcher/dswstate.c index f0962bf53f1f..ffe2895fa8e7 100644 --- a/dispatcher/dswstate.c +++ b/dispatcher/dswstate.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/events/evevent.c b/events/evevent.c index 16f40271fcf1..05cc4cd8b739 100644 --- a/events/evevent.c +++ b/events/evevent.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/events/evgpe.c b/events/evgpe.c index 17738b384040..de1f861d5d92 100644 --- a/events/evgpe.c +++ b/events/evgpe.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/events/evgpeblk.c b/events/evgpeblk.c index c86f80aa7f54..10f48a5d9139 100644 --- a/events/evgpeblk.c +++ b/events/evgpeblk.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/events/evmisc.c b/events/evmisc.c index 1e7f9e1cb56d..62f549d1cadf 100644 --- a/events/evmisc.c +++ b/events/evmisc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/events/evregion.c b/events/evregion.c index 2bdfb872fe0b..f3e10bec8b44 100644 --- a/events/evregion.c +++ b/events/evregion.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -442,7 +442,7 @@ AcpiEvExecuteRegMethod ( * RegionOffset - Where in the region to read or write * BitWidth - Field width in bits (8, 16, 32, or 64) * Value - Pointer to in or out value, must be - * full 64-bit ACPI_INTEGER + * a full 64-bit integer * * RETURN: Status * @@ -457,7 +457,7 @@ AcpiEvAddressSpaceDispatch ( UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, - ACPI_INTEGER *Value) + UINT64 *Value) { ACPI_STATUS Status; ACPI_ADR_SPACE_HANDLER Handler; diff --git a/events/evrgnini.c b/events/evrgnini.c index 67f6cddf66d8..8a6cbfd94155 100644 --- a/events/evrgnini.c +++ b/events/evrgnini.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -260,7 +260,7 @@ AcpiEvPciConfigRegionSetup ( void **RegionContext) { ACPI_STATUS Status = AE_OK; - ACPI_INTEGER PciValue; + UINT64 PciValue; ACPI_PCI_ID *PciId = *RegionContext; ACPI_OPERAND_OBJECT *HandlerObj; ACPI_NAMESPACE_NODE *ParentNode; diff --git a/events/evsci.c b/events/evsci.c index cde433ce3ee5..ec622d4f825b 100644 --- a/events/evsci.c +++ b/events/evsci.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/events/evxface.c b/events/evxface.c index 6eb5a14af068..3ca00215e84e 100644 --- a/events/evxface.c +++ b/events/evxface.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/events/evxfevnt.c b/events/evxfevnt.c index 27066a399468..886096153c72 100644 --- a/events/evxfevnt.c +++ b/events/evxfevnt.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/events/evxfregn.c b/events/evxfregn.c index 3b60589b71a4..365174fb68bc 100644 --- a/events/evxfregn.c +++ b/events/evxfregn.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/executer/exconfig.c b/executer/exconfig.c index d0acdd5f8030..034afb65c34d 100644 --- a/executer/exconfig.c +++ b/executer/exconfig.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -387,7 +387,7 @@ AcpiExRegionRead ( UINT8 *Buffer) { ACPI_STATUS Status; - ACPI_INTEGER Value; + UINT64 Value; UINT32 RegionOffset = 0; UINT32 i; @@ -610,7 +610,10 @@ AcpiExLoadOp ( Status = AcpiTbAddTable (&TableDesc, &TableIndex); if (ACPI_FAILURE (Status)) { - goto Cleanup; + /* Delete allocated table buffer */ + + AcpiTbDeleteTable (&TableDesc); + return_ACPI_STATUS (Status); } /* @@ -653,13 +656,6 @@ AcpiExLoadOp ( AcpiGbl_TableHandlerContext); } -Cleanup: - if (ACPI_FAILURE (Status)) - { - /* Delete allocated table buffer */ - - AcpiTbDeleteTable (&TableDesc); - } return_ACPI_STATUS (Status); } diff --git a/executer/exconvrt.c b/executer/exconvrt.c index fd8fec1c711e..2e154d1202ae 100644 --- a/executer/exconvrt.c +++ b/executer/exconvrt.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -129,7 +129,7 @@ static UINT32 AcpiExConvertToAscii ( - ACPI_INTEGER Integer, + UINT64 Integer, UINT16 Base, UINT8 *String, UINT8 MaxLength); @@ -158,7 +158,7 @@ AcpiExConvertToInteger ( { ACPI_OPERAND_OBJECT *ReturnDesc; UINT8 *Pointer; - ACPI_INTEGER Result; + UINT64 Result; UINT32 i; UINT32 Count; ACPI_STATUS Status; @@ -247,7 +247,7 @@ AcpiExConvertToInteger ( * Little endian is used, meaning that the first byte of the buffer * is the LSB of the integer */ - Result |= (((ACPI_INTEGER) Pointer[i]) << (i * 8)); + Result |= (((UINT64) Pointer[i]) << (i * 8)); } break; @@ -389,12 +389,12 @@ AcpiExConvertToBuffer ( static UINT32 AcpiExConvertToAscii ( - ACPI_INTEGER Integer, + UINT64 Integer, UINT16 Base, UINT8 *String, UINT8 DataWidth) { - ACPI_INTEGER Digit; + UINT64 Digit; UINT32 i; UINT32 j; UINT32 k = 0; @@ -659,7 +659,7 @@ AcpiExConvertToString ( for (i = 0; i < ObjDesc->Buffer.Length; i++) { NewBuf += AcpiExConvertToAscii ( - (ACPI_INTEGER) ObjDesc->Buffer.Pointer[i], Base, + (UINT64) ObjDesc->Buffer.Pointer[i], Base, NewBuf, 1); *NewBuf++ = Separator; /* each separated by a comma or space */ } diff --git a/executer/excreate.c b/executer/excreate.c index e5463187a865..728603e49c28 100644 --- a/executer/excreate.c +++ b/executer/excreate.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/executer/exdump.c b/executer/exdump.c index 5de5a6f6e403..5ef9fe83c77a 100644 --- a/executer/exdump.c +++ b/executer/exdump.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/executer/exfield.c b/executer/exfield.c index 503e8e6b370b..5657ea88479a 100644 --- a/executer/exfield.c +++ b/executer/exfield.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -217,7 +217,7 @@ AcpiExReadDataFromField ( /* Call the region handler for the read */ Status = AcpiExAccessRegion (ObjDesc, 0, - ACPI_CAST_PTR (ACPI_INTEGER, BufferDesc->Buffer.Pointer), + ACPI_CAST_PTR (UINT64, BufferDesc->Buffer.Pointer), Function); AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags); goto Exit; @@ -226,7 +226,7 @@ AcpiExReadDataFromField ( /* * Allocate a buffer for the contents of the field. * - * If the field is larger than the size of an ACPI_INTEGER, create + * If the field is larger than the current integer width, create * a BUFFER to hold it. Otherwise, use an INTEGER. This allows * the use of arithmetic operators on the returned value if the * field size is equal or smaller than an Integer. @@ -408,7 +408,7 @@ AcpiExWriteDataToField ( * same buffer) */ Status = AcpiExAccessRegion (ObjDesc, 0, - (ACPI_INTEGER *) Buffer, Function); + (UINT64 *) Buffer, Function); AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags); *ResultDesc = BufferDesc; diff --git a/executer/exfldio.c b/executer/exfldio.c index 37a678655172..403cb069446d 100644 --- a/executer/exfldio.c +++ b/executer/exfldio.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -133,13 +133,13 @@ static ACPI_STATUS AcpiExFieldDatumIo ( ACPI_OPERAND_OBJECT *ObjDesc, UINT32 FieldDatumByteOffset, - ACPI_INTEGER *Value, + UINT64 *Value, UINT32 ReadWrite); static BOOLEAN AcpiExRegisterOverflow ( ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_INTEGER Value); + UINT64 Value); static ACPI_STATUS AcpiExSetupRegion ( @@ -296,7 +296,7 @@ AcpiExSetupRegion ( * FieldDatumByteOffset - Byte offset of this datum within the * parent field * Value - Where to store value (must at least - * the size of ACPI_INTEGER) + * 64 bits) * Function - Read or Write flag plus other region- * dependent flags * @@ -310,7 +310,7 @@ ACPI_STATUS AcpiExAccessRegion ( ACPI_OPERAND_OBJECT *ObjDesc, UINT32 FieldDatumByteOffset, - ACPI_INTEGER *Value, + UINT64 *Value, UINT32 Function) { ACPI_STATUS Status; @@ -408,7 +408,7 @@ AcpiExAccessRegion ( static BOOLEAN AcpiExRegisterOverflow ( ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_INTEGER Value) + UINT64 Value) { if (ObjDesc->CommonField.BitLength >= ACPI_INTEGER_BIT_SIZE) @@ -420,7 +420,7 @@ AcpiExRegisterOverflow ( return (FALSE); } - if (Value >= ((ACPI_INTEGER) 1 << ObjDesc->CommonField.BitLength)) + if (Value >= ((UINT64) 1 << ObjDesc->CommonField.BitLength)) { /* * The Value is larger than the maximum value that can fit into @@ -457,11 +457,11 @@ static ACPI_STATUS AcpiExFieldDatumIo ( ACPI_OPERAND_OBJECT *ObjDesc, UINT32 FieldDatumByteOffset, - ACPI_INTEGER *Value, + UINT64 *Value, UINT32 ReadWrite) { ACPI_STATUS Status; - ACPI_INTEGER LocalValue; + UINT64 LocalValue; ACPI_FUNCTION_TRACE_U32 (ExFieldDatumIo, FieldDatumByteOffset); @@ -543,7 +543,7 @@ AcpiExFieldDatumIo ( * the register */ if (AcpiExRegisterOverflow (ObjDesc->BankField.BankObj, - (ACPI_INTEGER) ObjDesc->BankField.Value)) + (UINT64) ObjDesc->BankField.Value)) { return_ACPI_STATUS (AE_AML_REGISTER_LIMIT); } @@ -586,7 +586,7 @@ AcpiExFieldDatumIo ( * the register */ if (AcpiExRegisterOverflow (ObjDesc->IndexField.IndexObj, - (ACPI_INTEGER) ObjDesc->IndexField.Value)) + (UINT64) ObjDesc->IndexField.Value)) { return_ACPI_STATUS (AE_AML_REGISTER_LIMIT); } @@ -615,7 +615,7 @@ AcpiExFieldDatumIo ( "Read from Data Register\n")); Status = AcpiExExtractFromField (ObjDesc->IndexField.DataObj, - Value, sizeof (ACPI_INTEGER)); + Value, sizeof (UINT64)); } else { @@ -626,7 +626,7 @@ AcpiExFieldDatumIo ( ACPI_FORMAT_UINT64 (*Value))); Status = AcpiExInsertIntoField (ObjDesc->IndexField.DataObj, - Value, sizeof (ACPI_INTEGER)); + Value, sizeof (UINT64)); } break; @@ -679,13 +679,13 @@ AcpiExFieldDatumIo ( ACPI_STATUS AcpiExWriteWithUpdateRule ( ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_INTEGER Mask, - ACPI_INTEGER FieldValue, + UINT64 Mask, + UINT64 FieldValue, UINT32 FieldDatumByteOffset) { ACPI_STATUS Status = AE_OK; - ACPI_INTEGER MergedValue; - ACPI_INTEGER CurrentValue; + UINT64 MergedValue; + UINT64 CurrentValue; ACPI_FUNCTION_TRACE_U32 (ExWriteWithUpdateRule, Mask); @@ -697,7 +697,7 @@ AcpiExWriteWithUpdateRule ( /* If the mask is all ones, we don't need to worry about the update rule */ - if (Mask != ACPI_INTEGER_MAX) + if (Mask != ACPI_UINT64_MAX) { /* Decode the update rule */ @@ -787,8 +787,8 @@ AcpiExExtractFromField ( UINT32 BufferLength) { ACPI_STATUS Status; - ACPI_INTEGER RawDatum; - ACPI_INTEGER MergedDatum; + UINT64 RawDatum; + UINT64 MergedDatum; UINT32 FieldOffset = 0; UINT32 BufferOffset = 0; UINT32 BufferTailBits; @@ -917,10 +917,10 @@ AcpiExInsertIntoField ( UINT32 BufferLength) { ACPI_STATUS Status; - ACPI_INTEGER Mask; - ACPI_INTEGER WidthMask; - ACPI_INTEGER MergedDatum; - ACPI_INTEGER RawDatum = 0; + UINT64 Mask; + UINT64 WidthMask; + UINT64 MergedDatum; + UINT64 RawDatum = 0; UINT32 FieldOffset = 0; UINT32 BufferOffset = 0; UINT32 BufferTailBits; @@ -972,7 +972,7 @@ AcpiExInsertIntoField ( */ if (ObjDesc->CommonField.AccessBitWidth == ACPI_INTEGER_BIT_SIZE) { - WidthMask = ACPI_INTEGER_MAX; + WidthMask = ACPI_UINT64_MAX; } else { diff --git a/executer/exmisc.c b/executer/exmisc.c index 41e4a9752ecb..54cb1f0019f2 100644 --- a/executer/exmisc.c +++ b/executer/exmisc.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -508,11 +508,11 @@ AcpiExDoConcatenate ( * ******************************************************************************/ -ACPI_INTEGER +UINT64 AcpiExDoMathOp ( UINT16 Opcode, - ACPI_INTEGER Integer0, - ACPI_INTEGER Integer1) + UINT64 Integer0, + UINT64 Integer1) { ACPI_FUNCTION_ENTRY (); @@ -615,8 +615,8 @@ AcpiExDoMathOp ( ACPI_STATUS AcpiExDoLogicalNumericOp ( UINT16 Opcode, - ACPI_INTEGER Integer0, - ACPI_INTEGER Integer1, + UINT64 Integer0, + UINT64 Integer1, BOOLEAN *LogicalResult) { ACPI_STATUS Status = AE_OK; @@ -690,8 +690,8 @@ AcpiExDoLogicalOp ( BOOLEAN *LogicalResult) { ACPI_OPERAND_OBJECT *LocalOperand1 = Operand1; - ACPI_INTEGER Integer0; - ACPI_INTEGER Integer1; + UINT64 Integer0; + UINT64 Integer1; UINT32 Length0; UINT32 Length1; ACPI_STATUS Status = AE_OK; diff --git a/executer/exmutex.c b/executer/exmutex.c index 8b1bebf1e917..d0aa9deda282 100644 --- a/executer/exmutex.c +++ b/executer/exmutex.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/executer/exnames.c b/executer/exnames.c index 89fa2d4874d6..a0ee8a5dbd65 100644 --- a/executer/exnames.c +++ b/executer/exnames.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/executer/exoparg1.c b/executer/exoparg1.c index 4a90b9c9506d..b7ee459685d9 100644 --- a/executer/exoparg1.c +++ b/executer/exoparg1.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -368,8 +368,8 @@ AcpiExOpcode_1A_1T_1R ( ACPI_OPERAND_OBJECT *ReturnDesc2 = NULL; UINT32 Temp32; UINT32 i; - ACPI_INTEGER PowerOfTen; - ACPI_INTEGER Digit; + UINT64 PowerOfTen; + UINT64 Digit; ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_1T_1R, @@ -477,7 +477,7 @@ AcpiExOpcode_1A_1T_1R ( /* Sum the digit into the result with the current power of 10 */ ReturnDesc->Integer.Value += - (((ACPI_INTEGER) Temp32) * PowerOfTen); + (((UINT64) Temp32) * PowerOfTen); /* Shift to next BCD digit */ @@ -506,7 +506,7 @@ AcpiExOpcode_1A_1T_1R ( * remainder from above */ ReturnDesc->Integer.Value |= - (((ACPI_INTEGER) Temp32) << ACPI_MUL_4 (i)); + (((UINT64) Temp32) << ACPI_MUL_4 (i)); } /* Overflow if there is any data left in Digit */ @@ -553,7 +553,7 @@ AcpiExOpcode_1A_1T_1R ( /* The object exists in the namespace, return TRUE */ - ReturnDesc->Integer.Value = ACPI_INTEGER_MAX; + ReturnDesc->Integer.Value = ACPI_UINT64_MAX; goto Cleanup; @@ -719,7 +719,7 @@ AcpiExOpcode_1A_0T_1R ( ACPI_OPERAND_OBJECT *ReturnDesc = NULL; ACPI_STATUS Status = AE_OK; UINT32 Type; - ACPI_INTEGER Value; + UINT64 Value; ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_0T_1R, @@ -745,7 +745,7 @@ AcpiExOpcode_1A_0T_1R ( */ if (!Operand[0]->Integer.Value) { - ReturnDesc->Integer.Value = ACPI_INTEGER_MAX; + ReturnDesc->Integer.Value = ACPI_UINT64_MAX; } break; diff --git a/executer/exoparg2.c b/executer/exoparg2.c index 7c42652cc4cb..81eda0e191b0 100644 --- a/executer/exoparg2.c +++ b/executer/exoparg2.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -383,7 +383,7 @@ AcpiExOpcode_2A_1T_1R ( { ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; ACPI_OPERAND_OBJECT *ReturnDesc = NULL; - ACPI_INTEGER Index; + UINT64 Index; ACPI_STATUS Status = AE_OK; ACPI_SIZE Length; @@ -716,7 +716,7 @@ AcpiExOpcode_2A_0T_1R ( */ if (LogicalResult) { - ReturnDesc->Integer.Value = ACPI_INTEGER_MAX; + ReturnDesc->Integer.Value = ACPI_UINT64_MAX; } Cleanup: diff --git a/executer/exoparg3.c b/executer/exoparg3.c index 591d6aceb121..923337cd2737 100644 --- a/executer/exoparg3.c +++ b/executer/exoparg3.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -239,7 +239,7 @@ AcpiExOpcode_3A_1T_1R ( ACPI_OPERAND_OBJECT *ReturnDesc = NULL; char *Buffer = NULL; ACPI_STATUS Status = AE_OK; - ACPI_INTEGER Index; + UINT64 Index; ACPI_SIZE Length; diff --git a/executer/exoparg6.c b/executer/exoparg6.c index c2609471dd7c..5b35710c9a1e 100644 --- a/executer/exoparg6.c +++ b/executer/exoparg6.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -305,7 +305,7 @@ AcpiExOpcode_6A_0T_1R ( ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; ACPI_OPERAND_OBJECT *ReturnDesc = NULL; ACPI_STATUS Status = AE_OK; - ACPI_INTEGER Index; + UINT64 Index; ACPI_OPERAND_OBJECT *ThisElement; @@ -344,9 +344,9 @@ AcpiExOpcode_6A_0T_1R ( } /* Create an integer for the return value */ - /* Default return value is ACPI_INTEGER_MAX if no match found */ + /* Default return value is ACPI_UINT64_MAX if no match found */ - ReturnDesc = AcpiUtCreateIntegerObject (ACPI_INTEGER_MAX); + ReturnDesc = AcpiUtCreateIntegerObject (ACPI_UINT64_MAX); if (!ReturnDesc) { Status = AE_NO_MEMORY; @@ -362,7 +362,7 @@ AcpiExOpcode_6A_0T_1R ( * * Upon finding a match, the loop will terminate via "break" at * the bottom. If it terminates "normally", MatchValue will be - * ACPI_INTEGER_MAX (Ones) (its initial value) indicating that no + * ACPI_UINT64_MAX (Ones) (its initial value) indicating that no * match was found. */ for ( ; Index < Operand[0]->Package.Count; Index++) diff --git a/executer/exprep.c b/executer/exprep.c index c915361e810d..d6b144bf848f 100644 --- a/executer/exprep.c +++ b/executer/exprep.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/executer/exregion.c b/executer/exregion.c index 5a37be25950e..f551f1768770 100644 --- a/executer/exregion.c +++ b/executer/exregion.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -149,7 +149,7 @@ AcpiExSystemMemorySpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -198,7 +198,7 @@ AcpiExSystemMemorySpaceHandler ( * Hardware does not support non-aligned data transfers, we must verify * the request. */ - (void) AcpiUtShortDivide ((ACPI_INTEGER) Address, Length, NULL, &Remainder); + (void) AcpiUtShortDivide ((UINT64) Address, Length, NULL, &Remainder); if (Remainder != 0) { return_ACPI_STATUS (AE_AML_ALIGNMENT); @@ -211,8 +211,8 @@ AcpiExSystemMemorySpaceHandler ( * 2) Address beyond the current mapping? */ if ((Address < MemInfo->MappedPhysicalAddress) || - (((ACPI_INTEGER) Address + Length) > - ((ACPI_INTEGER) + (((UINT64) Address + Length) > + ((UINT64) MemInfo->MappedPhysicalAddress + MemInfo->MappedLength))) { /* @@ -282,7 +282,7 @@ AcpiExSystemMemorySpaceHandler ( * access */ LogicalAddrPtr = MemInfo->MappedLogicalAddress + - ((ACPI_INTEGER) Address - (ACPI_INTEGER) MemInfo->MappedPhysicalAddress); + ((UINT64) Address - (UINT64) MemInfo->MappedPhysicalAddress); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "System-Memory (width %d) R/W %d Address=%8.8X%8.8X\n", @@ -304,19 +304,19 @@ AcpiExSystemMemorySpaceHandler ( switch (BitWidth) { case 8: - *Value = (ACPI_INTEGER) ACPI_GET8 (LogicalAddrPtr); + *Value = (UINT64) ACPI_GET8 (LogicalAddrPtr); break; case 16: - *Value = (ACPI_INTEGER) ACPI_GET16 (LogicalAddrPtr); + *Value = (UINT64) ACPI_GET16 (LogicalAddrPtr); break; case 32: - *Value = (ACPI_INTEGER) ACPI_GET32 (LogicalAddrPtr); + *Value = (UINT64) ACPI_GET32 (LogicalAddrPtr); break; case 64: - *Value = (ACPI_INTEGER) ACPI_GET64 (LogicalAddrPtr); + *Value = (UINT64) ACPI_GET64 (LogicalAddrPtr); break; default: @@ -383,7 +383,7 @@ AcpiExSystemIoSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -447,7 +447,7 @@ AcpiExPciConfigSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -527,7 +527,7 @@ AcpiExCmosSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -564,7 +564,7 @@ AcpiExPciBarSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -601,7 +601,7 @@ AcpiExDataTableSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { diff --git a/executer/exresnte.c b/executer/exresnte.c index 5481bc899a85..a4922c0b7172 100644 --- a/executer/exresnte.c +++ b/executer/exresnte.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/executer/exresolv.c b/executer/exresolv.c index a3c8ab9b5cee..f78c119aedcb 100644 --- a/executer/exresolv.c +++ b/executer/exresolv.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/executer/exresop.c b/executer/exresop.c index ecc63f61357d..ed60d2a42af6 100644 --- a/executer/exresop.c +++ b/executer/exresop.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/executer/exstore.c b/executer/exstore.c index 8ec8a23cffd7..5ff117586799 100644 --- a/executer/exstore.c +++ b/executer/exstore.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/executer/exstoren.c b/executer/exstoren.c index 0810560d39c0..22ccbbf6d4c6 100644 --- a/executer/exstoren.c +++ b/executer/exstoren.c @@ -10,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/executer/exstorob.c b/executer/exstorob.c index b2f125d01fba..0649fdf69878 100644 --- a/executer/exstorob.c +++ b/executer/exstorob.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/executer/exsystem.c b/executer/exsystem.c index 19674606a601..9f4583fc1383 100644 --- a/executer/exsystem.c +++ b/executer/exsystem.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -293,7 +293,7 @@ AcpiExSystemDoStall ( ACPI_STATUS AcpiExSystemDoSuspend ( - ACPI_INTEGER HowLong) + UINT64 HowLong) { ACPI_FUNCTION_ENTRY (); diff --git a/executer/exutils.c b/executer/exutils.c index 1f5e861b68cb..d8815aa517bb 100644 --- a/executer/exutils.c +++ b/executer/exutils.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -144,7 +144,7 @@ static UINT32 AcpiExDigitsNeeded ( - ACPI_INTEGER Value, + UINT64 Value, UINT32 Base); @@ -334,7 +334,7 @@ AcpiExTruncateFor32bitTable ( * We are running a method that exists in a 32-bit ACPI table. * Truncate the value to 32 bits by zeroing out the upper 32-bit field */ - ObjDesc->Integer.Value &= (ACPI_INTEGER) ACPI_UINT32_MAX; + ObjDesc->Integer.Value &= (UINT64) ACPI_UINT32_MAX; } } @@ -446,17 +446,17 @@ AcpiExReleaseGlobalLock ( static UINT32 AcpiExDigitsNeeded ( - ACPI_INTEGER Value, + UINT64 Value, UINT32 Base) { UINT32 NumDigits; - ACPI_INTEGER CurrentValue; + UINT64 CurrentValue; ACPI_FUNCTION_TRACE (ExDigitsNeeded); - /* ACPI_INTEGER is unsigned, so we don't worry about a '-' prefix */ + /* UINT64 is unsigned, so we don't worry about a '-' prefix */ if (Value == 0) { @@ -497,7 +497,7 @@ AcpiExDigitsNeeded ( void AcpiExEisaIdToString ( char *OutString, - ACPI_INTEGER CompressedId) + UINT64 CompressedId) { UINT32 SwappedId; @@ -523,10 +523,10 @@ AcpiExEisaIdToString ( OutString[0] = (char) (0x40 + (((unsigned long) SwappedId >> 26) & 0x1F)); OutString[1] = (char) (0x40 + ((SwappedId >> 21) & 0x1F)); OutString[2] = (char) (0x40 + ((SwappedId >> 16) & 0x1F)); - OutString[3] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) SwappedId, 12); - OutString[4] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) SwappedId, 8); - OutString[5] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) SwappedId, 4); - OutString[6] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) SwappedId, 0); + OutString[3] = AcpiUtHexToAsciiChar ((UINT64) SwappedId, 12); + OutString[4] = AcpiUtHexToAsciiChar ((UINT64) SwappedId, 8); + OutString[5] = AcpiUtHexToAsciiChar ((UINT64) SwappedId, 4); + OutString[6] = AcpiUtHexToAsciiChar ((UINT64) SwappedId, 0); OutString[7] = 0; } @@ -551,7 +551,7 @@ AcpiExEisaIdToString ( void AcpiExIntegerToString ( char *OutString, - ACPI_INTEGER Value) + UINT64 Value) { UINT32 Count; UINT32 DigitsNeeded; diff --git a/hardware/hwacpi.c b/hardware/hwacpi.c index 6b6d90ee02e7..fb88f9663a46 100644 --- a/hardware/hwacpi.c +++ b/hardware/hwacpi.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/hardware/hwgpe.c b/hardware/hwgpe.c index a45603d9d5fb..24e741e11a1a 100644 --- a/hardware/hwgpe.c +++ b/hardware/hwgpe.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -320,7 +320,7 @@ AcpiHwGetGpeStatus ( Status = AcpiHwRead (&InByte, &GpeRegisterInfo->StatusAddress); if (ACPI_FAILURE (Status)) { - goto UnlockAndExit; + return (Status); } if (RegisterBit & InByte) @@ -331,10 +331,7 @@ AcpiHwGetGpeStatus ( /* Set return value */ (*EventStatus) = LocalEventStatus; - - -UnlockAndExit: - return (Status); + return (AE_OK); } diff --git a/hardware/hwregs.c b/hardware/hwregs.c index 163840d7f4ad..60ca92cc8143 100644 --- a/hardware/hwregs.c +++ b/hardware/hwregs.c @@ -10,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/hardware/hwsleep.c b/hardware/hwsleep.c index fed4f1ddbf71..ad6ad1e796f0 100644 --- a/hardware/hwsleep.c +++ b/hardware/hwsleep.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/hardware/hwtimer.c b/hardware/hwtimer.c index f86fb7f865e1..2675dadf353e 100644 --- a/hardware/hwtimer.c +++ b/hardware/hwtimer.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -232,7 +232,7 @@ AcpiGetTimerDuration ( { ACPI_STATUS Status; UINT32 DeltaTicks; - ACPI_INTEGER Quotient; + UINT64 Quotient; ACPI_FUNCTION_TRACE (AcpiGetTimerDuration); diff --git a/hardware/hwvalid.c b/hardware/hwvalid.c index 650b695b2cc5..905dc7950f04 100644 --- a/hardware/hwvalid.c +++ b/hardware/hwvalid.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/hardware/hwxface.c b/hardware/hwxface.c index 6c345a593e1c..9ef6286bdbad 100644 --- a/hardware/hwxface.c +++ b/hardware/hwxface.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/acapps.h b/include/acapps.h index c5ebef1d4afd..418e20fb0840 100644 --- a/include/acapps.h +++ b/include/acapps.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -135,6 +135,7 @@ AcpiGetopt( char *opts); extern int AcpiGbl_Optind; +extern int AcpiGbl_Opterr; extern char *AcpiGbl_Optarg; @@ -231,11 +232,6 @@ FlSplitInputPathname ( char **OutDirectoryPath, char **OutFilename); -char * -FlGenerateFilename ( - char *InputFilename, - char *Suffix); - char * AdGenerateFilename ( char *Prefix, diff --git a/include/accommon.h b/include/accommon.h index 690d3cdba955..36026d768e60 100644 --- a/include/accommon.h +++ b/include/accommon.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/acconfig.h b/include/acconfig.h index 8fbe0e371b26..9417b449dc70 100644 --- a/include/acconfig.h +++ b/include/acconfig.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/acdebug.h b/include/acdebug.h index 82f2b6d49c15..2be2fd409b92 100644 --- a/include/acdebug.h +++ b/include/acdebug.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/acdisasm.h b/include/acdisasm.h index de198ff5742f..1fe077b059a1 100644 --- a/include/acdisasm.h +++ b/include/acdisasm.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/acdispat.h b/include/acdispat.h index 2aa86232b2f0..d7af8003df2b 100644 --- a/include/acdispat.h +++ b/include/acdispat.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/acevents.h b/include/acevents.h index 0cd5e2e28696..567ac1ec0e13 100644 --- a/include/acevents.h +++ b/include/acevents.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -265,7 +265,7 @@ AcpiEvAddressSpaceDispatch ( UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, - ACPI_INTEGER *Value); + UINT64 *Value); ACPI_STATUS AcpiEvAttachRegion ( diff --git a/include/acexcep.h b/include/acexcep.h index dfe2e2ee7342..89fe5c66898f 100644 --- a/include/acexcep.h +++ b/include/acexcep.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/acglobal.h b/include/acglobal.h index 82fe445169d4..4469ee334e3b 100644 --- a/include/acglobal.h +++ b/include/acglobal.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/achware.h b/include/achware.h index c171a5fc1df8..be0b4df327d8 100644 --- a/include/achware.h +++ b/include/achware.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/acinterp.h b/include/acinterp.h index 74c5f0b4ebae..de7dbf8030eb 100644 --- a/include/acinterp.h +++ b/include/acinterp.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -214,13 +214,13 @@ AcpiExCommonBufferSetup ( ACPI_STATUS AcpiExWriteWithUpdateRule ( ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_INTEGER Mask, - ACPI_INTEGER FieldValue, + UINT64 Mask, + UINT64 FieldValue, UINT32 FieldDatumByteOffset); void AcpiExGetBufferDatum( - ACPI_INTEGER *Datum, + UINT64 *Datum, void *Buffer, UINT32 BufferLength, UINT32 ByteGranularity, @@ -228,7 +228,7 @@ AcpiExGetBufferDatum( void AcpiExSetBufferDatum ( - ACPI_INTEGER MergedDatum, + UINT64 MergedDatum, void *Buffer, UINT32 BufferLength, UINT32 ByteGranularity, @@ -266,7 +266,7 @@ ACPI_STATUS AcpiExAccessRegion ( ACPI_OPERAND_OBJECT *ObjDesc, UINT32 FieldDatumByteOffset, - ACPI_INTEGER *Value, + UINT64 *Value, UINT32 ReadWrite); @@ -296,8 +296,8 @@ AcpiExDoConcatenate ( ACPI_STATUS AcpiExDoLogicalNumericOp ( UINT16 Opcode, - ACPI_INTEGER Integer0, - ACPI_INTEGER Integer1, + UINT64 Integer0, + UINT64 Integer1, BOOLEAN *LogicalResult); ACPI_STATUS @@ -307,11 +307,11 @@ AcpiExDoLogicalOp ( ACPI_OPERAND_OBJECT *Operand1, BOOLEAN *LogicalResult); -ACPI_INTEGER +UINT64 AcpiExDoMathOp ( UINT16 Opcode, - ACPI_INTEGER Operand0, - ACPI_INTEGER Operand1); + UINT64 Operand0, + UINT64 Operand1); ACPI_STATUS AcpiExCreateMutex ( @@ -425,7 +425,7 @@ AcpiExSystemDoNotifyOp ( ACPI_STATUS AcpiExSystemDoSuspend( - ACPI_INTEGER Time); + UINT64 Time); ACPI_STATUS AcpiExSystemDoStall ( @@ -697,12 +697,12 @@ AcpiExReleaseGlobalLock ( void AcpiExEisaIdToString ( char *Dest, - ACPI_INTEGER CompressedId); + UINT64 CompressedId); void AcpiExIntegerToString ( char *Dest, - ACPI_INTEGER Value); + UINT64 Value); /* @@ -713,7 +713,7 @@ AcpiExSystemMemorySpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -722,7 +722,7 @@ AcpiExSystemIoSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -731,7 +731,7 @@ AcpiExPciConfigSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -740,7 +740,7 @@ AcpiExCmosSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -749,7 +749,7 @@ AcpiExPciBarSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -758,7 +758,7 @@ AcpiExEmbeddedControllerSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -767,7 +767,7 @@ AcpiExSmBusSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -777,7 +777,7 @@ AcpiExDataTableSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); diff --git a/include/aclocal.h b/include/aclocal.h index 52dbec3a6dce..0aeacff6c525 100644 --- a/include/aclocal.h +++ b/include/aclocal.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -500,6 +500,7 @@ typedef struct acpi_predefined_data { char *Pathname; const ACPI_PREDEFINED_INFO *Predefined; + union acpi_operand_object *ParentPackage; UINT32 Flags; UINT8 NodeFlags; @@ -852,8 +853,7 @@ typedef struct acpi_opcode_info typedef union acpi_parse_value { - ACPI_INTEGER Integer; /* Integer constant (Up to 64 bits) */ - UINT64_STRUCT Integer64; /* Structure overlay for 2 32-bit Dwords */ + UINT64 Integer; /* Integer constant (Up to 64 bits) */ UINT32 Size; /* bytelist or field size */ char *String; /* NULL terminated string */ UINT8 *Buffer; /* buffer or string */ diff --git a/include/acmacros.h b/include/acmacros.h index 3d351f9fc85e..e9a6f42cbf21 100644 --- a/include/acmacros.h +++ b/include/acmacros.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -335,8 +335,8 @@ * MASK_BITS_ABOVE creates a mask starting AT the position and above * MASK_BITS_BELOW creates a mask starting one bit BELOW the position */ -#define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_INTEGER_MAX) << ((UINT32) (position)))) -#define ACPI_MASK_BITS_BELOW(position) ((ACPI_INTEGER_MAX) << ((UINT32) (position))) +#define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_UINT64_MAX) << ((UINT32) (position)))) +#define ACPI_MASK_BITS_BELOW(position) ((ACPI_UINT64_MAX) << ((UINT32) (position))) /* Bitfields within ACPI registers */ @@ -473,16 +473,16 @@ AcpiUtPtrExit (ACPI_DEBUG_PARAMETERS, (UINT8 *) _s); \ return (_s); }) #define return_VALUE(s) ACPI_DO_WHILE0 ({ \ - register ACPI_INTEGER _s = (s); \ + register UINT64 _s = (s); \ AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, _s); \ return (_s); }) #define return_UINT8(s) ACPI_DO_WHILE0 ({ \ register UINT8 _s = (UINT8) (s); \ - AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (ACPI_INTEGER) _s); \ + AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (UINT64) _s); \ return (_s); }) #define return_UINT32(s) ACPI_DO_WHILE0 ({ \ register UINT32 _s = (UINT32) (s); \ - AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (ACPI_INTEGER) _s); \ + AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (UINT64) _s); \ return (_s); }) #else /* Use original less-safe macros */ @@ -493,7 +493,7 @@ AcpiUtPtrExit (ACPI_DEBUG_PARAMETERS, (UINT8 *) (s)); \ return((s)); }) #define return_VALUE(s) ACPI_DO_WHILE0 ({ \ - AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (ACPI_INTEGER) (s)); \ + AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (UINT64) (s)); \ return((s)); }) #define return_UINT8(s) return_VALUE(s) #define return_UINT32(s) return_VALUE(s) diff --git a/include/acnames.h b/include/acnames.h index eb9944aa16e5..12dd89ce14d3 100644 --- a/include/acnames.h +++ b/include/acnames.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/acnamesp.h b/include/acnamesp.h index 65798662d596..9ddd12e210bc 100644 --- a/include/acnamesp.h +++ b/include/acnamesp.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -444,6 +444,19 @@ AcpiNsRepairPackageList ( ACPI_PREDEFINED_DATA *Data, ACPI_OPERAND_OBJECT **ObjDescPtr); +ACPI_STATUS +AcpiNsRepairNullElement ( + ACPI_PREDEFINED_DATA *Data, + UINT32 ExpectedBtypes, + UINT32 PackageIndex, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); + +void +AcpiNsRemoveNullElements ( + ACPI_PREDEFINED_DATA *Data, + UINT8 PackageType, + ACPI_OPERAND_OBJECT *ObjDesc); + /* * nsrepair2 - Return object repair for specific @@ -456,11 +469,6 @@ AcpiNsComplexRepairs ( ACPI_STATUS ValidateStatus, ACPI_OPERAND_OBJECT **ReturnObjectPtr); -void -AcpiNsRemoveNullElements ( - ACPI_PREDEFINED_DATA *Data, - UINT8 PackageType, - ACPI_OPERAND_OBJECT *ObjDesc); /* * nssearch - Namespace searching and entry diff --git a/include/acobject.h b/include/acobject.h index 76f623c83db8..f86f8392679f 100644 --- a/include/acobject.h +++ b/include/acobject.h @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -190,7 +190,7 @@ typedef struct acpi_object_integer { ACPI_OBJECT_COMMON_HEADER UINT8 Fill[3]; /* Prevent warning on some compilers */ - ACPI_INTEGER Value; + UINT64 Value; } ACPI_OBJECT_INTEGER; diff --git a/include/acopcode.h b/include/acopcode.h index bb309c78d3fe..94d585d2273c 100644 --- a/include/acopcode.h +++ b/include/acopcode.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/acoutput.h b/include/acoutput.h index 4f4b1d9c69dd..8018fed53842 100644 --- a/include/acoutput.h +++ b/include/acoutput.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/acparser.h b/include/acparser.h index 086688e3224d..35fe0060f1a2 100644 --- a/include/acparser.h +++ b/include/acparser.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/acpi.h b/include/acpi.h index ac0af0387bc9..fa7cec4568e6 100644 --- a/include/acpi.h +++ b/include/acpi.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/acpiosxf.h b/include/acpiosxf.h index 730057d1efac..0c22b63bb693 100644 --- a/include/acpiosxf.h +++ b/include/acpiosxf.h @@ -12,7 +12,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -346,7 +346,7 @@ AcpiOsWaitEventsComplete ( void AcpiOsSleep ( - ACPI_INTEGER Milliseconds); + UINT64 Milliseconds); void AcpiOsStall ( @@ -401,7 +401,7 @@ ACPI_STATUS AcpiOsWritePciConfiguration ( ACPI_PCI_ID *PciId, UINT32 Reg, - ACPI_INTEGER Value, + UINT64 Value, UINT32 Width); diff --git a/include/acpixf.h b/include/acpixf.h index a961009465a2..c67b8b9f4587 100644 --- a/include/acpixf.h +++ b/include/acpixf.h @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -120,7 +120,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20091214 +#define ACPI_CA_VERSION 0x20100121 #include "actypes.h" #include "actbl.h" diff --git a/include/acpredef.h b/include/acpredef.h index 2be401520b3d..9b881fb8007a 100644 --- a/include/acpredef.h +++ b/include/acpredef.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/acresrc.h b/include/acresrc.h index c70aa5e23d4d..323d040bd023 100644 --- a/include/acresrc.h +++ b/include/acresrc.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/acrestyp.h b/include/acrestyp.h index 7eb7600d9822..0a85d29f5a48 100644 --- a/include/acrestyp.h +++ b/include/acrestyp.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -534,7 +534,7 @@ typedef struct acpi_pci_routing_table { UINT32 Length; UINT32 Pin; - ACPI_INTEGER Address; /* here for 64-bit alignment */ + UINT64 Address; /* here for 64-bit alignment */ UINT32 SourceIndex; char Source[4]; /* pad to 64 bits so sizeof() works in all cases */ diff --git a/include/acstruct.h b/include/acstruct.h index 45c85fe0b2f1..d4696b83005d 100644 --- a/include/acstruct.h +++ b/include/acstruct.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/actables.h b/include/actables.h index e4428e641550..54fdaae9b1a7 100644 --- a/include/actables.h +++ b/include/actables.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/actbl.h b/include/actbl.h index caa3bdbe3b5c..c25ad50a575a 100644 --- a/include/actbl.h +++ b/include/actbl.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/actbl1.h b/include/actbl1.h index 8af7a1838086..ac11a3fe6b3e 100644 --- a/include/actbl1.h +++ b/include/actbl1.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/actbl2.h b/include/actbl2.h index e57c02356cc9..c96715d3c05e 100644 --- a/include/actbl2.h +++ b/include/actbl2.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/actypes.h b/include/actypes.h index 0e01b97bbe06..8d0d06ad62ce 100644 --- a/include/actypes.h +++ b/include/actypes.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -470,22 +470,7 @@ typedef union uint64_overlay } UINT64_OVERLAY; -typedef struct uint32_struct -{ - UINT32 Lo; - UINT32 Hi; -} UINT32_STRUCT; - - -/* - * Acpi integer width. In ACPI version 1, integers are 32 bits. In ACPI - * version 2, integers are 64 bits. Note that this pertains to the ACPI integer - * type only, not other integers used in the implementation of the ACPI CA - * subsystem. - */ -typedef UINT64 ACPI_INTEGER; -#define ACPI_INTEGER_MAX ACPI_UINT64_MAX #define ACPI_INTEGER_BIT_SIZE 64 #define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ #define ACPI_MAX64_DECIMAL_DIGITS 20 @@ -500,6 +485,19 @@ typedef UINT64 ACPI_INTEGER; #define ACPI_WAIT_FOREVER 0xFFFF /* UINT16, as per ACPI spec */ #define ACPI_DO_NOT_WAIT 0 +/* + * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are 32 bits. + * In ACPI version 2 (2000) and later, integers are 64 bits. Note that this + * pertains to the ACPI integer type only, not to other integers used in the + * implementation of the ACPICA subsystem. + * + * 01/2010: This type is obsolete and has been removed from the entire ACPICA + * code base. It remains here for compatibility with device drivers that use + * the type. However, it will be removed in the future. + */ +typedef UINT64 ACPI_INTEGER; +#define ACPI_INTEGER_MAX ACPI_UINT64_MAX + /******************************************************************************* * @@ -890,7 +888,7 @@ typedef union acpi_object struct { ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_INTEGER */ - ACPI_INTEGER Value; /* The actual number */ + UINT64 Value; /* The actual number */ } Integer; struct @@ -1094,7 +1092,7 @@ ACPI_STATUS (*ACPI_ADR_SPACE_HANDLER) ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -1164,7 +1162,7 @@ typedef struct acpi_device_info UINT8 HighestDstates[4]; /* _SxD values: 0xFF indicates not valid */ UINT8 LowestDstates[5]; /* _SxW values: 0xFF indicates not valid */ UINT32 CurrentStatus; /* _STA value */ - ACPI_INTEGER Address; /* _ADR value */ + UINT64 Address; /* _ADR value */ ACPI_DEVICE_ID HardwareId; /* _HID value */ ACPI_DEVICE_ID UniqueId; /* _UID value */ ACPI_DEVICE_ID_LIST CompatibleIdList; /* _CID list */ diff --git a/include/acutils.h b/include/acutils.h index 3e12b7ca3617..ae406c3882a0 100644 --- a/include/acutils.h +++ b/include/acutils.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -235,7 +235,7 @@ AcpiUtGetEventName ( char AcpiUtHexToAsciiChar ( - ACPI_INTEGER Integer, + UINT64 Integer, UINT32 Position); BOOLEAN @@ -470,7 +470,7 @@ AcpiUtValueExit ( const char *FunctionName, const char *ModuleName, UINT32 ComponentId, - ACPI_INTEGER Value); + UINT64 Value); void AcpiUtPtrExit ( @@ -550,7 +550,7 @@ ACPI_STATUS AcpiUtEvaluateNumericObject ( char *ObjectName, ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_INTEGER *Value); + UINT64 *Value); ACPI_STATUS AcpiUtExecute_STA ( @@ -720,16 +720,16 @@ AcpiUtDeleteGenericState ( */ ACPI_STATUS AcpiUtDivide ( - ACPI_INTEGER InDividend, - ACPI_INTEGER InDivisor, - ACPI_INTEGER *OutQuotient, - ACPI_INTEGER *OutRemainder); + UINT64 InDividend, + UINT64 InDivisor, + UINT64 *OutQuotient, + UINT64 *OutRemainder); ACPI_STATUS AcpiUtShortDivide ( - ACPI_INTEGER InDividend, + UINT64 InDividend, UINT32 Divisor, - ACPI_INTEGER *OutQuotient, + UINT64 *OutQuotient, UINT32 *OutRemainder); /* @@ -788,7 +788,7 @@ ACPI_STATUS AcpiUtStrtoul64 ( char *String, UINT32 Base, - ACPI_INTEGER *RetInteger); + UINT64 *RetInteger); void ACPI_INTERNAL_VAR_XFACE AcpiUtPredefinedWarning ( diff --git a/include/amlcode.h b/include/amlcode.h index 19740d9083c2..d6fc7d00ce3b 100644 --- a/include/amlcode.h +++ b/include/amlcode.h @@ -10,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/amlresrc.h b/include/amlresrc.h index 689564c6289e..9084e44540aa 100644 --- a/include/amlresrc.h +++ b/include/amlresrc.h @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/platform/accygwin.h b/include/platform/accygwin.h index e9585b44b109..6936024839ef 100644 --- a/include/platform/accygwin.h +++ b/include/platform/accygwin.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -155,6 +155,9 @@ #define inline #endif +#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) if (GLptr) Acq=1; else Acq=0; +#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = 1 + /* Cygwin uses GCC */ diff --git a/include/platform/acefi.h b/include/platform/acefi.h index 40afaa401cfa..5c900ef9cfc7 100644 --- a/include/platform/acefi.h +++ b/include/platform/acefi.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/platform/acenv.h b/include/platform/acenv.h index 58cb03bfc1a5..0567a003c6d1 100644 --- a/include/platform/acenv.h +++ b/include/platform/acenv.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -262,11 +262,11 @@ /* Global Lock acquire/release */ #ifndef ACPI_ACQUIRE_GLOBAL_LOCK -#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) Acq = 1 +#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acquired) Acquired = 1 #endif #ifndef ACPI_RELEASE_GLOBAL_LOCK -#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) Acq = 0 +#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = 0 #endif /* Flush CPU cache - used when going to sleep. Wbinvd or similar. */ @@ -424,8 +424,8 @@ typedef char *va_list; #define ACPI_MEMCMP(s1,s2,n) AcpiUtMemcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n)) #define ACPI_MEMCPY(d,s,n) (void) AcpiUtMemcpy ((d), (s), (ACPI_SIZE)(n)) #define ACPI_MEMSET(d,v,n) (void) AcpiUtMemset ((d), (v), (ACPI_SIZE)(n)) -#define ACPI_TOUPPER AcpiUtToUpper -#define ACPI_TOLOWER AcpiUtToLower +#define ACPI_TOUPPER(c) AcpiUtToUpper ((int) (c)) +#define ACPI_TOLOWER(c) AcpiUtToLower ((int) (c)) #endif /* ACPI_USE_SYSTEM_CLIBRARY */ diff --git a/include/platform/acfreebsd.h b/include/platform/acfreebsd.h index 20c5687c20b9..09ad54ae1b25 100644 --- a/include/platform/acfreebsd.h +++ b/include/platform/acfreebsd.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/platform/acgcc.h b/include/platform/acgcc.h index 449942278c99..d0098b1800ab 100644 --- a/include/platform/acgcc.h +++ b/include/platform/acgcc.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/platform/acintel.h b/include/platform/acintel.h index 44197a09946e..a7e75ec60313 100644 --- a/include/platform/acintel.h +++ b/include/platform/acintel.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/platform/aclinux.h b/include/platform/aclinux.h index c6f868cdbf95..9009689c938d 100644 --- a/include/platform/aclinux.h +++ b/include/platform/aclinux.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/platform/acmsvc.h b/include/platform/acmsvc.h index 0320e74d1e18..62e69d16dc1d 100644 --- a/include/platform/acmsvc.h +++ b/include/platform/acmsvc.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/platform/acnetbsd.h b/include/platform/acnetbsd.h index c04851b926a2..302d719f2a73 100644 --- a/include/platform/acnetbsd.h +++ b/include/platform/acnetbsd.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/platform/acos2.h b/include/platform/acos2.h index 21e3373c24de..90e6b2e4914c 100644 --- a/include/platform/acos2.h +++ b/include/platform/acos2.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/platform/acwin.h b/include/platform/acwin.h index d1fa2ee22b94..583f677b4751 100644 --- a/include/platform/acwin.h +++ b/include/platform/acwin.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/include/platform/acwin64.h b/include/platform/acwin64.h index faec855e22d8..64c1f99702a6 100644 --- a/include/platform/acwin64.h +++ b/include/platform/acwin64.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/namespace/nsaccess.c b/namespace/nsaccess.c index 2bc7d8d71182..86f412a9c897 100644 --- a/namespace/nsaccess.c +++ b/namespace/nsaccess.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/namespace/nsalloc.c b/namespace/nsalloc.c index 9693cb7835a1..aadafbf7818b 100644 --- a/namespace/nsalloc.c +++ b/namespace/nsalloc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/namespace/nsdump.c b/namespace/nsdump.c index d799f7c64ce9..a0dd59e3d203 100644 --- a/namespace/nsdump.c +++ b/namespace/nsdump.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/namespace/nsdumpdv.c b/namespace/nsdumpdv.c index fbb66a616759..deabaaee03e0 100644 --- a/namespace/nsdumpdv.c +++ b/namespace/nsdumpdv.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/namespace/nseval.c b/namespace/nseval.c index 07af96ed93dc..200a95708901 100644 --- a/namespace/nseval.c +++ b/namespace/nseval.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/namespace/nsinit.c b/namespace/nsinit.c index b36fa6c7ea96..770235e8e33d 100644 --- a/namespace/nsinit.c +++ b/namespace/nsinit.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/namespace/nsload.c b/namespace/nsload.c index a9f3824718bc..bf20ac5f0671 100644 --- a/namespace/nsload.c +++ b/namespace/nsload.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/namespace/nsnames.c b/namespace/nsnames.c index c00a4457b2a8..9423d561b71a 100644 --- a/namespace/nsnames.c +++ b/namespace/nsnames.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/namespace/nsobject.c b/namespace/nsobject.c index c0163f4ea244..af5df1983eb7 100644 --- a/namespace/nsobject.c +++ b/namespace/nsobject.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/namespace/nsparse.c b/namespace/nsparse.c index 58301560ae06..52cbc975992f 100644 --- a/namespace/nsparse.c +++ b/namespace/nsparse.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/namespace/nspredef.c b/namespace/nspredef.c index d979c43e93f9..ef76930b51f3 100644 --- a/namespace/nspredef.c +++ b/namespace/nspredef.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -329,6 +329,7 @@ AcpiNsCheckPredefinedNames ( */ if ((*ReturnObjectPtr)->Common.Type == ACPI_TYPE_PACKAGE) { + Data->ParentPackage = *ReturnObjectPtr; Status = AcpiNsCheckPackage (Data, ReturnObjectPtr); if (ACPI_FAILURE (Status)) { @@ -831,6 +832,7 @@ AcpiNsCheckPackageList ( { SubPackage = *Elements; SubElements = SubPackage->Package.Elements; + Data->ParentPackage = SubPackage; /* Each sub-object must be of type Package */ @@ -843,6 +845,7 @@ AcpiNsCheckPackageList ( /* Examine the different types of expected sub-packages */ + Data->ParentPackage = SubPackage; switch (Package->RetInfo.Type) { case ACPI_PTYPE2: @@ -919,7 +922,7 @@ AcpiNsCheckPackageList ( /* * First element is the (Integer) count of elements, including - * the count field. + * the count field (the ACPI name is NumElements) */ Status = AcpiNsCheckObjectType (Data, SubElements, ACPI_RTYPE_INTEGER, 0); @@ -942,6 +945,17 @@ AcpiNsCheckPackageList ( ExpectedCount = Package->RetInfo.Count1; goto PackageTooSmall; } + if (ExpectedCount == 0) + { + /* + * Either the NumEntries element was originally zero or it was + * a NULL element and repaired to an Integer of value zero. + * In either case, repair it by setting NumEntries to be the + * actual size of the subpackage. + */ + ExpectedCount = SubPackage->Package.Count; + (*SubElements)->Integer.Value = ExpectedCount; + } /* Check the type of each sub-package element */ @@ -1076,11 +1090,19 @@ AcpiNsCheckObjectType ( /* - * If we get a NULL ReturnObject here, it is a NULL package element, - * and this is always an error. + * If we get a NULL ReturnObject here, it is a NULL package element. + * Since all extraneous NULL package elements were removed earlier by a + * call to AcpiNsRemoveNullElements, this is an unexpected NULL element. + * We will attempt to repair it. */ if (!ReturnObject) { + Status = AcpiNsRepairNullElement (Data, ExpectedBtypes, + PackageIndex, ReturnObjectPtr); + if (ACPI_SUCCESS (Status)) + { + return (AE_OK); /* Repair was successful */ + } goto TypeErrorExit; } @@ -1133,28 +1155,27 @@ AcpiNsCheckObjectType ( /* Is the object one of the expected types? */ - if (!(ReturnBtype & ExpectedBtypes)) + if (ReturnBtype & ExpectedBtypes) { - /* Type mismatch -- attempt repair of the returned object */ + /* For reference objects, check that the reference type is correct */ - Status = AcpiNsRepairObject (Data, ExpectedBtypes, - PackageIndex, ReturnObjectPtr); - if (ACPI_SUCCESS (Status)) + if (ReturnObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) { - return (AE_OK); /* Repair was successful */ + Status = AcpiNsCheckReference (Data, ReturnObject); } - goto TypeErrorExit; + + return (Status); } - /* For reference objects, check that the reference type is correct */ + /* Type mismatch -- attempt repair of the returned object */ - if (ReturnObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) + Status = AcpiNsRepairObject (Data, ExpectedBtypes, + PackageIndex, ReturnObjectPtr); + if (ACPI_SUCCESS (Status)) { - Status = AcpiNsCheckReference (Data, ReturnObject); + return (AE_OK); /* Repair was successful */ } - return (Status); - TypeErrorExit: diff --git a/namespace/nsrepair.c b/namespace/nsrepair.c index 5c402df36b56..76d62bf7a0a5 100644 --- a/namespace/nsrepair.c +++ b/namespace/nsrepair.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -119,6 +119,7 @@ #include "accommon.h" #include "acnamesp.h" #include "acinterp.h" +#include "acpredef.h" #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsrepair") @@ -146,6 +147,12 @@ * Buffer -> Package of Integers * Package -> Package of one Package * + * Additional possible repairs: + * + * Optional/unnecessary NULL package elements removed + * Required package elements that are NULL replaced by Integer/String/Buffer + * Incorrect standalone package wrapped with required outer package + * ******************************************************************************/ @@ -627,6 +634,189 @@ AcpiNsConvertToPackage ( } +/******************************************************************************* + * + * FUNCTION: AcpiNsRepairNullElement + * + * PARAMETERS: Data - Pointer to validation data structure + * ExpectedBtypes - Object types expected + * PackageIndex - Index of object within parent package (if + * applicable - ACPI_NOT_PACKAGE_ELEMENT + * otherwise) + * ReturnObjectPtr - Pointer to the object returned from the + * evaluation of a method or object + * + * RETURN: Status. AE_OK if repair was successful. + * + * DESCRIPTION: Attempt to repair a NULL element of a returned Package object. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiNsRepairNullElement ( + ACPI_PREDEFINED_DATA *Data, + UINT32 ExpectedBtypes, + UINT32 PackageIndex, + ACPI_OPERAND_OBJECT **ReturnObjectPtr) +{ + ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; + ACPI_OPERAND_OBJECT *NewObject; + + + ACPI_FUNCTION_NAME (NsRepairNullElement); + + + /* No repair needed if return object is non-NULL */ + + if (ReturnObject) + { + return (AE_OK); + } + + /* + * Attempt to repair a NULL element of a Package object. This applies to + * predefined names that return a fixed-length package and each element + * is required. It does not apply to variable-length packages where NULL + * elements are allowed, especially at the end of the package. + */ + if (ExpectedBtypes & ACPI_RTYPE_INTEGER) + { + /* Need an Integer - create a zero-value integer */ + + NewObject = AcpiUtCreateIntegerObject (0); + } + else if (ExpectedBtypes & ACPI_RTYPE_STRING) + { + /* Need a String - create a NULL string */ + + NewObject = AcpiUtCreateStringObject (0); + } + else if (ExpectedBtypes & ACPI_RTYPE_BUFFER) + { + /* Need a Buffer - create a zero-length buffer */ + + NewObject = AcpiUtCreateBufferObject (0); + } + else + { + /* Error for all other expected types */ + + return (AE_AML_OPERAND_TYPE); + } + + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + /* Set the reference count according to the parent Package object */ + + NewObject->Common.ReferenceCount = Data->ParentPackage->Common.ReferenceCount; + + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Converted NULL package element to expected %s at index %u\n", + Data->Pathname, AcpiUtGetObjectTypeName (NewObject), PackageIndex)); + + *ReturnObjectPtr = NewObject; + Data->Flags |= ACPI_OBJECT_REPAIRED; + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiNsRemoveNullElements + * + * PARAMETERS: Data - Pointer to validation data structure + * PackageType - An AcpiReturnPackageTypes value + * ObjDesc - A Package object + * + * RETURN: None. + * + * DESCRIPTION: Remove all NULL package elements from packages that contain + * a variable number of sub-packages. For these types of + * packages, NULL elements can be safely removed. + * + *****************************************************************************/ + +void +AcpiNsRemoveNullElements ( + ACPI_PREDEFINED_DATA *Data, + UINT8 PackageType, + ACPI_OPERAND_OBJECT *ObjDesc) +{ + ACPI_OPERAND_OBJECT **Source; + ACPI_OPERAND_OBJECT **Dest; + UINT32 Count; + UINT32 NewCount; + UINT32 i; + + + ACPI_FUNCTION_NAME (NsRemoveNullElements); + + + /* + * PTYPE1 packages contain no subpackages. + * PTYPE2 packages contain a variable number of sub-packages. We can + * safely remove all NULL elements from the PTYPE2 packages. + */ + switch (PackageType) + { + case ACPI_PTYPE1_FIXED: + case ACPI_PTYPE1_VAR: + case ACPI_PTYPE1_OPTION: + return; + + case ACPI_PTYPE2: + case ACPI_PTYPE2_COUNT: + case ACPI_PTYPE2_PKG_COUNT: + case ACPI_PTYPE2_FIXED: + case ACPI_PTYPE2_MIN: + case ACPI_PTYPE2_REV_FIXED: + break; + + default: + return; + } + + Count = ObjDesc->Package.Count; + NewCount = Count; + + Source = ObjDesc->Package.Elements; + Dest = Source; + + /* Examine all elements of the package object, remove nulls */ + + for (i = 0; i < Count; i++) + { + if (!*Source) + { + NewCount--; + } + else + { + *Dest = *Source; + Dest++; + } + Source++; + } + + /* Update parent package if any null elements were removed */ + + if (NewCount < Count) + { + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Found and removed %u NULL elements\n", + Data->Pathname, (Count - NewCount))); + + /* NULL terminate list and update the package count */ + + *Dest = NULL; + ObjDesc->Package.Count = NewCount; + } +} + + /******************************************************************************* * * FUNCTION: AcpiNsRepairPackageList diff --git a/namespace/nsrepair2.c b/namespace/nsrepair2.c index c08028452b4c..220608e2db61 100644 --- a/namespace/nsrepair2.c +++ b/namespace/nsrepair2.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -119,7 +119,6 @@ #include "acpi.h" #include "accommon.h" #include "acnamesp.h" -#include "acpredef.h" #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsrepair2") @@ -177,7 +176,7 @@ AcpiNsCheckSortedList ( UINT8 SortDirection, char *SortKeyName); -static ACPI_STATUS +static void AcpiNsSortList ( ACPI_OPERAND_OBJECT **Elements, UINT32 Count, @@ -557,7 +556,6 @@ AcpiNsCheckSortedList ( ACPI_OPERAND_OBJECT *ObjDesc; UINT32 i; UINT32 PreviousValue; - ACPI_STATUS Status; ACPI_FUNCTION_NAME (NsCheckSortedList); @@ -616,19 +614,15 @@ AcpiNsCheckSortedList ( /* * The list must be sorted in the specified order. If we detect a - * discrepancy, issue a warning and sort the entire list + * discrepancy, sort the entire list. */ if (((SortDirection == ACPI_SORT_ASCENDING) && (ObjDesc->Integer.Value < PreviousValue)) || ((SortDirection == ACPI_SORT_DESCENDING) && (ObjDesc->Integer.Value > PreviousValue))) { - Status = AcpiNsSortList (ReturnObject->Package.Elements, - OuterElementCount, SortIndex, SortDirection); - if (ACPI_FAILURE (Status)) - { - return (Status); - } + AcpiNsSortList (ReturnObject->Package.Elements, + OuterElementCount, SortIndex, SortDirection); Data->Flags |= ACPI_OBJECT_REPAIRED; @@ -646,99 +640,6 @@ AcpiNsCheckSortedList ( } -/****************************************************************************** - * - * FUNCTION: AcpiNsRemoveNullElements - * - * PARAMETERS: Data - Pointer to validation data structure - * PackageType - An AcpiReturnPackageTypes value - * ObjDesc - A Package object - * - * RETURN: None. - * - * DESCRIPTION: Remove all NULL package elements from packages that contain - * a variable number of sub-packages. - * - *****************************************************************************/ - -void -AcpiNsRemoveNullElements ( - ACPI_PREDEFINED_DATA *Data, - UINT8 PackageType, - ACPI_OPERAND_OBJECT *ObjDesc) -{ - ACPI_OPERAND_OBJECT **Source; - ACPI_OPERAND_OBJECT **Dest; - UINT32 Count; - UINT32 NewCount; - UINT32 i; - - - ACPI_FUNCTION_NAME (NsRemoveNullElements); - - - /* - * PTYPE1 packages contain no subpackages. - * PTYPE2 packages contain a variable number of sub-packages. We can - * safely remove all NULL elements from the PTYPE2 packages. - */ - switch (PackageType) - { - case ACPI_PTYPE1_FIXED: - case ACPI_PTYPE1_VAR: - case ACPI_PTYPE1_OPTION: - return; - - case ACPI_PTYPE2: - case ACPI_PTYPE2_COUNT: - case ACPI_PTYPE2_PKG_COUNT: - case ACPI_PTYPE2_FIXED: - case ACPI_PTYPE2_MIN: - case ACPI_PTYPE2_REV_FIXED: - break; - - default: - return; - } - - Count = ObjDesc->Package.Count; - NewCount = Count; - - Source = ObjDesc->Package.Elements; - Dest = Source; - - /* Examine all elements of the package object, remove nulls */ - - for (i = 0; i < Count; i++) - { - if (!*Source) - { - NewCount--; - } - else - { - *Dest = *Source; - Dest++; - } - Source++; - } - - /* Update parent package if any null elements were removed */ - - if (NewCount < Count) - { - ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, - "%s: Found and removed %u NULL elements\n", - Data->Pathname, (Count - NewCount))); - - /* NULL terminate list and update the package count */ - - *Dest = NULL; - ObjDesc->Package.Count = NewCount; - } -} - - /****************************************************************************** * * FUNCTION: AcpiNsSortList @@ -748,15 +649,16 @@ AcpiNsRemoveNullElements ( * Index - Sort by which package element * SortDirection - Ascending or Descending sort * - * RETURN: Status + * RETURN: None * * DESCRIPTION: Sort the objects that are in a package element list. * - * NOTE: Assumes that all NULL elements have been removed from the package. + * NOTE: Assumes that all NULL elements have been removed from the package, + * and that all elements have been verified to be of type Integer. * *****************************************************************************/ -static ACPI_STATUS +static void AcpiNsSortList ( ACPI_OPERAND_OBJECT **Elements, UINT32 Count, @@ -791,6 +693,4 @@ AcpiNsSortList ( } } } - - return (AE_OK); } diff --git a/namespace/nssearch.c b/namespace/nssearch.c index fce7c5ad4de9..b17f60f7bd90 100644 --- a/namespace/nssearch.c +++ b/namespace/nssearch.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/namespace/nsutils.c b/namespace/nsutils.c index ed0c3f7ec810..ee40473aaf3e 100644 --- a/namespace/nsutils.c +++ b/namespace/nsutils.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/namespace/nswalk.c b/namespace/nswalk.c index 7711e9a37684..b6c573bda7d5 100644 --- a/namespace/nswalk.c +++ b/namespace/nswalk.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/namespace/nsxfeval.c b/namespace/nsxfeval.c index a0f96a04ee09..945690a7c164 100644 --- a/namespace/nsxfeval.c +++ b/namespace/nsxfeval.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -688,27 +688,20 @@ AcpiNsGetDeviceCallback ( return (AE_BAD_PARAMETER); } - /* Run _STA to determine if device is present */ - - Status = AcpiUtExecute_STA (Node, &Flags); - if (ACPI_FAILURE (Status)) - { - return (AE_CTRL_DEPTH); - } - - if (!(Flags & ACPI_STA_DEVICE_PRESENT) && - !(Flags & ACPI_STA_DEVICE_FUNCTIONING)) - { - /* - * Don't examine the children of the device only when the - * device is neither present nor functional. See ACPI spec, - * description of _STA for more information. - */ - return (AE_CTRL_DEPTH); - } - - /* Filter based on device HID & CID */ - + /* + * First, filter based on the device HID and CID. + * + * 01/2010: For this case where a specific HID is requested, we don't + * want to run _STA until we have an actual HID match. Thus, we will + * not unnecessarily execute _STA on devices for which the caller + * doesn't care about. Previously, _STA was executed unconditionally + * on all devices found here. + * + * A side-effect of this change is that now we will continue to search + * for a matching HID even under device trees where the parent device + * would have returned a _STA that indicates it is not present or + * not functioning (thus aborting the search on that branch). + */ if (Info->Hid != NULL) { Status = AcpiUtExecute_HID (Node, &Hid); @@ -762,6 +755,25 @@ AcpiNsGetDeviceCallback ( } } + /* Run _STA to determine if device is present */ + + Status = AcpiUtExecute_STA (Node, &Flags); + if (ACPI_FAILURE (Status)) + { + return (AE_CTRL_DEPTH); + } + + if (!(Flags & ACPI_STA_DEVICE_PRESENT) && + !(Flags & ACPI_STA_DEVICE_FUNCTIONING)) + { + /* + * Don't examine the children of the device only when the + * device is neither present nor functional. See ACPI spec, + * description of _STA for more information. + */ + return (AE_CTRL_DEPTH); + } + /* We have a valid device, invoke the user function */ Status = Info->UserFunction (ObjHandle, NestingLevel, Info->Context, diff --git a/namespace/nsxfname.c b/namespace/nsxfname.c index cb7aaa6f941f..8fd3d4c7eac1 100644 --- a/namespace/nsxfname.c +++ b/namespace/nsxfname.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/namespace/nsxfobj.c b/namespace/nsxfobj.c index 9c42a33f8b21..aef106e80b93 100644 --- a/namespace/nsxfobj.c +++ b/namespace/nsxfobj.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/os_specific/service_layers/osunixdir.c b/os_specific/service_layers/osunixdir.c index d9c55a1ef84a..897d17340b9f 100644 --- a/os_specific/service_layers/osunixdir.c +++ b/os_specific/service_layers/osunixdir.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -295,11 +295,11 @@ strlwr ( int i; - length = strlen(str); + length = strlen (str); for (i = 0; i < length; i++) { - str[i] = tolower(str[i]); + str[i] = tolower ((int) str[i]); } return (str); diff --git a/os_specific/service_layers/osunixxf.c b/os_specific/service_layers/osunixxf.c index b430e83f1600..e62ed738be1a 100644 --- a/os_specific/service_layers/osunixxf.c +++ b/os_specific/service_layers/osunixxf.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -871,7 +871,7 @@ AcpiOsStall ( void AcpiOsSleep ( - ACPI_INTEGER milliseconds) + UINT64 milliseconds) { sleep (milliseconds / 1000); /* Sleep for whole seconds */ @@ -976,7 +976,7 @@ ACPI_STATUS AcpiOsWritePciConfiguration ( ACPI_PCI_ID *PciId, UINT32 Register, - ACPI_INTEGER Value, + UINT64 Value, UINT32 Width) { diff --git a/os_specific/service_layers/oswindir.c b/os_specific/service_layers/oswindir.c index 445813d7b79c..1c7df069ffa6 100644 --- a/os_specific/service_layers/oswindir.c +++ b/os_specific/service_layers/oswindir.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/os_specific/service_layers/oswintbl.c b/os_specific/service_layers/oswintbl.c index 889582ff7541..30d7ba66b9c7 100644 --- a/os_specific/service_layers/oswintbl.c +++ b/os_specific/service_layers/oswintbl.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/os_specific/service_layers/oswinxf.c b/os_specific/service_layers/oswinxf.c index 166e5e250adc..c932c2ca6c96 100644 --- a/os_specific/service_layers/oswinxf.c +++ b/os_specific/service_layers/oswinxf.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -1146,7 +1146,7 @@ AcpiOsStall ( void AcpiOsSleep ( - ACPI_INTEGER milliseconds) + UINT64 milliseconds) { /* Add 10ms to account for clock tick granularity */ @@ -1224,7 +1224,7 @@ ACPI_STATUS AcpiOsWritePciConfiguration ( ACPI_PCI_ID *PciId, UINT32 Register, - ACPI_INTEGER Value, + UINT64 Value, UINT32 Width) { diff --git a/osunixxf.c b/osunixxf.c index b430e83f1600..e62ed738be1a 100644 --- a/osunixxf.c +++ b/osunixxf.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -871,7 +871,7 @@ AcpiOsStall ( void AcpiOsSleep ( - ACPI_INTEGER milliseconds) + UINT64 milliseconds) { sleep (milliseconds / 1000); /* Sleep for whole seconds */ @@ -976,7 +976,7 @@ ACPI_STATUS AcpiOsWritePciConfiguration ( ACPI_PCI_ID *PciId, UINT32 Register, - ACPI_INTEGER Value, + UINT64 Value, UINT32 Width) { diff --git a/parser/psargs.c b/parser/psargs.c index 60d4a835b1b7..78127e5d4d33 100644 --- a/parser/psargs.c +++ b/parser/psargs.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -514,7 +514,7 @@ AcpiPsGetNextSimpleArg ( /* Get 1 byte from the AML stream */ Opcode = AML_BYTE_OP; - Arg->Common.Value.Integer = (ACPI_INTEGER) *Aml; + Arg->Common.Value.Integer = (UINT64) *Aml; Length = 1; break; diff --git a/parser/psloop.c b/parser/psloop.c index 4171e0dc6de0..67f79261f3f8 100644 --- a/parser/psloop.c +++ b/parser/psloop.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/parser/psopcode.c b/parser/psopcode.c index d107c523707c..e3e32ea555da 100644 --- a/parser/psopcode.c +++ b/parser/psopcode.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/parser/psparse.c b/parser/psparse.c index 820f54bd0ca9..4a1c29d2f42f 100644 --- a/parser/psparse.c +++ b/parser/psparse.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/parser/psscope.c b/parser/psscope.c index 979dbb151514..bb7e149390c0 100644 --- a/parser/psscope.c +++ b/parser/psscope.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/parser/pstree.c b/parser/pstree.c index 20ac405cac3a..6a425e9cf49a 100644 --- a/parser/pstree.c +++ b/parser/pstree.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/parser/psutils.c b/parser/psutils.c index 42f2b015d6c2..17be364a2780 100644 --- a/parser/psutils.c +++ b/parser/psutils.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/parser/pswalk.c b/parser/pswalk.c index d8d5f5e6f21d..81310ba09f8b 100644 --- a/parser/pswalk.c +++ b/parser/pswalk.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/parser/psxface.c b/parser/psxface.c index 1bf36e01c93a..b34d9859afc9 100644 --- a/parser/psxface.c +++ b/parser/psxface.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/resources/rsaddr.c b/resources/rsaddr.c index f2f3c4421f66..eeed1dffdb68 100644 --- a/resources/rsaddr.c +++ b/resources/rsaddr.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/resources/rscalc.c b/resources/rscalc.c index 76aa44ff839a..3215c9ecdbd7 100644 --- a/resources/rscalc.c +++ b/resources/rscalc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/resources/rscreate.c b/resources/rscreate.c index e9c840b64e58..c2929aa43044 100644 --- a/resources/rscreate.c +++ b/resources/rscreate.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -270,7 +270,7 @@ AcpiRsCreatePciRoutingTable ( /* * Loop through the ACPI_INTERNAL_OBJECTS - Each object should be a - * package that in turn contains an ACPI_INTEGER Address, a UINT8 Pin, + * package that in turn contains an UINT64 Address, a UINT8 Pin, * a Name, and a UINT8 SourceIndex. */ TopObjectList = PackageObject->Package.Elements; diff --git a/resources/rsdump.c b/resources/rsdump.c index 62db284c6f37..3c1275f52fed 100644 --- a/resources/rsdump.c +++ b/resources/rsdump.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/resources/rsinfo.c b/resources/rsinfo.c index abf79943d971..8f6aa0aa358b 100644 --- a/resources/rsinfo.c +++ b/resources/rsinfo.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/resources/rsio.c b/resources/rsio.c index fb9213dd72e9..a29c655c483f 100644 --- a/resources/rsio.c +++ b/resources/rsio.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/resources/rsirq.c b/resources/rsirq.c index 7eab43513996..21120f6edbfe 100644 --- a/resources/rsirq.c +++ b/resources/rsirq.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/resources/rslist.c b/resources/rslist.c index 3adce2b39398..8d31a9151975 100644 --- a/resources/rslist.c +++ b/resources/rslist.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/resources/rsmemory.c b/resources/rsmemory.c index a3d08c01a1b7..f4d1cca436b2 100644 --- a/resources/rsmemory.c +++ b/resources/rsmemory.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/resources/rsmisc.c b/resources/rsmisc.c index 3565334e7324..ecea3e0c1aff 100644 --- a/resources/rsmisc.c +++ b/resources/rsmisc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/resources/rsutils.c b/resources/rsutils.c index 4e0f04ce8e52..b5c2ab5a7334 100644 --- a/resources/rsutils.c +++ b/resources/rsutils.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/resources/rsxface.c b/resources/rsxface.c index a509c7afc7a4..2a019d18440e 100644 --- a/resources/rsxface.c +++ b/resources/rsxface.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/tables/tbfadt.c b/tables/tbfadt.c index c657a0b75ac1..b6d32f3cc14c 100644 --- a/tables/tbfadt.c +++ b/tables/tbfadt.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/tables/tbfind.c b/tables/tbfind.c index 1838b5eb78ae..e1c110f4523a 100644 --- a/tables/tbfind.c +++ b/tables/tbfind.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/tables/tbinstal.c b/tables/tbinstal.c index c911f84f68b9..78cf164a99ea 100644 --- a/tables/tbinstal.c +++ b/tables/tbinstal.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/tables/tbutils.c b/tables/tbutils.c index ec2a88e283d3..0959ab25a5fc 100644 --- a/tables/tbutils.c +++ b/tables/tbutils.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/tables/tbxface.c b/tables/tbxface.c index 4c12916c5ac3..6a4f413d04c5 100644 --- a/tables/tbxface.c +++ b/tables/tbxface.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/tables/tbxfroot.c b/tables/tbxfroot.c index e0a571f36f44..4f0ab81084a1 100644 --- a/tables/tbxfroot.c +++ b/tables/tbxfroot.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/tools/acpiexec/aecommon.h b/tools/acpiexec/aecommon.h index 53f7a17bace7..7608c5de4887 100644 --- a/tools/acpiexec/aecommon.h +++ b/tools/acpiexec/aecommon.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -232,7 +232,7 @@ AeRegionHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); diff --git a/tools/acpiexec/aeexec.c b/tools/acpiexec/aeexec.c index 676bd9382bfa..06dbddbb1591 100644 --- a/tools/acpiexec/aeexec.c +++ b/tools/acpiexec/aeexec.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/tools/acpiexec/aehandlers.c b/tools/acpiexec/aehandlers.c index ae57483c49f0..28450cec74b6 100644 --- a/tools/acpiexec/aehandlers.c +++ b/tools/acpiexec/aehandlers.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -653,7 +653,7 @@ AeRegionHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -918,8 +918,8 @@ AeRegionHandler ( * NOTE: RegionElement->Length is in bytes, therefore it we compare against * ByteWidth (see above) */ - if (((ACPI_INTEGER) Address + ByteWidth) > - ((ACPI_INTEGER)(RegionElement->Address) + RegionElement->Length)) + if (((UINT64) Address + ByteWidth) > + ((UINT64)(RegionElement->Address) + RegionElement->Length)) { ACPI_WARNING ((AE_INFO, "Request on [%4.4s] is beyond region limit Req-%X+%X, Base=%X, Len-%X", @@ -934,7 +934,7 @@ AeRegionHandler ( * Get BufferValue to point to the "address" in the buffer */ BufferValue = ((UINT8 *) RegionElement->Buffer + - ((ACPI_INTEGER) Address - (ACPI_INTEGER) RegionElement->Address)); + ((UINT64) Address - (UINT64) RegionElement->Address)); DoFunction: diff --git a/tools/acpiexec/aemain.c b/tools/acpiexec/aemain.c index 777c5741e739..55f701d1ac31 100644 --- a/tools/acpiexec/aemain.c +++ b/tools/acpiexec/aemain.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -336,9 +336,10 @@ FlSplitInputPathname ( * * FUNCTION: AsDoWildcard * - * PARAMETERS: None + * PARAMETERS: DirectoryPathname - Path to parent directory + * FileSpecifier - the wildcard specification (*.c, etc.) * - * RETURN: None + * RETURN: Pointer to a list of filenames * * DESCRIPTION: Process files via wildcards. This function is for the Windows * case only. @@ -393,6 +394,11 @@ AsDoWildcard ( return (FileList); #else + if (!FileSpecifier) + { + return (NULL); + } + /* * Linux/Unix cases - Wildcards are expanded by the shell automatically. * Just return the filename in a null terminated list diff --git a/tools/acpiexec/aetables.c b/tools/acpiexec/aetables.c index e29bf65b8f46..4c3734a05cbd 100644 --- a/tools/acpiexec/aetables.c +++ b/tools/acpiexec/aetables.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/tools/acpiexec/osunixdir.c b/tools/acpiexec/osunixdir.c index d9c55a1ef84a..897d17340b9f 100644 --- a/tools/acpiexec/osunixdir.c +++ b/tools/acpiexec/osunixdir.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -295,11 +295,11 @@ strlwr ( int i; - length = strlen(str); + length = strlen (str); for (i = 0; i < length; i++) { - str[i] = tolower(str[i]); + str[i] = tolower ((int) str[i]); } return (str); diff --git a/tools/acpisrc/acpisrc.h b/tools/acpisrc/acpisrc.h index 651a0553f6f0..1d97479a0dcc 100644 --- a/tools/acpisrc/acpisrc.h +++ b/tools/acpisrc/acpisrc.h @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/tools/acpisrc/ascase.c b/tools/acpisrc/ascase.c index da1112d562de..e52578dc4056 100644 --- a/tools/acpisrc/ascase.c +++ b/tools/acpisrc/ascase.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -197,7 +197,7 @@ AsLowerCaseString ( for (i = 0; i < TargetLength; i++) { - SubString1[i] = (char) tolower (SubString1[i]); + SubString1[i] = (char) tolower ((int) SubString1[i]); } SubBuffer = SubString1 + TargetLength; @@ -294,7 +294,7 @@ AsMixedCaseToUnderscores ( continue; } - if (islower (*SubBuffer)) + if (islower ((int) *SubBuffer)) { HasLowerCase = TRUE; } @@ -323,7 +323,7 @@ AsMixedCaseToUnderscores ( (SubBuffer[1] == 'X')) { SubBuffer += 2; - while (isxdigit (*SubBuffer)) + while (isxdigit ((int) *SubBuffer)) { SubBuffer++; } @@ -367,9 +367,9 @@ AsMixedCaseToUnderscores ( /* Check the rest of the identifier for any lower case letters */ SubString = SubBuffer; - while ((isalnum (*SubString)) || (*SubString == '_')) + while ((isalnum ((int) *SubString)) || (*SubString == '_')) { - if (islower (*SubString)) + if (islower ((int) *SubString)) { HasLowerCase = TRUE; } @@ -387,7 +387,7 @@ AsMixedCaseToUnderscores ( /* A capital letter may indicate the start of a token; save it */ - if (isupper (SubBuffer[0])) + if (isupper ((int) SubBuffer[0])) { TokenStart = SubBuffer; } @@ -399,15 +399,15 @@ AsMixedCaseToUnderscores ( * to * */ - else if ((islower (SubBuffer[0]) || isdigit (SubBuffer[0])) && - (isupper (SubBuffer[1]))) + else if ((islower ((int) SubBuffer[0]) || isdigit ((int) SubBuffer[0])) && + (isupper ((int) SubBuffer[1]))) { - if (isdigit (SubBuffer[0])) + if (isdigit ((int) SubBuffer[0])) { /* Ignore */ /* Ignore */ - if (isupper (*(SubBuffer-1)) || + if (isupper ((int) *(SubBuffer-1)) || *(SubBuffer-1) == '_') { SubBuffer++; @@ -420,7 +420,7 @@ AsMixedCaseToUnderscores ( * Find the end of this identifier (token) */ TokenEnd = SubBuffer; - while ((isalnum (*TokenEnd)) || (*TokenEnd == '_')) + while ((isalnum ((int) *TokenEnd)) || (*TokenEnd == '_')) { TokenEnd++; } @@ -428,7 +428,7 @@ AsMixedCaseToUnderscores ( /* Force the UpperCase letter (#2) to lower case */ Gbl_MadeChanges = TRUE; - SubBuffer[1] = (char) tolower (SubBuffer[1]); + SubBuffer[1] = (char) tolower ((int) SubBuffer[1]); SubString = TokenEnd; Length = 0; @@ -463,7 +463,7 @@ AsMixedCaseToUnderscores ( if (TokenStart) { - *TokenStart = (char) tolower (*TokenStart); + *TokenStart = (char) tolower ((int) *TokenStart); TokenStart = NULL; } } @@ -554,11 +554,11 @@ AsLowerCaseIdentifiers ( * Only lower case if we have an upper followed by a lower * This leaves the all-uppercase things (macros, etc.) intact */ - if ((isupper (SubBuffer[0])) && - (islower (SubBuffer[1]))) + if ((isupper ((int) SubBuffer[0])) && + (islower ((int) SubBuffer[1]))) { Gbl_MadeChanges = TRUE; - *SubBuffer = (char) tolower (*SubBuffer); + *SubBuffer = (char) tolower ((int) *SubBuffer); } SubBuffer++; @@ -595,15 +595,15 @@ AsUppercaseTokens ( if (SubBuffer) { TokenEnd = SubBuffer; - while ((isalnum (*TokenEnd)) || (*TokenEnd == '_')) + while ((isalnum ((int) *TokenEnd)) || (*TokenEnd == '_')) { TokenEnd++; } for (i = 0; i < (TokenEnd - SubBuffer); i++) { - if ((islower (SubBuffer[i])) && - (isupper (SubBuffer[i+1]))) + if ((islower ((int) SubBuffer[i])) && + (isupper ((int) SubBuffer[i+1]))) { SubString = TokenEnd; @@ -635,7 +635,7 @@ AsUppercaseTokens ( for (i = 0; i < (TokenEnd - SubBuffer); i++) { - SubBuffer[i] = (char) toupper (SubBuffer[i]); + SubBuffer[i] = (char) toupper ((int) SubBuffer[i]); } SubBuffer = TokenEnd; diff --git a/tools/acpisrc/asconvrt.c b/tools/acpisrc/asconvrt.c index e17e51f1bb49..4ceb43563313 100644 --- a/tools/acpisrc/asconvrt.c +++ b/tools/acpisrc/asconvrt.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -153,9 +153,9 @@ AsMatchExactWord ( NextChar = Word[WordLength]; PrevChar = * (Word -1); - if (isalnum (NextChar) || + if (isalnum ((int) NextChar) || (NextChar == '_') || - isalnum (PrevChar) || + isalnum ((int) PrevChar) || (PrevChar == '_')) { return (FALSE); @@ -700,7 +700,7 @@ AsBracesOnSameLine ( * Check for digit will ignore initializer lists surrounded by braces. * This will work until we we need more complex detection. */ - if ((*SubBuffer == '{') && !isdigit (SubBuffer[1])) + if ((*SubBuffer == '{') && !isdigit ((int) SubBuffer[1])) { if (BlockBegin) { diff --git a/tools/acpisrc/asfile.c b/tools/acpisrc/asfile.c index d6561898095e..ab62f176c9d2 100644 --- a/tools/acpisrc/asfile.c +++ b/tools/acpisrc/asfile.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/tools/acpisrc/asmain.c b/tools/acpisrc/asmain.c index c1fbb0cf133c..4eaf94b3259b 100644 --- a/tools/acpisrc/asmain.c +++ b/tools/acpisrc/asmain.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -191,8 +191,8 @@ AsStricmp ( do { - c1 = tolower (*String1); - c2 = tolower (*String2); + c1 = tolower ((int) *String1); + c2 = tolower ((int) *String2); String1++; String2++; diff --git a/tools/acpisrc/asremove.c b/tools/acpisrc/asremove.c index 18f72f3c1578..0f7939a43fd8 100644 --- a/tools/acpisrc/asremove.c +++ b/tools/acpisrc/asremove.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/tools/acpisrc/astable.c b/tools/acpisrc/astable.c index e66fe72fdffa..2a9eee6b673d 100644 --- a/tools/acpisrc/astable.c +++ b/tools/acpisrc/astable.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -163,7 +163,7 @@ ACPI_STRING_TABLE StandardDataTypes[] = { char LinuxHeader[] = "/*\n" -" * Copyright (C) 2000 - 2009, Intel Corp.\n" +" * Copyright (C) 2000 - 2010, Intel Corp.\n" " * All rights reserved.\n" " *\n" " * Redistribution and use in source and binary forms, with or without\n" @@ -500,7 +500,6 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ASL_RESOURCE_NODE", SRC_TYPE_STRUCT}, {"ASL_WALK_CALLBACK", SRC_TYPE_SIMPLE}, {"COMMAND_INFO", SRC_TYPE_STRUCT}, - {"UINT32_STRUCT", SRC_TYPE_STRUCT}, {"UINT64_OVERLAY", SRC_TYPE_UNION}, {"UINT64_STRUCT", SRC_TYPE_STRUCT}, @@ -781,11 +780,15 @@ ACPI_CONVERSION_TABLE StatsConversionTable = { ACPI_STRING_TABLE CustomReplacements[] = { - {"(c) 1999 - 2009", "(c) 1999 - 2009", REPLACE_WHOLE_WORD}, + {"ACPI_INTEGER_MAX", "ACPI_UINT64_MAX", REPLACE_WHOLE_WORD}, #if 0 + {"(ACPI_INTEGER)", "(UINT64)", REPLACE_WHOLE_WORD}, + {"ACPI_INTEGER ", "UINT64 ", REPLACE_WHOLE_WORD}, + {"ACPI_INTEGER", "UINT64", REPLACE_WHOLE_WORD}, + {"(c) 1999 - 2009", "(c) 1999 - 2010", REPLACE_WHOLE_WORD}, /* Main ACPICA source */ + {"(c) 2006 - 2009", "(c) 2006 - 2010", REPLACE_WHOLE_WORD}, /* Test suites */ {"#include \"acpi.h\"", "#include \"acpi.h\"\n#include \"accommon.h\"", REPLACE_SUBSTRINGS}, - {"(c) 1999 - 2009", "(c) 1999 - 2009", REPLACE_WHOLE_WORD}, {"AcpiTbSumTable", "AcpiTbSumTable", REPLACE_WHOLE_WORD}, {"ACPI_SIG_BOOT", "ACPI_SIG_BOOT", REPLACE_WHOLE_WORD}, {"ACPI_SIG_DBGP", "ACPI_SIG_DBGP", REPLACE_WHOLE_WORD}, diff --git a/tools/acpisrc/asutils.c b/tools/acpisrc/asutils.c index 7b59178a5a1d..401ebcb45e6e 100644 --- a/tools/acpisrc/asutils.c +++ b/tools/acpisrc/asutils.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/tools/acpisrc/osunixdir.c b/tools/acpisrc/osunixdir.c index d9c55a1ef84a..897d17340b9f 100644 --- a/tools/acpisrc/osunixdir.c +++ b/tools/acpisrc/osunixdir.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -295,11 +295,11 @@ strlwr ( int i; - length = strlen(str); + length = strlen (str); for (i = 0; i < length; i++) { - str[i] = tolower(str[i]); + str[i] = tolower ((int) str[i]); } return (str); diff --git a/tools/acpixtract/acpixtract.c b/tools/acpixtract/acpixtract.c index 044d552240d9..5a99fc4710fb 100644 --- a/tools/acpixtract/acpixtract.c +++ b/tools/acpixtract/acpixtract.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -122,7 +122,7 @@ /* Note: This is a 32-bit program only */ -#define VERSION 0x20091002 +#define VERSION 0x20100107 #define FIND_HEADER 0 #define EXTRACT_DATA 1 #define BUFFER_SIZE 256 @@ -250,7 +250,7 @@ CheckAscii ( for (i = 0; i < Count; i++) { - if (!Name[i] || !isprint (Name[i])) + if (!Name[i] || !isprint ((int) Name[i])) { Name[i] = ' '; } diff --git a/tools/examples/examples.c b/tools/examples/examples.c index e2dfacd20d02..dc88bae62cb6 100644 --- a/tools/examples/examples.c +++ b/tools/examples/examples.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/utilities/utalloc.c b/utilities/utalloc.c index a66b94005c1f..f72959a4d82a 100644 --- a/utilities/utalloc.c +++ b/utilities/utalloc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/utilities/utcache.c b/utilities/utcache.c index aabc0a23052e..2cee9a13ce14 100644 --- a/utilities/utcache.c +++ b/utilities/utcache.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/utilities/utclib.c b/utilities/utclib.c index a9b8122fab86..fd7796fee501 100644 --- a/utilities/utclib.c +++ b/utilities/utclib.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/utilities/utcopy.c b/utilities/utcopy.c index 5423eff9dec4..fe44083c5983 100644 --- a/utilities/utcopy.c +++ b/utilities/utcopy.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/utilities/utdebug.c b/utilities/utdebug.c index 3901b07d197e..0a91716f24cc 100644 --- a/utilities/utdebug.c +++ b/utilities/utdebug.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -598,7 +598,7 @@ AcpiUtValueExit ( const char *FunctionName, const char *ModuleName, UINT32 ComponentId, - ACPI_INTEGER Value) + UINT64 Value) { AcpiDebugPrint (ACPI_LV_FUNCTIONS, diff --git a/utilities/utdelete.c b/utilities/utdelete.c index bf30aee74e06..31bf40b4e745 100644 --- a/utilities/utdelete.c +++ b/utilities/utdelete.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/utilities/uteval.c b/utilities/uteval.c index ecb0cf19a704..c959d44bb594 100644 --- a/utilities/uteval.c +++ b/utilities/uteval.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -423,7 +423,7 @@ ACPI_STATUS AcpiUtEvaluateNumericObject ( char *ObjectName, ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_INTEGER *Value) + UINT64 *Value) { ACPI_OPERAND_OBJECT *ObjDesc; ACPI_STATUS Status; diff --git a/utilities/utglobal.c b/utilities/utglobal.c index b49ce352fbc7..236d811714cd 100644 --- a/utilities/utglobal.c +++ b/utilities/utglobal.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -331,7 +331,7 @@ static const char AcpiGbl_HexToAscii[] = char AcpiUtHexToAsciiChar ( - ACPI_INTEGER Integer, + UINT64 Integer, UINT32 Position) { diff --git a/utilities/utids.c b/utilities/utids.c index 766933050083..ee7b19d885c3 100644 --- a/utilities/utids.c +++ b/utilities/utids.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/utilities/utinit.c b/utilities/utinit.c index d59904b46a2f..767c5623ef74 100644 --- a/utilities/utinit.c +++ b/utilities/utinit.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/utilities/utlock.c b/utilities/utlock.c index dd4e100001af..e17ca3e7d781 100644 --- a/utilities/utlock.c +++ b/utilities/utlock.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/utilities/utmath.c b/utilities/utmath.c index b0a40ff2bcfd..54d492f234f3 100644 --- a/utilities/utmath.c +++ b/utilities/utmath.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -149,9 +149,9 @@ ACPI_STATUS AcpiUtShortDivide ( - ACPI_INTEGER Dividend, + UINT64 Dividend, UINT32 Divisor, - ACPI_INTEGER *OutQuotient, + UINT64 *OutQuotient, UINT32 *OutRemainder) { UINT64_OVERLAY DividendOvl; @@ -213,10 +213,10 @@ AcpiUtShortDivide ( ACPI_STATUS AcpiUtDivide ( - ACPI_INTEGER InDividend, - ACPI_INTEGER InDivisor, - ACPI_INTEGER *OutQuotient, - ACPI_INTEGER *OutRemainder) + UINT64 InDividend, + UINT64 InDivisor, + UINT64 *OutQuotient, + UINT64 *OutRemainder) { UINT64_OVERLAY Dividend; UINT64_OVERLAY Divisor; @@ -293,8 +293,8 @@ AcpiUtDivide ( * The 64-bit remainder must be generated. */ Partial1 = Quotient.Part.Lo * Divisor.Part.Hi; - Partial2.Full = (ACPI_INTEGER) Quotient.Part.Lo * Divisor.Part.Lo; - Partial3.Full = (ACPI_INTEGER) Partial2.Part.Hi + Partial1; + Partial2.Full = (UINT64) Quotient.Part.Lo * Divisor.Part.Lo; + Partial3.Full = (UINT64) Partial2.Part.Hi + Partial1; Remainder.Part.Hi = Partial3.Part.Lo; Remainder.Part.Lo = Partial2.Part.Lo; @@ -362,9 +362,9 @@ AcpiUtDivide ( ACPI_STATUS AcpiUtShortDivide ( - ACPI_INTEGER InDividend, + UINT64 InDividend, UINT32 Divisor, - ACPI_INTEGER *OutQuotient, + UINT64 *OutQuotient, UINT32 *OutRemainder) { @@ -395,10 +395,10 @@ AcpiUtShortDivide ( ACPI_STATUS AcpiUtDivide ( - ACPI_INTEGER InDividend, - ACPI_INTEGER InDivisor, - ACPI_INTEGER *OutQuotient, - ACPI_INTEGER *OutRemainder) + UINT64 InDividend, + UINT64 InDivisor, + UINT64 *OutQuotient, + UINT64 *OutRemainder) { ACPI_FUNCTION_TRACE (UtDivide); diff --git a/utilities/utmisc.c b/utilities/utmisc.c index bc27cd529388..37b15e2c4c7b 100644 --- a/utilities/utmisc.c +++ b/utilities/utmisc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -929,12 +929,12 @@ ACPI_STATUS AcpiUtStrtoul64 ( char *String, UINT32 Base, - ACPI_INTEGER *RetInteger) + UINT64 *RetInteger) { UINT32 ThisDigit = 0; - ACPI_INTEGER ReturnValue = 0; - ACPI_INTEGER Quotient; - ACPI_INTEGER Dividend; + UINT64 ReturnValue = 0; + UINT64 Quotient; + UINT64 Dividend; UINT32 ToIntegerOp = (Base == ACPI_ANY_BASE); UINT32 Mode32 = (AcpiGbl_IntegerByteWidth == 4); UINT8 ValidDigits = 0; @@ -1071,7 +1071,7 @@ AcpiUtStrtoul64 ( /* Divide the digit into the correct position */ - (void) AcpiUtShortDivide ((Dividend - (ACPI_INTEGER) ThisDigit), + (void) AcpiUtShortDivide ((Dividend - (UINT64) ThisDigit), Base, &Quotient, NULL); if (ReturnValue > Quotient) diff --git a/utilities/utmutex.c b/utilities/utmutex.c index f6e7cc36522d..9e0ed3b713c7 100644 --- a/utilities/utmutex.c +++ b/utilities/utmutex.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -128,7 +128,7 @@ static ACPI_STATUS AcpiUtCreateMutex ( ACPI_MUTEX_HANDLE MutexId); -static ACPI_STATUS +static void AcpiUtDeleteMutex ( ACPI_MUTEX_HANDLE MutexId); @@ -216,7 +216,7 @@ AcpiUtMutexTerminate ( for (i = 0; i < ACPI_NUM_MUTEX; i++) { - (void) AcpiUtDeleteMutex (i); + AcpiUtDeleteMutex (i); } /* Delete the spinlocks */ @@ -253,11 +253,6 @@ AcpiUtCreateMutex ( ACPI_FUNCTION_TRACE_U32 (UtCreateMutex, MutexId); - if (MutexId > ACPI_MAX_MUTEX) - { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - if (!AcpiGbl_MutexInfo[MutexId].Mutex) { Status = AcpiOsCreateMutex (&AcpiGbl_MutexInfo[MutexId].Mutex); @@ -281,7 +276,7 @@ AcpiUtCreateMutex ( * ******************************************************************************/ -static ACPI_STATUS +static void AcpiUtDeleteMutex ( ACPI_MUTEX_HANDLE MutexId) { @@ -289,17 +284,10 @@ AcpiUtDeleteMutex ( ACPI_FUNCTION_TRACE_U32 (UtDeleteMutex, MutexId); - if (MutexId > ACPI_MAX_MUTEX) - { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - AcpiOsDeleteMutex (AcpiGbl_MutexInfo[MutexId].Mutex); AcpiGbl_MutexInfo[MutexId].Mutex = NULL; AcpiGbl_MutexInfo[MutexId].ThreadId = ACPI_MUTEX_NOT_ACQUIRED; - - return_ACPI_STATUS (AE_OK); } diff --git a/utilities/utobject.c b/utilities/utobject.c index 5164744891b8..fabed520c798 100644 --- a/utilities/utobject.c +++ b/utilities/utobject.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/utilities/utresrc.c b/utilities/utresrc.c index 2f19d639868c..02bb1dbfe60a 100644 --- a/utilities/utresrc.c +++ b/utilities/utresrc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/utilities/utstate.c b/utilities/utstate.c index 245ca02bfc5e..08218d11c91a 100644 --- a/utilities/utstate.c +++ b/utilities/utstate.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/utilities/uttrack.c b/utilities/uttrack.c index d712c1a3e5ab..500ed458248c 100644 --- a/utilities/uttrack.c +++ b/utilities/uttrack.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/utilities/utxface.c b/utilities/utxface.c index ba57f4922b78..f59a08dba485 100644 --- a/utilities/utxface.c +++ b/utilities/utxface.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License From 703ec8bd78cb3d32765f74421c806732650c7592 Mon Sep 17 00:00:00 2001 From: jkim Date: Fri, 5 Mar 2010 19:58:45 +0000 Subject: [PATCH 3/3] Import ACPICA 20100304. --- changes.txt | 53 ++ common/dmextern.c | 2 +- common/dmtable.c | 3 +- common/dmtbdump.c | 14 +- common/dmtbinfo.c | 25 + compiler/Makefile | 2 +- compiler/aslanalyze.c | 283 +---------- compiler/aslcompiler.h | 21 +- compiler/aslglobal.h | 1 - compiler/aslmain.c | 2 +- compiler/aslmap.c | 317 ------------ compiler/aslpredef.c | 706 +++++++++++++++++++++++++++ compiler/aslstubs.c | 10 +- compiler/asltypes.h | 17 +- dispatcher/dsfield.c | 2 +- dispatcher/dsmethod.c | 2 +- dispatcher/dsmthdat.c | 10 +- dispatcher/dsobject.c | 14 +- dispatcher/dsopcode.c | 12 +- dispatcher/dswexec.c | 6 +- dispatcher/dswstate.c | 10 +- events/evevent.c | 2 +- events/evgpe.c | 12 +- events/evgpeblk.c | 4 +- events/evmisc.c | 2 +- events/evxface.c | 4 +- executer/exconvrt.c | 4 +- executer/excreate.c | 4 +- executer/exdebug.c | 350 +++++++++++++ executer/exfield.c | 2 +- executer/exfldio.c | 16 +- executer/exmisc.c | 8 +- executer/exmutex.c | 19 +- executer/exnames.c | 4 +- executer/exoparg1.c | 16 +- executer/exoparg2.c | 10 +- executer/exoparg3.c | 4 +- executer/exoparg6.c | 4 +- executer/exprep.c | 4 +- executer/exregion.c | 4 +- executer/exresnte.c | 4 +- executer/exresolv.c | 8 +- executer/exresop.c | 8 +- executer/exstore.c | 223 +-------- executer/exsystem.c | 2 +- hardware/hwregs.c | 6 +- hardware/hwsleep.c | 2 +- hardware/hwvalid.c | 2 +- include/acdisasm.h | 1 + include/acglobal.h | 5 + include/acinterp.h | 10 + include/acoutput.h | 2 + include/acpixf.h | 3 +- include/actbl2.h | 30 ++ namespace/nsaccess.c | 2 +- namespace/nsdump.c | 2 +- namespace/nsnames.c | 2 +- namespace/nssearch.c | 2 +- namespace/nsutils.c | 4 +- os_specific/service_layers/oswinxf.c | 81 ++- parser/psargs.c | 4 +- parser/psloop.c | 3 +- resources/rscreate.c | 14 +- resources/rslist.c | 6 +- resources/rsmisc.c | 4 +- tables/tbfadt.c | 16 +- tables/tbutils.c | 4 +- tables/tbxfroot.c | 6 +- tools/acpiexec/Makefile | 1 + tools/acpiexec/aehandlers.c | 2 +- tools/acpisrc/astable.c | 1 + tools/examples/examples.c | 4 +- utilities/utalloc.c | 2 +- utilities/utdelete.c | 4 +- utilities/uteval.c | 2 +- utilities/utmisc.c | 6 +- utilities/utmutex.c | 4 +- utilities/utobject.c | 8 +- utilities/uttrack.c | 4 +- 79 files changed, 1486 insertions(+), 993 deletions(-) create mode 100644 compiler/aslpredef.c create mode 100644 executer/exdebug.c diff --git a/changes.txt b/changes.txt index 60620ce4f76b..5bd82ab6949a 100644 --- a/changes.txt +++ b/changes.txt @@ -1,3 +1,56 @@ +---------------------------------------- +04 March 2010. Summary of changes for version 20100304: + +1) ACPI CA Core Subsystem: + +Fixed a possible problem with the AML Mutex handling function +AcpiExReleaseMutex where the function could fault under the very rare +condition when the interpreter has blocked, the interpreter lock is released, +the interpreter is then reentered via the same thread, and attempts to +acquire an AML mutex that was previously acquired. FreeBSD report 140979. Lin +Ming. + +Implemented additional configuration support for the AML "Debug Object". +Output from the debug object can now be enabled via a global variable, +AcpiGbl_EnableAmlDebugObject. This will assist with remote machine debugging. +This debug output is now available in the release version of ACPICA instead +of just the debug version. Also, the entire debug output module can now be +configured out of the ACPICA build if desired. One new file added, +executer/exdebug.c. Lin Ming, Bob Moore. + +Added header support for the ACPI MCHI table (Management Controller Host +Interface Table). This table was added in ACPI 4.0, but the defining document +has only recently become available. + +Standardized output of integer values for ACPICA warnings/errors. Always use +0x prefix for hex output, always use %u for unsigned integer decimal output. +Affects ACPI_INFO, ACPI_ERROR, ACPI_EXCEPTION, and ACPI_WARNING (about 400 +invocations.) These invocations were converted from the original +ACPI_DEBUG_PRINT invocations and were not consistent. ACPICA BZ 835. + +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: 87.1K Code, 18.0K Data, 105.1K Total + Debug Version: 163.5K Code, 50.9K Data, 214.4K Total + Current Release: + Non-Debug Version: 87.5K Code, 18.4K Data, 105.9K Total + Debug Version: 163.4K Code, 51.1K Data, 214.5K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented typechecking support for static (non-control method) +predefined named objects that are declared with the Name() operator. For +example, the type of this object is now validated to be of type Integer: +Name(_BBN, 1). This change migrates the compiler to using the core predefined +name table instead of maintaining a local version. Added a new file, +aslpredef.c. ACPICA BZ 832. + +Disassembler: Added support for the ACPI 4.0 MCHI table. + ---------------------------------------- 21 January 2010. Summary of changes for version 20100121: diff --git a/common/dmextern.c b/common/dmextern.c index 29b15d805e94..5afd03419884 100644 --- a/common/dmextern.c +++ b/common/dmextern.c @@ -374,7 +374,7 @@ AcpiDmAddToExternalList ( (NextExternal->Value != Value)) { ACPI_ERROR ((AE_INFO, - "Argument count mismatch for method %s %d %d", + "Argument count mismatch for method %s %u %u", NextExternal->Path, NextExternal->Value, Value)); } diff --git a/common/dmtable.c b/common/dmtable.c index dd82016fef9e..057194d551de 100644 --- a/common/dmtable.c +++ b/common/dmtable.c @@ -262,6 +262,7 @@ static ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, "I/O Virtualization Reporting Structure"}, {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, "Multiple APIC Description Table"}, {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, "Memory Mapped Configuration table"}, + {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, "Management Controller Host Interface table"}, {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, "Maximum System Characteristics Table"}, {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, "Root System Description Table"}, {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, "Smart Battery Specification Table"}, @@ -911,7 +912,7 @@ AcpiDmDumpTable ( default: ACPI_ERROR ((AE_INFO, - "**** Invalid table opcode [%X] ****\n", Info->Opcode)); + "**** Invalid table opcode [0x%X] ****\n", Info->Opcode)); return (AE_SUPPORT); } } diff --git a/common/dmtbdump.c b/common/dmtbdump.c index 30d86708ce97..af7ee6712af6 100644 --- a/common/dmtbdump.c +++ b/common/dmtbdump.c @@ -363,7 +363,7 @@ AcpiDmDumpAsf ( break; default: - AcpiOsPrintf ("\n**** Unknown ASF sub-table type %X\n", SubTable->Header.Type); + AcpiOsPrintf ("\n**** Unknown ASF sub-table type 0x%X\n", SubTable->Header.Type); return; } @@ -561,7 +561,7 @@ AcpiDmDumpDmar ( ScopeOffset = sizeof (ACPI_DMAR_RHSA); break; default: - AcpiOsPrintf ("\n**** Unknown DMAR sub-table type %X\n\n", SubTable->Type); + AcpiOsPrintf ("\n**** Unknown DMAR sub-table type 0x%X\n\n", SubTable->Type); return; } @@ -809,7 +809,7 @@ AcpiDmDumpHest ( default: /* Cannot continue on unknown type - no length */ - AcpiOsPrintf ("\n**** Unknown HEST sub-table type %X\n", SubTable->Type); + AcpiOsPrintf ("\n**** Unknown HEST sub-table type 0x%X\n", SubTable->Type); return; } @@ -916,7 +916,7 @@ AcpiDmDumpIvrs ( InfoTable = AcpiDmTableInfoIvrs1; break; default: - AcpiOsPrintf ("\n**** Unknown IVRS sub-table type %X\n", + AcpiOsPrintf ("\n**** Unknown IVRS sub-table type 0x%X\n", SubTable->Type); /* Attempt to continue */ @@ -1002,7 +1002,7 @@ AcpiDmDumpIvrs ( InfoTable = AcpiDmTableInfoIvrs4; AcpiOsPrintf ( "\n**** Unknown IVRS device entry type/length: " - "%.2X/%X at offset %.4X: (header below)\n", + "0x%.2X/0x%X at offset 0x%.4X: (header below)\n", EntryType, EntryLength, EntryOffset); break; } @@ -1110,7 +1110,7 @@ AcpiDmDumpMadt ( InfoTable = AcpiDmTableInfoMadt10; break; default: - AcpiOsPrintf ("\n**** Unknown MADT sub-table type %X\n\n", SubTable->Type); + AcpiOsPrintf ("\n**** Unknown MADT sub-table type 0x%X\n\n", SubTable->Type); /* Attempt to continue */ @@ -1378,7 +1378,7 @@ AcpiDmDumpSrat ( InfoTable = AcpiDmTableInfoSrat2; break; default: - AcpiOsPrintf ("\n**** Unknown SRAT sub-table type %X\n", SubTable->Type); + AcpiOsPrintf ("\n**** Unknown SRAT sub-table type 0x%X\n", SubTable->Type); /* Attempt to continue */ diff --git a/common/dmtbinfo.c b/common/dmtbinfo.c index 805c81f65347..5c7ecb8e26dd 100644 --- a/common/dmtbinfo.c +++ b/common/dmtbinfo.c @@ -142,6 +142,7 @@ #define ACPI_IVRS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_IVRS,f) #define ACPI_MADT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MADT,f) #define ACPI_MCFG_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MCFG,f) +#define ACPI_MCHI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MCHI,f) #define ACPI_MSCT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MSCT,f) #define ACPI_SBST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SBST,f) #define ACPI_SLIT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SLIT,f) @@ -1224,6 +1225,30 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[] = }; +/******************************************************************************* + * + * MCHI - Management Controller Host Interface table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[] = +{ + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (InterfaceType), "Interface Type"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (Protocol), "Protocol"}, + {ACPI_DMT_UINT64, ACPI_MCHI_OFFSET (ProtocolData), "Protocol Data"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (InterruptType), "Interrupt Type"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (Gpe), "Gpe"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciDeviceFlag), "Pci Device Flag"}, + {ACPI_DMT_UINT32, ACPI_MCHI_OFFSET (GlobalInterrupt), "Global Interrupt"}, + {ACPI_DMT_GAS, ACPI_MCHI_OFFSET (ControlRegister), "Control Register"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciSegment), "Pci Segment"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciBus), "Pci Bus"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciDevice), "Pci Device"}, + {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciFunction), "Pci Function"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + + /******************************************************************************* * * MSCT - Maximum System Characteristics Table (ACPI 4.0) diff --git a/compiler/Makefile b/compiler/Makefile index 597d1ffcbebe..b4c03fd06279 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -4,7 +4,7 @@ PROG= iasl SRCS= aslcompilerparse.c aslcompilerlex.c aslanalyze.c aslcodegen.c \ aslcompile.c aslerror.c aslfiles.c asllength.c \ asllisting.c aslload.c asllookup.c aslmain.c aslmap.c aslopcodes.c \ - asloperands.c aslresource.c aslrestype1.c aslrestype2.c aslstartup.c \ + asloperands.c aslpredef.c aslresource.c aslrestype1.c aslrestype2.c aslstartup.c \ asltree.c aslutils.c asltransform.c aslfold.c aslstubs.c aslopt.c \ ../common/getopt.c \ ../utilities/utalloc.c \ diff --git a/compiler/aslanalyze.c b/compiler/aslanalyze.c index 4cbfcd6e0681..eaefd3fdf7f9 100644 --- a/compiler/aslanalyze.c +++ b/compiler/aslanalyze.c @@ -142,16 +142,6 @@ static UINT32 AnGetBtype ( ACPI_PARSE_OBJECT *Op); -static UINT32 -AnCheckForReservedName ( - ACPI_PARSE_OBJECT *Op, - char *Name); - -static void -AnCheckForReservedMethod ( - ACPI_PARSE_OBJECT *Op, - ASL_METHOD_INFO *MethodInfo); - static UINT32 AnMapObjTypeToBtype ( ACPI_PARSE_OBJECT *Op); @@ -596,219 +586,6 @@ AnGetBtype ( } -/******************************************************************************* - * - * FUNCTION: AnCheckForReservedName - * - * PARAMETERS: Op - A parse node - * Name - NameSeg to check - * - * RETURN: None - * - * DESCRIPTION: Check a NameSeg against the reserved list. - * - ******************************************************************************/ - -static UINT32 -AnCheckForReservedName ( - ACPI_PARSE_OBJECT *Op, - char *Name) -{ - UINT32 i; - - - if (Name[0] == 0) - { - AcpiOsPrintf ("Found a null name, external = %s\n", - Op->Asl.ExternalName); - } - - /* All reserved names are prefixed with a single underscore */ - - if (Name[0] != '_') - { - return (ACPI_NOT_RESERVED_NAME); - } - - /* Check for a standard reserved method name */ - - for (i = 0; ReservedMethods[i].Name; i++) - { - if (ACPI_COMPARE_NAME (Name, ReservedMethods[i].Name)) - { - if (ReservedMethods[i].Flags & ASL_RSVD_SCOPE) - { - AslError (ASL_ERROR, ASL_MSG_RESERVED_WORD, Op, - Op->Asl.ExternalName); - return (ACPI_PREDEFINED_NAME); - } - else if (ReservedMethods[i].Flags & ASL_RSVD_RESOURCE_NAME) - { - AslError (ASL_ERROR, ASL_MSG_RESERVED_WORD, Op, - Op->Asl.ExternalName); - return (ACPI_PREDEFINED_NAME); - } - - /* Return index into reserved array */ - - return i; - } - } - - /* - * Now check for the "special" reserved names -- - * GPE: _Lxx - * GPE: _Exx - * EC: _Qxx - */ - if ((Name[1] == 'L') || - (Name[1] == 'E') || - (Name[1] == 'Q')) - { - /* The next two characters must be hex digits */ - - if ((isxdigit ((int) Name[2])) && - (isxdigit ((int) Name[3]))) - { - return (ACPI_EVENT_RESERVED_NAME); - } - } - - - /* Check for the names reserved for the compiler itself: _T_x */ - - else if ((Op->Asl.ExternalName[1] == 'T') && - (Op->Asl.ExternalName[2] == '_')) - { - /* Ignore if actually emitted by the compiler */ - - if (Op->Asl.CompileFlags & NODE_COMPILER_EMITTED) - { - return (ACPI_NOT_RESERVED_NAME); - } - - /* - * Was not actually emitted by the compiler. This is a special case, - * however. If the ASL code being compiled was the result of a - * dissasembly, it may possibly contain valid compiler-emitted names - * of the form "_T_x". We don't want to issue an error or even a - * warning and force the user to manually change the names. So, we - * will issue a remark instead. - */ - AslError (ASL_REMARK, ASL_MSG_COMPILER_RESERVED, Op, Op->Asl.ExternalName); - return (ACPI_COMPILER_RESERVED_NAME); - } - - /* - * The name didn't match any of the known reserved names. Flag it as a - * warning, since the entire namespace starting with an underscore is - * reserved by the ACPI spec. - */ - AslError (ASL_WARNING, ASL_MSG_UNKNOWN_RESERVED_NAME, Op, - Op->Asl.ExternalName); - - return (ACPI_NOT_RESERVED_NAME); -} - - -/******************************************************************************* - * - * FUNCTION: AnCheckForReservedMethod - * - * PARAMETERS: Op - A parse node of type "METHOD". - * MethodInfo - Saved info about this method - * - * RETURN: None - * - * DESCRIPTION: If method is a reserved name, check that the number of arguments - * and the return type (returns a value or not) is correct. - * - ******************************************************************************/ - -static void -AnCheckForReservedMethod ( - ACPI_PARSE_OBJECT *Op, - ASL_METHOD_INFO *MethodInfo) -{ - UINT32 Index; - UINT32 RequiredArgsCurrent; - UINT32 RequiredArgsOld; - - - /* Check for a match against the reserved name list */ - - Index = AnCheckForReservedName (Op, Op->Asl.NameSeg); - - switch (Index) - { - case ACPI_NOT_RESERVED_NAME: - case ACPI_PREDEFINED_NAME: - case ACPI_COMPILER_RESERVED_NAME: - - /* Just return, nothing to do */ - break; - - - case ACPI_EVENT_RESERVED_NAME: - - Gbl_ReservedMethods++; - - /* NumArguments must be zero for all _Lxx, _Exx, and _Qxx methods */ - - if (MethodInfo->NumArguments != 0) - { - sprintf (MsgBuffer, "%s requires %d", - Op->Asl.ExternalName, 0); - - AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, MsgBuffer); - } - break; - - - default: - - Gbl_ReservedMethods++; - - /* - * Matched a reserved method name - * - * Validate the ASL-defined argument count. Allow two different legal - * arg counts. - */ - RequiredArgsCurrent = ReservedMethods[Index].NumArguments & 0x0F; - RequiredArgsOld = ReservedMethods[Index].NumArguments >> 4; - - if ((MethodInfo->NumArguments != RequiredArgsCurrent) && - (MethodInfo->NumArguments != RequiredArgsOld)) - { - sprintf (MsgBuffer, "%s requires %d", - ReservedMethods[Index].Name, - RequiredArgsCurrent); - - if (MethodInfo->NumArguments > RequiredArgsCurrent) - { - AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, - MsgBuffer); - } - else - { - AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_LO, Op, - MsgBuffer); - } - } - - if (MethodInfo->NumReturnNoValue && - ReservedMethods[Index].Flags & ASL_RSVD_RETURN_VALUE) - { - sprintf (MsgBuffer, "%s", ReservedMethods[Index].Name); - - AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Op, MsgBuffer); - } - break; - } -} - - /******************************************************************************* * * FUNCTION: AnMapObjTypeToBtype @@ -1187,7 +964,7 @@ AnMethodAnalysisWalkBegin ( * The first operand is a name to be created in the namespace. * Check against the reserved list. */ - i = AnCheckForReservedName (Op, Op->Asl.NameSeg); + i = ApCheckForPredefinedName (Op, Op->Asl.NameSeg); if (i < ACPI_VALID_RESERVED_NAME_MAX) { AslError (ASL_ERROR, ASL_MSG_RESERVED_USE, Op, Op->Asl.ExternalName); @@ -1197,51 +974,29 @@ AnMethodAnalysisWalkBegin ( case PARSEOP_NAME: - i = AnCheckForReservedName (Op, Op->Asl.NameSeg); - if (i < ACPI_VALID_RESERVED_NAME_MAX) + /* Typecheck any predefined names statically defined with Name() */ + + ApCheckForPredefinedObject (Op, Op->Asl.NameSeg); + + /* Special typechecking for _HID */ + + if (!ACPI_STRCMP (METHOD_NAME__HID, Op->Asl.NameSeg)) { - if (ReservedMethods[i].NumArguments > 0) + Next = Op->Asl.Child->Asl.Next; + if (Next->Asl.ParseOpcode == PARSEOP_STRING_LITERAL) { /* - * This reserved name must be a control method because - * it must have arguments + * _HID is a string, all characters must be alphanumeric. + * One of the things we want to catch here is the use of + * a leading asterisk in the string. */ - AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op, - "with arguments"); - } - - /* Typechecking for _HID */ - - else if (!ACPI_STRCMP (METHOD_NAME__HID, ReservedMethods[i].Name)) - { - /* Examine the second operand to typecheck it */ - - Next = Op->Asl.Child->Asl.Next; - - if ((Next->Asl.ParseOpcode != PARSEOP_INTEGER) && - (Next->Asl.ParseOpcode != PARSEOP_STRING_LITERAL)) + for (i = 0; Next->Asl.Value.String[i]; i++) { - /* _HID must be a string or an integer */ - - AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Next, - "String or Integer"); - } - - if (Next->Asl.ParseOpcode == PARSEOP_STRING_LITERAL) - { - /* - * _HID is a string, all characters must be alphanumeric. - * One of the things we want to catch here is the use of - * a leading asterisk in the string. - */ - for (i = 0; Next->Asl.Value.String[i]; i++) + if (!isalnum ((int) Next->Asl.Value.String[i])) { - if (!isalnum ((int) Next->Asl.Value.String[i])) - { - AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING, - Next, Next->Asl.Value.String); - break; - } + AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING, + Next, Next->Asl.Value.String); + break; } } } @@ -1394,7 +1149,7 @@ AnMethodAnalysisWalkEnd ( * Check predefined method names for correct return behavior * and correct number of arguments */ - AnCheckForReservedMethod (Op, MethodInfo); + ApCheckForPredefinedMethod (Op, MethodInfo); ACPI_FREE (MethodInfo); break; diff --git a/compiler/aslcompiler.h b/compiler/aslcompiler.h index 76bf51a8b95d..cf6c8f3ce018 100644 --- a/compiler/aslcompiler.h +++ b/compiler/aslcompiler.h @@ -452,8 +452,27 @@ ACPI_OBJECT_TYPE AslMapNamedOpcodeToDataType ( UINT16 Opcode); + +/* + * aslpredef - ACPI predefined names support + */ void -MpDisplayReservedNames ( +ApCheckForPredefinedMethod ( + ACPI_PARSE_OBJECT *Op, + ASL_METHOD_INFO *MethodInfo); + +UINT32 +ApCheckForPredefinedName ( + ACPI_PARSE_OBJECT *Op, + char *Name); + +void +ApCheckForPredefinedObject ( + ACPI_PARSE_OBJECT *Op, + char *Name); + +void +ApDisplayReservedNames ( void); diff --git a/compiler/aslglobal.h b/compiler/aslglobal.h index 69fcf8438a1e..01ab931e0d0d 100644 --- a/compiler/aslglobal.h +++ b/compiler/aslglobal.h @@ -261,7 +261,6 @@ ASL_EXTERN FILE *AcpiGbl_DebugFile; /* Placeholder for oswin ASL_EXTERN ASL_ANALYSIS_WALK_INFO AnalysisWalkInfo; ASL_EXTERN ACPI_TABLE_HEADER TableHeader; -extern const ASL_RESERVED_INFO ReservedMethods[]; /* Event timing */ diff --git a/compiler/aslmain.c b/compiler/aslmain.c index 45d7252c0a2f..59b5880e76da 100644 --- a/compiler/aslmain.c +++ b/compiler/aslmain.c @@ -570,7 +570,7 @@ AslDoOptions ( case 'r': /* reserved names */ - MpDisplayReservedNames (); + ApDisplayReservedNames (); exit (0); default: diff --git a/compiler/aslmap.c b/compiler/aslmap.c index 6b3019a72680..9eb3843529e6 100644 --- a/compiler/aslmap.c +++ b/compiler/aslmap.c @@ -114,7 +114,6 @@ * *****************************************************************************/ - #include "aslcompiler.h" #include "amlcode.h" #include "acparser.h" @@ -169,322 +168,6 @@ AslMapNamedOpcodeToDataType ( } -/******************************************************************************* - * - * FUNCTION: MpDisplayReservedNames - * - * PARAMETERS: None - * - * RETURN: None - * - * DESCRIPTION: Print the table above - * - ******************************************************************************/ - -void -MpDisplayReservedNames ( - void) -{ - UINT32 i; - - printf ("Reserved name information\n\n"); - - for (i = 0; ReservedMethods[i].Name; i++) - { - printf ("%s ", ReservedMethods[i].Name); - - if (ReservedMethods[i].Flags & ASL_RSVD_SCOPE) - { - printf ("Reserved scope name\n"); - } - else if (ReservedMethods[i].Flags & ASL_RSVD_RESOURCE_NAME) - { - printf ("Resource data type reserved field name\n"); - } - else - { - printf ("Method with %d arguments, ", - ReservedMethods[i].NumArguments & 0x0F); - - if (ReservedMethods[i].Flags & ASL_RSVD_RETURN_VALUE) - { - printf ("must return a value\n"); - } - else - { - printf ("no return value\n"); - } - } - } -} - - -/******************************************************************************* - * - * DATA STRUCTURE: ReservedMethods - * - * DESCRIPTION: Contains all reserved methods and names as defined in the - * ACPI specification. Used during the analysis phase to - * ensure that reserved methods have the required number of - * arguments and the proper return type. - * - * Each entry in the table contains the following items: - * - * Name - The ACPI reserved name - * Args - Number of arguments to the method - * Flags - Whether this method must return a value or not. Or if the - * name is a resource descriptor label. - * - ******************************************************************************/ - -const ASL_RESERVED_INFO ReservedMethods[] = { - {"_AC0", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC1", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC2", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC3", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC4", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC5", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC6", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC7", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC8", 0, ASL_RSVD_RETURN_VALUE}, - {"_AC9", 0, ASL_RSVD_RETURN_VALUE}, - {"_ADR", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL0", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL1", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL2", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL3", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL4", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL5", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL6", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL7", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL8", 0, ASL_RSVD_RETURN_VALUE}, - {"_AL9", 0, ASL_RSVD_RETURN_VALUE}, - {"_ALC", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_ALI", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_ALN", 0, ASL_RSVD_RESOURCE_NAME}, - {"_ALP", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_ALR", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_ALT", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_ART", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_ASI", 0, ASL_RSVD_RESOURCE_NAME}, - {"_ASZ", 0, ASL_RSVD_RESOURCE_NAME}, - {"_BAS", 0, ASL_RSVD_RESOURCE_NAME}, - {"_BBN", 0, ASL_RSVD_RETURN_VALUE}, - {"_BCL", 0, ASL_RSVD_RETURN_VALUE}, - {"_BCM", 1, 0}, - {"_BCT", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_BDN", 0, ASL_RSVD_RETURN_VALUE}, - {"_BFS", 1, 0}, - {"_BIF", 0, ASL_RSVD_RETURN_VALUE}, - {"_BIX", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_BLT", 3, 0}, /* Acpi 3.0 */ - {"_BM_", 0, ASL_RSVD_RESOURCE_NAME}, - {"_BMA", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_BMC", 1, 0}, /* Acpi 3.0 */ - {"_BMD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_BMS", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_BQC", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_BST", 0, ASL_RSVD_RETURN_VALUE}, - {"_BTM", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_BTP", 1, 0}, - {"_CBA", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_CDM", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_CID", 0, ASL_RSVD_RETURN_VALUE}, - {"_CRS", 0, ASL_RSVD_RETURN_VALUE}, - {"_CRT", 0, ASL_RSVD_RETURN_VALUE}, - {"_CSD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_CST", 0, ASL_RSVD_RETURN_VALUE}, - {"_DCK", 1, ASL_RSVD_RETURN_VALUE}, - {"_DCS", 0, ASL_RSVD_RETURN_VALUE}, - {"_DDC", 1, ASL_RSVD_RETURN_VALUE}, - {"_DDN", 0, 0}, - {"_DEC", 0, ASL_RSVD_RESOURCE_NAME}, - {"_DGS", 0, ASL_RSVD_RETURN_VALUE}, - {"_DIS", 0, 0}, - {"_DMA", 0, ASL_RSVD_RETURN_VALUE}, - {"_DOD", 0, ASL_RSVD_RETURN_VALUE}, - {"_DOS", 1, 0}, - {"_DSM", 4, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_DSS", 1, 0}, - {"_DSW", 3, 0}, /* Acpi 3.0 */ - {"_DTI", 1, 0}, /* Acpi 4.0 */ - {"_EC_", 0, ASL_RSVD_RETURN_VALUE}, - {"_EDL", 0, ASL_RSVD_RETURN_VALUE}, - {"_EJ0", 1, 0}, - {"_EJ1", 1, 0}, - {"_EJ2", 1, 0}, - {"_EJ3", 1, 0}, - {"_EJ4", 1, 0}, - {"_EJD", 0, ASL_RSVD_RETURN_VALUE}, - {"_ERR", 3, ASL_RSVD_RETURN_VALUE}, - {"_FDE", 0, ASL_RSVD_RETURN_VALUE}, - {"_FDI", 0, ASL_RSVD_RETURN_VALUE}, - {"_FDM", 1, 0}, - {"_FIF", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_FIX", 0, ASL_RSVD_RETURN_VALUE}, - {"_FPS", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_FSL", 1, 0}, /* Acpi 4.0 */ - {"_FST", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_GAI", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_GHL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_GL_", 0, ASL_RSVD_RETURN_VALUE}, - {"_GLK", 0, ASL_RSVD_RETURN_VALUE}, - {"_GPD", 0, ASL_RSVD_RETURN_VALUE}, - {"_GPE", 0, ASL_RSVD_RETURN_VALUE}, - {"_GRA", 0, ASL_RSVD_RESOURCE_NAME}, - {"_GSB", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_GTF", 0, ASL_RSVD_RETURN_VALUE}, - {"_GTM", 0, ASL_RSVD_RETURN_VALUE}, - {"_GTS", 1, 0}, - {"_HE_", 0, ASL_RSVD_RESOURCE_NAME}, - {"_HID", 0, ASL_RSVD_RETURN_VALUE}, - {"_HOT", 0, ASL_RSVD_RETURN_VALUE}, - {"_HPP", 0, ASL_RSVD_RETURN_VALUE}, - {"_HPX", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_IFT", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_INI", 0, 0}, - {"_INT", 0, ASL_RSVD_RESOURCE_NAME}, - {"_IRC", 0, 0}, - {"_LCK", 1, 0}, - {"_LEN", 0, ASL_RSVD_RESOURCE_NAME}, - {"_LID", 0, ASL_RSVD_RETURN_VALUE}, - {"_LL_", 0, ASL_RSVD_RESOURCE_NAME}, - {"_MAF", 0, ASL_RSVD_RESOURCE_NAME}, - {"_MAT", 0, ASL_RSVD_RETURN_VALUE}, - {"_MAX", 0, ASL_RSVD_RESOURCE_NAME}, - {"_MBM", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_MEM", 0, ASL_RSVD_RESOURCE_NAME}, - {"_MIF", 0, ASL_RSVD_RESOURCE_NAME}, - {"_MIN", 0, ASL_RSVD_RESOURCE_NAME}, - {"_MLS", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_MSG", 1, 0}, - {"_MSM", 4, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_MTP", 0, ASL_RSVD_RESOURCE_NAME}, - {"_NTT", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_OFF", 0, 0}, - {"_ON_", 0, 0}, - {"_OS_", 0, ASL_RSVD_RETURN_VALUE}, - {"_OSC", 4, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_OSI", 1, ASL_RSVD_RETURN_VALUE}, - {"_OST", 3, 0}, /* Acpi 3.0 */ - {"_PAI", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PCL", 0, ASL_RSVD_RETURN_VALUE}, - {"_PCT", 0, ASL_RSVD_RETURN_VALUE}, - {"_PDC", 1, 0}, - {"_PDL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PIC", 1, 0}, - {"_PIF", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PLD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_PMC", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PMD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PMM", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PPC", 0, ASL_RSVD_RETURN_VALUE}, - {"_PPE", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_PR0", 0, ASL_RSVD_RETURN_VALUE}, - {"_PR1", 0, ASL_RSVD_RETURN_VALUE}, - {"_PR2", 0, ASL_RSVD_RETURN_VALUE}, - {"_PR3", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PRL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PRS", 0, ASL_RSVD_RETURN_VALUE}, - {"_PRT", 0, ASL_RSVD_RETURN_VALUE}, - {"_PRW", 0, ASL_RSVD_RETURN_VALUE}, - {"_PS0", 0, 0}, - {"_PS1", 0, 0}, - {"_PS2", 0, 0}, - {"_PS3", 0, 0}, - {"_PSC", 0, ASL_RSVD_RETURN_VALUE}, - {"_PSD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_PSL", 0, ASL_RSVD_RETURN_VALUE}, - {"_PSR", 0, ASL_RSVD_RETURN_VALUE}, - {"_PSS", 0, ASL_RSVD_RETURN_VALUE}, - {"_PSV", 0, ASL_RSVD_RETURN_VALUE}, - {"_PSW", 1, 0}, - {"_PTC", 0, ASL_RSVD_RETURN_VALUE}, - {"_PTP", 2, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PTS", 1, 0}, - {"_PUR", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_PXM", 0, ASL_RSVD_RETURN_VALUE}, - {"_RBO", 0, ASL_RSVD_RESOURCE_NAME}, - {"_RBW", 0, ASL_RSVD_RESOURCE_NAME}, - {"_REG", 2, 0}, - {"_REV", 0, ASL_RSVD_RETURN_VALUE}, - {"_RMV", 0, ASL_RSVD_RETURN_VALUE}, - {"_RNG", 0, ASL_RSVD_RESOURCE_NAME}, - {"_ROM", 2, ASL_RSVD_RETURN_VALUE}, - {"_RT_", 0, ASL_RSVD_RESOURCE_NAME}, /* Acpi 3.0 */ - {"_RTV", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_RW_", 0, ASL_RSVD_RESOURCE_NAME}, - {"_S0_", 0, ASL_RSVD_RETURN_VALUE}, - {"_S1_", 0, ASL_RSVD_RETURN_VALUE}, - {"_S2_", 0, ASL_RSVD_RETURN_VALUE}, - {"_S3_", 0, ASL_RSVD_RETURN_VALUE}, - {"_S4_", 0, ASL_RSVD_RETURN_VALUE}, - {"_S5_", 0, ASL_RSVD_RETURN_VALUE}, - {"_S1D", 0, ASL_RSVD_RETURN_VALUE}, - {"_S2D", 0, ASL_RSVD_RETURN_VALUE}, - {"_S3D", 0, ASL_RSVD_RETURN_VALUE}, - {"_S4D", 0, ASL_RSVD_RETURN_VALUE}, - {"_S0W", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_S1W", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_S2W", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_S3W", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_S4W", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_SB_", 0, ASL_RSVD_SCOPE}, - {"_SBS", 0, ASL_RSVD_RETURN_VALUE}, - {"_SCP", 0x13, 0}, /* Acpi 1.0 - one arg; Acpi 3.0 - three args */ - {"_SDD", 1, 0}, /* Acpi 3.0 */ - {"_SEG", 0, ASL_RSVD_RETURN_VALUE}, - {"_SHL", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_SHR", 0, ASL_RSVD_RESOURCE_NAME}, - {"_SI_", 0, ASL_RSVD_SCOPE}, - {"_SIZ", 0, ASL_RSVD_RESOURCE_NAME}, - {"_SLI", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_SPD", 1, ASL_RSVD_RETURN_VALUE}, - {"_SRS", 1, 0}, - {"_SRV", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_SST", 1, 0}, - {"_STA", 0, ASL_RSVD_RETURN_VALUE}, - {"_STM", 3, 0}, - {"_STP", 2, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_STR", 0, ASL_RSVD_RETURN_VALUE}, - {"_STV", 2, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_SUN", 0, ASL_RSVD_RETURN_VALUE}, - {"_SWS", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_TC1", 0, ASL_RSVD_RETURN_VALUE}, - {"_TC2", 0, ASL_RSVD_RETURN_VALUE}, - {"_TDL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0b */ - {"_TIP", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_TIV", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ - {"_TMP", 0, ASL_RSVD_RETURN_VALUE}, - {"_TPC", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_TPT", 1, 0}, /* Acpi 3.0 */ - {"_TRA", 0, ASL_RSVD_RESOURCE_NAME}, - {"_TRS", 0, ASL_RSVD_RESOURCE_NAME}, - {"_TRT", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_TSD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_TSF", 0, ASL_RSVD_RESOURCE_NAME}, /* Acpi 3.0 */ - {"_TSP", 0, ASL_RSVD_RETURN_VALUE}, - {"_TSS", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_TST", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_TTP", 0, ASL_RSVD_RESOURCE_NAME}, - {"_TTS", 1, 0}, /* Acpi 3.0 */ - {"_TYP", 0, ASL_RSVD_RESOURCE_NAME}, - {"_TZ_", 0, ASL_RSVD_SCOPE}, - {"_TZD", 0, ASL_RSVD_RETURN_VALUE}, - {"_TZM", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_TZP", 0, ASL_RSVD_RETURN_VALUE}, - {"_UID", 0, ASL_RSVD_RETURN_VALUE}, - {"_UPC", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_UPD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_UPP", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ - {"_VPO", 0, ASL_RSVD_RETURN_VALUE}, - {"_WAK", 1, ASL_RSVD_RETURN_VALUE}, - {"_WDG", 0, ASL_RSVD_RETURN_VALUE}, /* MS Extension */ - {"_WED", 1, ASL_RSVD_RETURN_VALUE}, /* MS Extension */ - {NULL, 0, 0}, -}; - - /******************************************************************************* * * DATA STRUCTURE: AslKeywordMapping diff --git a/compiler/aslpredef.c b/compiler/aslpredef.c new file mode 100644 index 000000000000..04cd2d405c14 --- /dev/null +++ b/compiler/aslpredef.c @@ -0,0 +1,706 @@ +/****************************************************************************** + * + * Module Name: aslpredef - support for ACPI predefined names + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#define ACPI_CREATE_PREDEFINED_TABLE + +#include "aslcompiler.h" +#include "aslcompiler.y.h" +#include "amlcode.h" +#include "acparser.h" +#include "acpredef.h" + + +#define _COMPONENT ACPI_COMPILER + ACPI_MODULE_NAME ("aslpredef") + + +/* Local prototypes */ + +static UINT32 +ApCheckForSpecialName ( + ACPI_PARSE_OBJECT *Op, + char *Name); + +static void +ApCheckObjectType ( + ACPI_PARSE_OBJECT *Op, + UINT32 ExpectedBtypes); + +static void +ApGetExpectedTypes ( + char *Buffer, + UINT32 ExpectedBtypes); + + +/* + * Names for the types that can be returned by the predefined objects. + * Used for warning messages. Must be in the same order as the ACPI_RTYPEs + */ +static const char *AcpiRtypeNames[] = +{ + "/Integer", + "/String", + "/Buffer", + "/Package", + "/Reference", +}; + +/* + * Predefined names for use in Resource Descriptors. These names do not + * appear in the global Predefined Name table (since these names never + * appear in actual AML byte code, only in the original ASL) + */ +static const ACPI_PREDEFINED_INFO ResourceNames[] = { + {{"_ALN", 0, 0}}, + {{"_ASI", 0, 0}}, + {{"_ASZ", 0, 0}}, + {{"_ATT", 0, 0}}, + {{"_BAS", 0, 0}}, + {{"_BM_", 0, 0}}, + {{"_DEC", 0, 0}}, + {{"_GRA", 0, 0}}, + {{"_HE_", 0, 0}}, + {{"_INT", 0, 0}}, + {{"_LEN", 0, 0}}, + {{"_LL_", 0, 0}}, + {{"_MAF", 0, 0}}, + {{"_MAX", 0, 0}}, + {{"_MEM", 0, 0}}, + {{"_MIF", 0, 0}}, + {{"_MIN", 0, 0}}, + {{"_MTP", 0, 0}}, + {{"_RBO", 0, 0}}, + {{"_RBW", 0, 0}}, + {{"_RNG", 0, 0}}, + {{"_RT_", 0, 0}}, /* Acpi 3.0 */ + {{"_RW_", 0, 0}}, + {{"_SHR", 0, 0}}, + {{"_SIZ", 0, 0}}, + {{"_TRA", 0, 0}}, + {{"_TRS", 0, 0}}, + {{"_TSF", 0, 0}}, /* Acpi 3.0 */ + {{"_TTP", 0, 0}}, + {{"_TYP", 0, 0}}, + {{{0,0,0,0}, 0, 0}} /* Table terminator */ +}; + +static const ACPI_PREDEFINED_INFO ScopeNames[] = { + {{"_SB_", 0, 0}}, + {{"_SI_", 0, 0}}, + {{"_TZ_", 0, 0}}, + {{{0,0,0,0}, 0, 0}} /* Table terminator */ +}; + + +/******************************************************************************* + * + * FUNCTION: ApCheckForPredefinedMethod + * + * PARAMETERS: Op - A parse node of type "METHOD". + * MethodInfo - Saved info about this method + * + * RETURN: None + * + * DESCRIPTION: If method is a predefined name, check that the number of + * arguments and the return type (returns a value or not) + * is correct. + * + ******************************************************************************/ + +void +ApCheckForPredefinedMethod ( + ACPI_PARSE_OBJECT *Op, + ASL_METHOD_INFO *MethodInfo) +{ + UINT32 Index; + UINT32 RequiredArgsCurrent; + UINT32 RequiredArgsOld; + + + /* Check for a match against the predefined name list */ + + Index = ApCheckForPredefinedName (Op, Op->Asl.NameSeg); + + switch (Index) + { + case ACPI_NOT_RESERVED_NAME: /* No underscore or _Txx or _xxx name not matched */ + case ACPI_PREDEFINED_NAME: /* Resource Name or reserved scope name */ + case ACPI_COMPILER_RESERVED_NAME: /* A _Txx that was not emitted by compiler */ + + /* Just return, nothing to do */ + break; + + + case ACPI_EVENT_RESERVED_NAME: /* _Lxx, _Exx, and _Qxx methods */ + + Gbl_ReservedMethods++; + + /* NumArguments must be zero for all _Lxx, _Exx, and _Qxx methods */ + + if (MethodInfo->NumArguments != 0) + { + sprintf (MsgBuffer, "%s requires %d", Op->Asl.ExternalName, 0); + + AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, + MsgBuffer); + } + break; + + + default: + /* + * Matched a predefined method name + * + * Validate the ASL-defined argument count. Allow two different legal + * arg counts. + */ + Gbl_ReservedMethods++; + + RequiredArgsCurrent = PredefinedNames[Index].Info.ParamCount & 0x0F; + RequiredArgsOld = PredefinedNames[Index].Info.ParamCount >> 4; + + if ((MethodInfo->NumArguments != RequiredArgsCurrent) && + (MethodInfo->NumArguments != RequiredArgsOld)) + { + sprintf (MsgBuffer, "%4.4s requires %d", + PredefinedNames[Index].Info.Name, RequiredArgsCurrent); + + if (MethodInfo->NumArguments > RequiredArgsCurrent) + { + AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, + MsgBuffer); + } + else + { + AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_LO, Op, + MsgBuffer); + } + } + + /* + * Check if method returns no value, but the predefined name is + * required to return a value + */ + if (MethodInfo->NumReturnNoValue && + PredefinedNames[Index].Info.ExpectedBtypes) + { + sprintf (MsgBuffer, "%4.4s", PredefinedNames[Index].Info.Name); + + AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Op, + MsgBuffer); + } + break; + } +} + + +/******************************************************************************* + * + * FUNCTION: ApCheckForPredefinedObject + * + * PARAMETERS: Op - A parse node + * Name - The ACPI name to be checked + * + * RETURN: None + * + * DESCRIPTION: Check for a predefined name for a static object (created via + * the ASL Name operator). If it is a predefined ACPI name, ensure + * that the name does not require any arguments (which would + * require a control method implemenation of the name), and that + * the type of the object is one of the expected types for the + * predefined name. + * + ******************************************************************************/ + +void +ApCheckForPredefinedObject ( + ACPI_PARSE_OBJECT *Op, + char *Name) +{ + UINT32 Index; + + + /* + * Check for a real predefined name -- not a resource descriptor name + * or a predefined scope name + */ + Index = ApCheckForPredefinedName (Op, Name); + if (Index > ACPI_VALID_RESERVED_NAME_MAX) + { + return; + } + + /* + * We found a matching predefind name. + * Check if this predefined name requires input arguments + */ + if (PredefinedNames[Index].Info.ParamCount > 0) + { + /* + * This predefined name must always be defined as a control + * method because it is required to have input arguments. + */ + AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op, + "with arguments"); + } + + /* Typecheck the actual object, it is the next argument */ + + ApCheckObjectType (Op->Asl.Child->Asl.Next, + PredefinedNames[Index].Info.ExpectedBtypes); +} + + +/******************************************************************************* + * + * FUNCTION: ApCheckForPredefinedName + * + * PARAMETERS: Op - A parse node + * Name - NameSeg to check + * + * RETURN: None + * + * DESCRIPTION: Check a NameSeg against the reserved list. + * + ******************************************************************************/ + +UINT32 +ApCheckForPredefinedName ( + ACPI_PARSE_OBJECT *Op, + char *Name) +{ + UINT32 i; + + + if (Name[0] == 0) + { + AcpiOsPrintf ("Found a null name, external = %s\n", + Op->Asl.ExternalName); + } + + /* All reserved names are prefixed with a single underscore */ + + if (Name[0] != '_') + { + return (ACPI_NOT_RESERVED_NAME); + } + + /* Check for a standard predefined method name */ + + for (i = 0; PredefinedNames[i].Info.Name[0]; i++) + { + if (ACPI_COMPARE_NAME (Name, PredefinedNames[i].Info.Name)) + { + /* Return index into predefined array */ + return (i); + } + } + + /* Check for resource names and predefined scope names */ + + for (i = 0; ResourceNames[i].Info.Name[0]; i++) + { + if (ACPI_COMPARE_NAME (Name, ResourceNames[i].Info.Name)) + { + return (ACPI_PREDEFINED_NAME); + } + } + + for (i = 0; ScopeNames[i].Info.Name[0]; i++) + { + if (ACPI_COMPARE_NAME (Name, ScopeNames[i].Info.Name)) + { + return (ACPI_PREDEFINED_NAME); + } + } + + /* Check for _Lxx, _Exx, _Qxx, _T_x. Warning if unknown predefined name */ + + return (ApCheckForSpecialName (Op, Name)); +} + + +/******************************************************************************* + * + * FUNCTION: ApCheckForSpecialName + * + * PARAMETERS: Op - A parse node + * Name - NameSeg to check + * + * RETURN: None + * + * DESCRIPTION: Check for the "special" predefined names - + * _Lxx, _Exx, _Qxx, and _T_x + * + ******************************************************************************/ + +static UINT32 +ApCheckForSpecialName ( + ACPI_PARSE_OBJECT *Op, + char *Name) +{ + + /* + * Check for the "special" predefined names. We know the first char is an + * underscore already. + * GPE: _Lxx + * GPE: _Exx + * EC: _Qxx + */ + if ((Name[1] == 'L') || + (Name[1] == 'E') || + (Name[1] == 'Q')) + { + /* The next two characters must be hex digits */ + + if ((isxdigit ((int) Name[2])) && + (isxdigit ((int) Name[3]))) + { + return (ACPI_EVENT_RESERVED_NAME); + } + } + + /* Check for the names reserved for the compiler itself: _T_x */ + + else if ((Op->Asl.ExternalName[1] == 'T') && + (Op->Asl.ExternalName[2] == '_')) + { + /* Ignore if actually emitted by the compiler */ + + if (Op->Asl.CompileFlags & NODE_COMPILER_EMITTED) + { + return (ACPI_NOT_RESERVED_NAME); + } + + /* + * Was not actually emitted by the compiler. This is a special case, + * however. If the ASL code being compiled was the result of a + * dissasembly, it may possibly contain valid compiler-emitted names + * of the form "_T_x". We don't want to issue an error or even a + * warning and force the user to manually change the names. So, we + * will issue a remark instead. + */ + AslError (ASL_REMARK, ASL_MSG_COMPILER_RESERVED, Op, Op->Asl.ExternalName); + return (ACPI_COMPILER_RESERVED_NAME); + } + + /* + * The name didn't match any of the known predefined names. Flag it as a + * warning, since the entire namespace starting with an underscore is + * reserved by the ACPI spec. + */ + AslError (ASL_WARNING, ASL_MSG_UNKNOWN_RESERVED_NAME, Op, + Op->Asl.ExternalName); + + return (ACPI_NOT_RESERVED_NAME); +} + + +/******************************************************************************* + * + * FUNCTION: ApCheckObjectType + * + * PARAMETERS: Op - A parse node + * ExpectedBtypes - Bitmap of expected return type(s) + * + * RETURN: None + * + * DESCRIPTION: Check if the object type is one of the types that is expected + * by the predefined name. Only a limited number of object types + * can be returned by the predefined names. + * + ******************************************************************************/ + +static void +ApCheckObjectType ( + ACPI_PARSE_OBJECT *Op, + UINT32 ExpectedBtypes) +{ + UINT32 ReturnBtype; + char TypeBuffer[48]; /* Room for 5 types */ + + + switch (Op->Asl.ParseOpcode) + { + case PARSEOP_INTEGER: + ReturnBtype = ACPI_RTYPE_INTEGER; + break; + + case PARSEOP_BUFFER: + ReturnBtype = ACPI_RTYPE_BUFFER; + break; + + case PARSEOP_STRING_LITERAL: + ReturnBtype = ACPI_RTYPE_STRING; + break; + + case PARSEOP_PACKAGE: + ReturnBtype = ACPI_RTYPE_PACKAGE; + break; + + default: + /* Not one of the supported object types */ + + goto TypeErrorExit; + } + + /* Is the object one of the expected types? */ + + if (ReturnBtype & ExpectedBtypes) + { + return; + } + + +TypeErrorExit: + + /* Format the expected types and emit an error message */ + + ApGetExpectedTypes (TypeBuffer, ExpectedBtypes); + + AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, + TypeBuffer); +} + + +/******************************************************************************* + * + * FUNCTION: ApDisplayReservedNames + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Dump information about the ACPI predefined names and predefined + * resource descriptor names. + * + ******************************************************************************/ + +void +ApDisplayReservedNames ( + void) +{ + const ACPI_PREDEFINED_INFO *ThisName; + char TypeBuffer[48]; /* Room for 5 types */ + UINT32 Count; + + + /* + * Predefined names/methods + */ + printf ("\nPredefined Name Information\n\n"); + + Count = 0; + ThisName = PredefinedNames; + while (ThisName->Info.Name[0]) + { + printf ("%4.4s Requires %d arguments, ", + ThisName->Info.Name, ThisName->Info.ParamCount & 0x0F); + + if (ThisName->Info.ExpectedBtypes) + { + ApGetExpectedTypes (TypeBuffer, ThisName->Info.ExpectedBtypes); + printf ("Must return: %s\n", TypeBuffer); + } + else + { + printf ("No return value\n"); + } + + /* + * Skip next entry in the table if this name returns a Package + * (next entry contains the package info) + */ + if (ThisName->Info.ExpectedBtypes & ACPI_RTYPE_PACKAGE) + { + ThisName++; + } + + Count++; + ThisName++; + } + + printf ("%u Predefined Names are recognized\n", Count); + + /* + * Resource Descriptor names + */ + printf ("\nResource Descriptor Predefined Names\n\n"); + + Count = 0; + ThisName = ResourceNames; + while (ThisName->Info.Name[0]) + { + printf ("%4.4s Resource Descriptor\n", ThisName->Info.Name); + Count++; + ThisName++; + } + + printf ("%u Resource Descriptor Names are recognized\n", Count); + + /* + * Predefined scope names + */ + printf ("\nPredefined Scope Names\n\n"); + + ThisName = ScopeNames; + while (ThisName->Info.Name[0]) + { + printf ("%4.4s Scope\n", ThisName->Info.Name); + ThisName++; + } +} + + +/******************************************************************************* + * + * FUNCTION: ApGetExpectedTypes + * + * PARAMETERS: Buffer - Where the formatted string is returned + * ExpectedBTypes - Bitfield of expected data types + * + * RETURN: None, formatted string + * + * DESCRIPTION: Format the expected object types into a printable string. + * + ******************************************************************************/ + +static void +ApGetExpectedTypes ( + char *Buffer, + UINT32 ExpectedBtypes) +{ + UINT32 ThisRtype; + UINT32 i; + UINT32 j; + + + j = 1; + Buffer[0] = 0; + ThisRtype = ACPI_RTYPE_INTEGER; + + for (i = 0; i < ACPI_NUM_RTYPES; i++) + { + /* If one of the expected types, concatenate the name of this type */ + + if (ExpectedBtypes & ThisRtype) + { + ACPI_STRCAT (Buffer, &AcpiRtypeNames[i][j]); + j = 0; /* Use name separator from now on */ + } + ThisRtype <<= 1; /* Next Rtype */ + } +} + diff --git a/compiler/aslstubs.c b/compiler/aslstubs.c index 66e3c0cce0d8..8f3de7e83b4a 100644 --- a/compiler/aslstubs.c +++ b/compiler/aslstubs.c @@ -250,6 +250,15 @@ AcpiEvCheckForWakeOnlyGpe ( return (AE_OK); } +void +AcpiExDoDebugObject ( + ACPI_OPERAND_OBJECT *SourceDesc, + UINT32 Level, + UINT32 Index) +{ + return; +} + ACPI_STATUS AcpiExReadDataFromField ( ACPI_WALK_STATE *WalkState, @@ -276,7 +285,6 @@ AcpiExLoadTableOp ( return (AE_SUPPORT); } - ACPI_STATUS AcpiExUnloadTable ( ACPI_OPERAND_OBJECT *DdbHandle) diff --git a/compiler/asltypes.h b/compiler/asltypes.h index 9e1d426d2b75..6edf9870680a 100644 --- a/compiler/asltypes.h +++ b/compiler/asltypes.h @@ -188,21 +188,6 @@ typedef struct asl_mapping_entry } ASL_MAPPING_ENTRY; -/* An entry in the Reserved Name information table */ - -#define ASL_RSVD_RETURN_VALUE 0x01 -#define ASL_RSVD_RESOURCE_NAME 0x02 -#define ASL_RSVD_SCOPE 0x04 - -typedef struct asl_reserved_info -{ - char *Name; - UINT8 NumArguments; - UINT8 Flags; - -} ASL_RESERVED_INFO; - - /* Parse tree walk info structure */ typedef struct asl_walk_info @@ -522,7 +507,7 @@ char *AslMessages [] = { /* ASL_MSG_RESERVED_ARG_COUNT_HI */ "Reserved method has too many arguments", /* ASL_MSG_RESERVED_ARG_COUNT_LO */ "Reserved method has too few arguments", /* ASL_MSG_RESERVED_METHOD */ "Reserved name must be a control method", -/* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid operand type for reserved name, must be", +/* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid object type for reserved name, must be", /* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value", /* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name", /* ASL_MSG_RESERVED_WORD */ "Use of reserved name", diff --git a/dispatcher/dsfield.c b/dispatcher/dsfield.c index 8453c8808711..23e33782d54d 100644 --- a/dispatcher/dsfield.c +++ b/dispatcher/dsfield.c @@ -424,7 +424,7 @@ AcpiDsGetFieldNames ( default: ACPI_ERROR ((AE_INFO, - "Invalid opcode in field list: %X", Arg->Common.AmlOpcode)); + "Invalid opcode in field list: 0x%X", Arg->Common.AmlOpcode)); return_ACPI_STATUS (AE_AML_BAD_OPCODE); } diff --git a/dispatcher/dsmethod.c b/dispatcher/dsmethod.c index 29153b0754a0..969c9ca23e39 100644 --- a/dispatcher/dsmethod.c +++ b/dispatcher/dsmethod.c @@ -318,7 +318,7 @@ AcpiDsBeginMethodExecution ( (WalkState->Thread->CurrentSyncLevel > ObjDesc->Method.Mutex->Mutex.SyncLevel)) { ACPI_ERROR ((AE_INFO, - "Cannot acquire Mutex for method [%4.4s], current SyncLevel is too large (%d)", + "Cannot acquire Mutex for method [%4.4s], current SyncLevel is too large (%u)", AcpiUtGetNodeName (MethodNode), WalkState->Thread->CurrentSyncLevel)); diff --git a/dispatcher/dsmthdat.c b/dispatcher/dsmthdat.c index 128308286ca1..54678921bc1b 100644 --- a/dispatcher/dsmthdat.c +++ b/dispatcher/dsmthdat.c @@ -363,7 +363,7 @@ AcpiDsMethodDataGetNode ( if (Index > ACPI_METHOD_MAX_LOCAL) { ACPI_ERROR ((AE_INFO, - "Local index %d is invalid (max %d)", + "Local index %u is invalid (max %u)", Index, ACPI_METHOD_MAX_LOCAL)); return_ACPI_STATUS (AE_AML_INVALID_INDEX); } @@ -378,7 +378,7 @@ AcpiDsMethodDataGetNode ( if (Index > ACPI_METHOD_MAX_ARG) { ACPI_ERROR ((AE_INFO, - "Arg index %d is invalid (max %d)", + "Arg index %u is invalid (max %u)", Index, ACPI_METHOD_MAX_ARG)); return_ACPI_STATUS (AE_AML_INVALID_INDEX); } @@ -389,7 +389,7 @@ AcpiDsMethodDataGetNode ( break; default: - ACPI_ERROR ((AE_INFO, "Type %d is invalid", Type)); + ACPI_ERROR ((AE_INFO, "Type %u is invalid", Type)); return_ACPI_STATUS (AE_TYPE); } @@ -540,7 +540,7 @@ AcpiDsMethodDataGetValue ( case ACPI_REFCLASS_ARG: ACPI_ERROR ((AE_INFO, - "Uninitialized Arg[%d] at node %p", + "Uninitialized Arg[%u] at node %p", Index, Node)); return_ACPI_STATUS (AE_AML_UNINITIALIZED_ARG); @@ -555,7 +555,7 @@ AcpiDsMethodDataGetValue ( default: - ACPI_ERROR ((AE_INFO, "Not a Arg/Local opcode: %X", Type)); + ACPI_ERROR ((AE_INFO, "Not a Arg/Local opcode: 0x%X", Type)); return_ACPI_STATUS (AE_AML_INTERNAL); } } diff --git a/dispatcher/dsobject.c b/dispatcher/dsobject.c index 2796f66c70f4..3d8fce40390b 100644 --- a/dispatcher/dsobject.c +++ b/dispatcher/dsobject.c @@ -365,7 +365,7 @@ AcpiDsBuildInternalBufferObj ( if (ByteList->Common.AmlOpcode != AML_INT_BYTELIST_OP) { ACPI_ERROR ((AE_INFO, - "Expecting bytelist, got AML opcode %X in op %p", + "Expecting bytelist, found AML opcode 0x%X in op %p", ByteList->Common.AmlOpcode, ByteList)); AcpiUtRemoveReference (ObjDesc); @@ -599,7 +599,7 @@ AcpiDsBuildInternalPackageObj ( } ACPI_INFO ((AE_INFO, - "Actual Package length (0x%X) is larger than NumElements field (0x%X), truncated\n", + "Actual Package length (%u) is larger than NumElements field (%u), truncated\n", i, ElementCount)); } else if (i < ElementCount) @@ -609,7 +609,7 @@ AcpiDsBuildInternalPackageObj ( * Note: this is not an error, the package is padded out with NULLs. */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Package List length (0x%X) smaller than NumElements count (0x%X), padded with null elements\n", + "Package List length (%u) smaller than NumElements count (%u), padded with null elements\n", i, ElementCount)); } @@ -804,7 +804,7 @@ AcpiDsInitObjectFromOp ( default: ACPI_ERROR ((AE_INFO, - "Unknown constant opcode %X", Opcode)); + "Unknown constant opcode 0x%X", Opcode)); Status = AE_AML_OPERAND_TYPE; break; } @@ -821,7 +821,7 @@ AcpiDsInitObjectFromOp ( default: - ACPI_ERROR ((AE_INFO, "Unknown Integer type %X", + ACPI_ERROR ((AE_INFO, "Unknown Integer type 0x%X", OpInfo->Type)); Status = AE_AML_OPERAND_TYPE; break; @@ -902,7 +902,7 @@ AcpiDsInitObjectFromOp ( default: ACPI_ERROR ((AE_INFO, - "Unimplemented reference type for AML opcode: %4.4X", Opcode)); + "Unimplemented reference type for AML opcode: 0x%4.4X", Opcode)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } break; @@ -912,7 +912,7 @@ AcpiDsInitObjectFromOp ( default: - ACPI_ERROR ((AE_INFO, "Unimplemented data type: %X", + ACPI_ERROR ((AE_INFO, "Unimplemented data type: 0x%X", ObjDesc->Common.Type)); Status = AE_AML_OPERAND_TYPE; diff --git a/dispatcher/dsopcode.c b/dispatcher/dsopcode.c index 328a350092a5..e7ebc765301a 100644 --- a/dispatcher/dsopcode.c +++ b/dispatcher/dsopcode.c @@ -395,7 +395,7 @@ AcpiDsGetBufferArguments ( if (!Node) { ACPI_ERROR ((AE_INFO, - "No pointer back to NS node in buffer obj %p", ObjDesc)); + "No pointer back to namespace node in buffer object %p", ObjDesc)); return_ACPI_STATUS (AE_AML_INTERNAL); } @@ -444,7 +444,7 @@ AcpiDsGetPackageArguments ( if (!Node) { ACPI_ERROR ((AE_INFO, - "No pointer back to NS node in package %p", ObjDesc)); + "No pointer back to namespace node in package %p", ObjDesc)); return_ACPI_STATUS (AE_AML_INTERNAL); } @@ -678,7 +678,7 @@ AcpiDsInitBufferField ( default: ACPI_ERROR ((AE_INFO, - "Unknown field creation opcode %02x", + "Unknown field creation opcode 0x%02X", AmlOpcode)); Status = AE_AML_BAD_OPCODE; goto Cleanup; @@ -690,7 +690,7 @@ AcpiDsInitBufferField ( (8 * (UINT32) BufferDesc->Buffer.Length)) { ACPI_ERROR ((AE_INFO, - "Field [%4.4s] at %d exceeds Buffer [%4.4s] size %d (bits)", + "Field [%4.4s] at %u exceeds Buffer [%4.4s] size %u (bits)", AcpiUtGetNodeName (ResultDesc), BitOffset + BitCount, AcpiUtGetNodeName (BufferDesc->Buffer.Node), @@ -806,7 +806,7 @@ AcpiDsEvalBufferFieldOperands ( ACPI_WALK_OPERANDS, WalkState); if (ACPI_FAILURE (Status)) { - ACPI_ERROR ((AE_INFO, "(%s) bad operand(s) (%X)", + ACPI_ERROR ((AE_INFO, "(%s) bad operand(s), status 0x%X", AcpiPsGetOpcodeName (Op->Common.AmlOpcode), Status)); return_ACPI_STATUS (Status); @@ -1607,7 +1607,7 @@ AcpiDsExecEndControlOp ( default: - ACPI_ERROR ((AE_INFO, "Unknown control opcode=%X Op=%p", + ACPI_ERROR ((AE_INFO, "Unknown control opcode=0x%X Op=%p", Op->Common.AmlOpcode, Op)); Status = AE_AML_BAD_OPCODE; diff --git a/dispatcher/dswexec.c b/dispatcher/dswexec.c index d4b3f0c9280c..3c1f85e261d1 100644 --- a/dispatcher/dswexec.c +++ b/dispatcher/dswexec.c @@ -227,7 +227,7 @@ AcpiDsGetPredicateValue ( if (LocalObjDesc->Common.Type != ACPI_TYPE_INTEGER) { ACPI_ERROR ((AE_INFO, - "Bad predicate (not an integer) ObjDesc=%p State=%p Type=%X", + "Bad predicate (not an integer) ObjDesc=%p State=%p Type=0x%X", ObjDesc, WalkState, ObjDesc->Common.Type)); Status = AE_AML_OPERAND_TYPE; @@ -463,7 +463,7 @@ AcpiDsExecEndOp ( if (OpClass == AML_CLASS_UNKNOWN) { - ACPI_ERROR ((AE_INFO, "Unknown opcode %X", Op->Common.AmlOpcode)); + ACPI_ERROR ((AE_INFO, "Unknown opcode 0x%X", Op->Common.AmlOpcode)); return_ACPI_STATUS (AE_NOT_IMPLEMENTED); } @@ -783,7 +783,7 @@ AcpiDsExecEndOp ( default: ACPI_ERROR ((AE_INFO, - "Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p", + "Unimplemented opcode, class=0x%X type=0x%X Opcode=-0x%X Op=%p", OpClass, OpType, Op->Common.AmlOpcode, Op)); Status = AE_NOT_IMPLEMENTED; diff --git a/dispatcher/dswstate.c b/dispatcher/dswstate.c index ffe2895fa8e7..91f019f6d168 100644 --- a/dispatcher/dswstate.c +++ b/dispatcher/dswstate.c @@ -277,7 +277,7 @@ AcpiDsResultPush ( if (!Object) { ACPI_ERROR ((AE_INFO, - "Null Object! Obj=%p State=%p Num=%X", + "Null Object! Obj=%p State=%p Num=%u", Object, WalkState, WalkState->ResultCount)); return (AE_BAD_PARAMETER); } @@ -323,7 +323,7 @@ AcpiDsResultStackPush ( if (((UINT32) WalkState->ResultSize + ACPI_RESULTS_FRAME_OBJ_NUM) > ACPI_RESULTS_OBJ_NUM_MAX) { - ACPI_ERROR ((AE_INFO, "Result stack overflow: State=%p Num=%X", + ACPI_ERROR ((AE_INFO, "Result stack overflow: State=%p Num=%u", WalkState, WalkState->ResultSize)); return (AE_STACK_OVERFLOW); } @@ -426,7 +426,7 @@ AcpiDsObjStackPush ( if (WalkState->NumOperands >= ACPI_OBJ_NUM_OPERANDS) { ACPI_ERROR ((AE_INFO, - "Object stack overflow! Obj=%p State=%p #Ops=%X", + "Object stack overflow! Obj=%p State=%p #Ops=%u", Object, WalkState, WalkState->NumOperands)); return (AE_STACK_OVERFLOW); } @@ -480,7 +480,7 @@ AcpiDsObjStackPop ( if (WalkState->NumOperands == 0) { ACPI_ERROR ((AE_INFO, - "Object stack underflow! Count=%X State=%p #Ops=%X", + "Object stack underflow! Count=%X State=%p #Ops=%u", PopCount, WalkState, WalkState->NumOperands)); return (AE_STACK_UNDERFLOW); } @@ -491,7 +491,7 @@ AcpiDsObjStackPop ( WalkState->Operands [WalkState->NumOperands] = NULL; } - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Count=%X State=%p #Ops=%X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Count=%X State=%p #Ops=%u\n", PopCount, WalkState, WalkState->NumOperands)); return (AE_OK); diff --git a/events/evevent.c b/events/evevent.c index 05cc4cd8b739..d9715a8232e3 100644 --- a/events/evevent.c +++ b/events/evevent.c @@ -415,7 +415,7 @@ AcpiEvFixedEventDispatch ( ACPI_DISABLE_EVENT); ACPI_ERROR ((AE_INFO, - "No installed handler for fixed event [%08X]", + "No installed handler for fixed event [0x%08X]", Event)); return (ACPI_INTERRUPT_NOT_HANDLED); diff --git a/events/evgpe.c b/events/evgpe.c index de1f861d5d92..41efada245e6 100644 --- a/events/evgpe.c +++ b/events/evgpe.c @@ -803,7 +803,7 @@ AcpiEvGpeDispatch ( if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, - "Unable to clear GPE[%2X]", GpeNumber)); + "Unable to clear GPE[0x%2X]", GpeNumber)); return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED); } } @@ -836,7 +836,7 @@ AcpiEvGpeDispatch ( if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, - "Unable to clear GPE[%2X]", GpeNumber)); + "Unable to clear GPE[0x%2X]", GpeNumber)); return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED); } } @@ -852,7 +852,7 @@ AcpiEvGpeDispatch ( if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, - "Unable to disable GPE[%2X]", GpeNumber)); + "Unable to disable GPE[0x%2X]", GpeNumber)); return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED); } @@ -865,7 +865,7 @@ AcpiEvGpeDispatch ( if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, - "Unable to queue handler for GPE[%2X] - event disabled", + "Unable to queue handler for GPE[0x%2X] - event disabled", GpeNumber)); } break; @@ -875,7 +875,7 @@ AcpiEvGpeDispatch ( /* No handler or method to run! */ ACPI_ERROR ((AE_INFO, - "No handler or method for GPE[%2X], disabling event", + "No handler or method for GPE[0x%2X], disabling event", GpeNumber)); /* @@ -886,7 +886,7 @@ AcpiEvGpeDispatch ( if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, - "Unable to disable GPE[%2X]", GpeNumber)); + "Unable to disable GPE[0x%2X]", GpeNumber)); return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED); } break; diff --git a/events/evgpeblk.c b/events/evgpeblk.c index 10f48a5d9139..be6d45b5dc37 100644 --- a/events/evgpeblk.c +++ b/events/evgpeblk.c @@ -1337,8 +1337,8 @@ AcpiEvGpeInitialize ( (GpeNumberMax >= AcpiGbl_FADT.Gpe1Base)) { ACPI_ERROR ((AE_INFO, - "GPE0 block (GPE 0 to %d) overlaps the GPE1 block " - "(GPE %d to %d) - Ignoring GPE1", + "GPE0 block (GPE 0 to %u) overlaps the GPE1 block " + "(GPE %u to %u) - Ignoring GPE1", GpeNumberMax, AcpiGbl_FADT.Gpe1Base, AcpiGbl_FADT.Gpe1Base + ((RegisterCount1 * ACPI_GPE_REGISTER_WIDTH) - 1))); diff --git a/events/evmisc.c b/events/evmisc.c index 62f549d1cadf..b0e1cac144f4 100644 --- a/events/evmisc.c +++ b/events/evmisc.c @@ -696,7 +696,7 @@ AcpiEvTerminate ( if (ACPI_FAILURE (Status)) { ACPI_ERROR ((AE_INFO, - "Could not disable fixed event %d", (UINT32) i)); + "Could not disable fixed event %u", (UINT32) i)); } } diff --git a/events/evxface.c b/events/evxface.c index 3ca00215e84e..051e5bf4a7f8 100644 --- a/events/evxface.c +++ b/events/evxface.c @@ -232,7 +232,7 @@ AcpiInstallFixedEventHandler ( Status = AcpiEnableEvent (Event, 0); if (ACPI_FAILURE (Status)) { - ACPI_WARNING ((AE_INFO, "Could not enable fixed event %X", Event)); + ACPI_WARNING ((AE_INFO, "Could not enable fixed event 0x%X", Event)); /* Remove the handler */ @@ -303,7 +303,7 @@ AcpiRemoveFixedEventHandler ( if (ACPI_FAILURE (Status)) { ACPI_WARNING ((AE_INFO, - "Could not write to fixed event enable register %X", Event)); + "Could not write to fixed event enable register 0x%X", Event)); } else { diff --git a/executer/exconvrt.c b/executer/exconvrt.c index 2e154d1202ae..d0831a32cad6 100644 --- a/executer/exconvrt.c +++ b/executer/exconvrt.c @@ -786,7 +786,7 @@ AcpiExConvertToTargetType ( default: - ACPI_ERROR ((AE_INFO, "Bad destination type during conversion: %X", + ACPI_ERROR ((AE_INFO, "Bad destination type during conversion: 0x%X", DestinationType)); Status = AE_AML_INTERNAL; break; @@ -803,7 +803,7 @@ AcpiExConvertToTargetType ( default: ACPI_ERROR ((AE_INFO, - "Unknown Target type ID 0x%X AmlOpcode %X DestType %s", + "Unknown Target type ID 0x%X AmlOpcode 0x%X DestType %s", GET_CURRENT_ARG_TYPE (WalkState->OpInfo->RuntimeArgs), WalkState->Opcode, AcpiUtGetTypeName (DestinationType))); Status = AE_AML_INTERNAL; diff --git a/executer/excreate.c b/executer/excreate.c index 728603e49c28..87c4f8a8f90f 100644 --- a/executer/excreate.c +++ b/executer/excreate.c @@ -402,11 +402,11 @@ AcpiExCreateRegion ( if ((RegionSpace >= ACPI_NUM_PREDEFINED_REGIONS) && (RegionSpace < ACPI_USER_REGION_BEGIN)) { - ACPI_ERROR ((AE_INFO, "Invalid AddressSpace type %X", RegionSpace)); + ACPI_ERROR ((AE_INFO, "Invalid AddressSpace type 0x%X", RegionSpace)); return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID); } - ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Region Type - %s (%X)\n", + ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Region Type - %s (0x%X)\n", AcpiUtGetRegionName (RegionSpace), RegionSpace)); /* Create the region descriptor */ diff --git a/executer/exdebug.c b/executer/exdebug.c new file mode 100644 index 000000000000..bef4f24a2086 --- /dev/null +++ b/executer/exdebug.c @@ -0,0 +1,350 @@ +/****************************************************************************** + * + * Module Name: exdebug - Support for stores to the AML Debug Object + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#define __EXDEBUG_C__ + +#include "acpi.h" +#include "accommon.h" +#include "acinterp.h" + + +#define _COMPONENT ACPI_EXECUTER + ACPI_MODULE_NAME ("exdebug") + + +#ifndef ACPI_NO_ERROR_MESSAGES +/******************************************************************************* + * + * FUNCTION: AcpiExDoDebugObject + * + * PARAMETERS: SourceDesc - Object to be output to "Debug Object" + * Level - Indentation level (used for packages) + * Index - Current package element, zero if not pkg + * + * RETURN: None + * + * DESCRIPTION: Handles stores to the AML Debug Object. For example: + * Store(INT1, Debug) + * + * This function is not compiled if ACPI_NO_ERROR_MESSAGES is set. + * + * This function is only enabled if AcpiGbl_EnableAmlDebugObject is set, or + * if ACPI_LV_DEBUG_OBJECT is set in the AcpiDbgLevel. Thus, in the normal + * operational case, stores to the debug object are ignored but can be easily + * enabled if necessary. + * + ******************************************************************************/ + +void +AcpiExDoDebugObject ( + ACPI_OPERAND_OBJECT *SourceDesc, + UINT32 Level, + UINT32 Index) +{ + UINT32 i; + + + ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc); + + + /* Output must be enabled via the DebugObject global or the DbgLevel */ + + if (!AcpiGbl_EnableAmlDebugObject && + !(AcpiDbgLevel & ACPI_LV_DEBUG_OBJECT)) + { + return_VOID; + } + + /* + * Print line header as long as we are not in the middle of an + * object display + */ + if (!((Level > 0) && Index == 0)) + { + AcpiOsPrintf ("[ACPI Debug] %*s", Level, " "); + } + + /* Display the index for package output only */ + + if (Index > 0) + { + AcpiOsPrintf ("(%.2u) ", Index-1); + } + + if (!SourceDesc) + { + AcpiOsPrintf ("[Null Object]\n"); + return_VOID; + } + + if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_OPERAND) + { + AcpiOsPrintf ("%s ", AcpiUtGetObjectTypeName (SourceDesc)); + + if (!AcpiUtValidInternalObject (SourceDesc)) + { + AcpiOsPrintf ("%p, Invalid Internal Object!\n", SourceDesc); + return_VOID; + } + } + else if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_NAMED) + { + AcpiOsPrintf ("%s: %p\n", + AcpiUtGetTypeName (((ACPI_NAMESPACE_NODE *) SourceDesc)->Type), + SourceDesc); + return_VOID; + } + else + { + return_VOID; + } + + /* SourceDesc is of type ACPI_DESC_TYPE_OPERAND */ + + switch (SourceDesc->Common.Type) + { + case ACPI_TYPE_INTEGER: + + /* Output correct integer width */ + + if (AcpiGbl_IntegerByteWidth == 4) + { + AcpiOsPrintf ("0x%8.8X\n", + (UINT32) SourceDesc->Integer.Value); + } + else + { + AcpiOsPrintf ("0x%8.8X%8.8X\n", + ACPI_FORMAT_UINT64 (SourceDesc->Integer.Value)); + } + break; + + case ACPI_TYPE_BUFFER: + + AcpiOsPrintf ("[0x%.2X]\n", (UINT32) SourceDesc->Buffer.Length); + AcpiUtDumpBuffer2 (SourceDesc->Buffer.Pointer, + (SourceDesc->Buffer.Length < 256) ? + SourceDesc->Buffer.Length : 256, DB_BYTE_DISPLAY); + break; + + case ACPI_TYPE_STRING: + + AcpiOsPrintf ("[0x%.2X] \"%s\"\n", + SourceDesc->String.Length, SourceDesc->String.Pointer); + break; + + case ACPI_TYPE_PACKAGE: + + AcpiOsPrintf ("[Contains 0x%.2X Elements]\n", + SourceDesc->Package.Count); + + /* Output the entire contents of the package */ + + for (i = 0; i < SourceDesc->Package.Count; i++) + { + AcpiExDoDebugObject (SourceDesc->Package.Elements[i], + Level+4, i+1); + } + break; + + case ACPI_TYPE_LOCAL_REFERENCE: + + AcpiOsPrintf ("[%s] ", AcpiUtGetReferenceName (SourceDesc)); + + /* Decode the reference */ + + switch (SourceDesc->Reference.Class) + { + case ACPI_REFCLASS_INDEX: + + AcpiOsPrintf ("0x%X\n", SourceDesc->Reference.Value); + break; + + case ACPI_REFCLASS_TABLE: + + /* Case for DdbHandle */ + + AcpiOsPrintf ("Table Index 0x%X\n", SourceDesc->Reference.Value); + return; + + default: + break; + } + + AcpiOsPrintf (" "); + + /* Check for valid node first, then valid object */ + + if (SourceDesc->Reference.Node) + { + if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Node) != + ACPI_DESC_TYPE_NAMED) + { + AcpiOsPrintf (" %p - Not a valid namespace node\n", + SourceDesc->Reference.Node); + } + else + { + AcpiOsPrintf ("Node %p [%4.4s] ", SourceDesc->Reference.Node, + (SourceDesc->Reference.Node)->Name.Ascii); + + switch ((SourceDesc->Reference.Node)->Type) + { + /* These types have no attached object */ + + case ACPI_TYPE_DEVICE: + AcpiOsPrintf ("Device\n"); + break; + + case ACPI_TYPE_THERMAL: + AcpiOsPrintf ("Thermal Zone\n"); + break; + + default: + AcpiExDoDebugObject ((SourceDesc->Reference.Node)->Object, + Level+4, 0); + break; + } + } + } + else if (SourceDesc->Reference.Object) + { + if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Object) == + ACPI_DESC_TYPE_NAMED) + { + AcpiExDoDebugObject (((ACPI_NAMESPACE_NODE *) + SourceDesc->Reference.Object)->Object, + Level+4, 0); + } + else + { + AcpiExDoDebugObject (SourceDesc->Reference.Object, + Level+4, 0); + } + } + break; + + default: + + AcpiOsPrintf ("%p\n", SourceDesc); + break; + } + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "\n")); + return_VOID; +} +#endif + + diff --git a/executer/exfield.c b/executer/exfield.c index 5657ea88479a..ad1209da4f48 100644 --- a/executer/exfield.c +++ b/executer/exfield.c @@ -382,7 +382,7 @@ AcpiExWriteDataToField ( if (SourceDesc->Buffer.Length < Length) { ACPI_ERROR ((AE_INFO, - "SMBus or IPMI write requires Buffer of length %X, found length %X", + "SMBus or IPMI write requires Buffer of length %u, found length %u", Length, SourceDesc->Buffer.Length)); return_ACPI_STATUS (AE_AML_BUFFER_LIMIT); diff --git a/executer/exfldio.c b/executer/exfldio.c index 403cb069446d..0cff9f94d9c2 100644 --- a/executer/exfldio.c +++ b/executer/exfldio.c @@ -181,7 +181,7 @@ AcpiExSetupRegion ( if (RgnDesc->Common.Type != ACPI_TYPE_REGION) { - ACPI_ERROR ((AE_INFO, "Needed Region, found type %X (%s)", + ACPI_ERROR ((AE_INFO, "Needed Region, found type 0x%X (%s)", RgnDesc->Common.Type, AcpiUtGetObjectTypeName (RgnDesc))); @@ -262,7 +262,7 @@ AcpiExSetupRegion ( * byte, and a field with Dword access specified. */ ACPI_ERROR ((AE_INFO, - "Field [%4.4s] access width (%d bytes) too large for region [%4.4s] (length %X)", + "Field [%4.4s] access width (%u bytes) too large for region [%4.4s] (length %u)", AcpiUtGetNodeName (ObjDesc->CommonField.Node), ObjDesc->CommonField.AccessByteWidth, AcpiUtGetNodeName (RgnDesc->Region.Node), @@ -274,7 +274,7 @@ AcpiExSetupRegion ( * exceeds region length, indicate an error */ ACPI_ERROR ((AE_INFO, - "Field [%4.4s] Base+Offset+Width %X+%X+%X is beyond end of region [%4.4s] (length %X)", + "Field [%4.4s] Base+Offset+Width %u+%u+%u is beyond end of region [%4.4s] (length %u)", AcpiUtGetNodeName (ObjDesc->CommonField.Node), ObjDesc->CommonField.BaseByteOffset, FieldDatumByteOffset, ObjDesc->CommonField.AccessByteWidth, @@ -371,14 +371,14 @@ AcpiExAccessRegion ( if (Status == AE_NOT_IMPLEMENTED) { ACPI_ERROR ((AE_INFO, - "Region %s(%X) not implemented", + "Region %s(0x%X) not implemented", AcpiUtGetRegionName (RgnDesc->Region.SpaceId), RgnDesc->Region.SpaceId)); } else if (Status == AE_NOT_EXIST) { ACPI_ERROR ((AE_INFO, - "Region %s(%X) has no handler", + "Region %s(0x%X) has no handler", AcpiUtGetRegionName (RgnDesc->Region.SpaceId), RgnDesc->Region.SpaceId)); } @@ -633,7 +633,7 @@ AcpiExFieldDatumIo ( default: - ACPI_ERROR ((AE_INFO, "Wrong object type in field I/O %X", + ACPI_ERROR ((AE_INFO, "Wrong object type in field I/O %u", ObjDesc->Common.Type)); Status = AE_AML_INTERNAL; break; @@ -743,7 +743,7 @@ AcpiExWriteWithUpdateRule ( default: ACPI_ERROR ((AE_INFO, - "Unknown UpdateRule value: %X", + "Unknown UpdateRule value: 0x%X", (ObjDesc->CommonField.FieldFlags & AML_FIELD_UPDATE_RULE_MASK))); return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } @@ -806,7 +806,7 @@ AcpiExExtractFromField ( ACPI_ROUND_BITS_UP_TO_BYTES (ObjDesc->CommonField.BitLength)) { ACPI_ERROR ((AE_INFO, - "Field size %X (bits) is too large for buffer (%X)", + "Field size %u (bits) is too large for buffer (%u)", ObjDesc->CommonField.BitLength, BufferLength)); return_ACPI_STATUS (AE_BUFFER_OVERFLOW); diff --git a/executer/exmisc.c b/executer/exmisc.c index 54cb1f0019f2..fb3bec984c73 100644 --- a/executer/exmisc.c +++ b/executer/exmisc.c @@ -183,7 +183,7 @@ AcpiExGetObjectReference ( default: - ACPI_ERROR ((AE_INFO, "Unknown Reference Class %2.2X", + ACPI_ERROR ((AE_INFO, "Unknown Reference Class 0x%2.2X", ObjDesc->Reference.Class)); return_ACPI_STATUS (AE_AML_INTERNAL); } @@ -201,7 +201,7 @@ AcpiExGetObjectReference ( default: - ACPI_ERROR ((AE_INFO, "Invalid descriptor type %X", + ACPI_ERROR ((AE_INFO, "Invalid descriptor type 0x%X", ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))); return_ACPI_STATUS (AE_TYPE); } @@ -373,7 +373,7 @@ AcpiExDoConcatenate ( break; default: - ACPI_ERROR ((AE_INFO, "Invalid object type: %X", + ACPI_ERROR ((AE_INFO, "Invalid object type: 0x%X", Operand0->Common.Type)); Status = AE_AML_INTERNAL; } @@ -475,7 +475,7 @@ AcpiExDoConcatenate ( /* Invalid object type, should not happen here */ - ACPI_ERROR ((AE_INFO, "Invalid object type: %X", + ACPI_ERROR ((AE_INFO, "Invalid object type: 0x%X", Operand0->Common.Type)); Status =AE_AML_INTERNAL; goto Cleanup; diff --git a/executer/exmutex.c b/executer/exmutex.c index d0aa9deda282..172db6392de6 100644 --- a/executer/exmutex.c +++ b/executer/exmutex.c @@ -353,7 +353,7 @@ AcpiExAcquireMutex ( if (WalkState->Thread->CurrentSyncLevel > ObjDesc->Mutex.SyncLevel) { ACPI_ERROR ((AE_INFO, - "Cannot acquire Mutex [%4.4s], current SyncLevel is too large (%d)", + "Cannot acquire Mutex [%4.4s], current SyncLevel is too large (%u)", AcpiUtGetNodeName (ObjDesc->Mutex.Node), WalkState->Thread->CurrentSyncLevel)); return_ACPI_STATUS (AE_AML_MUTEX_ORDER); @@ -471,6 +471,7 @@ AcpiExReleaseMutex ( { ACPI_STATUS Status = AE_OK; UINT8 PreviousSyncLevel; + ACPI_THREAD_STATE *OwnerThread; ACPI_FUNCTION_TRACE (ExReleaseMutex); @@ -481,9 +482,11 @@ AcpiExReleaseMutex ( return_ACPI_STATUS (AE_BAD_PARAMETER); } + OwnerThread = ObjDesc->Mutex.OwnerThread; + /* The mutex must have been previously acquired in order to release it */ - if (!ObjDesc->Mutex.OwnerThread) + if (!OwnerThread) { ACPI_ERROR ((AE_INFO, "Cannot release Mutex [%4.4s], not acquired", AcpiUtGetNodeName (ObjDesc->Mutex.Node))); @@ -503,14 +506,14 @@ AcpiExReleaseMutex ( * The Mutex is owned, but this thread must be the owner. * Special case for Global Lock, any thread can release */ - if ((ObjDesc->Mutex.OwnerThread->ThreadId != WalkState->Thread->ThreadId) && + if ((OwnerThread->ThreadId != WalkState->Thread->ThreadId) && (ObjDesc != AcpiGbl_GlobalLockMutex)) { ACPI_ERROR ((AE_INFO, "Thread %p cannot release Mutex [%4.4s] acquired by thread %p", ACPI_CAST_PTR (void, WalkState->Thread->ThreadId), AcpiUtGetNodeName (ObjDesc->Mutex.Node), - ACPI_CAST_PTR (void, ObjDesc->Mutex.OwnerThread->ThreadId))); + ACPI_CAST_PTR (void, OwnerThread->ThreadId))); return_ACPI_STATUS (AE_AML_NOT_OWNER); } @@ -521,10 +524,10 @@ AcpiExReleaseMutex ( * different level can only mean that the mutex ordering rule is being * violated. This behavior is clarified in ACPI 4.0 specification. */ - if (ObjDesc->Mutex.SyncLevel != WalkState->Thread->CurrentSyncLevel) + if (ObjDesc->Mutex.SyncLevel != OwnerThread->CurrentSyncLevel) { ACPI_ERROR ((AE_INFO, - "Cannot release Mutex [%4.4s], SyncLevel mismatch: mutex %d current %d", + "Cannot release Mutex [%4.4s], SyncLevel mismatch: mutex %u current %u", AcpiUtGetNodeName (ObjDesc->Mutex.Node), ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel)); return_ACPI_STATUS (AE_AML_MUTEX_ORDER); @@ -536,7 +539,7 @@ AcpiExReleaseMutex ( * acquired, but are not released in reverse order. */ PreviousSyncLevel = - WalkState->Thread->AcquiredMutexList->Mutex.OriginalSyncLevel; + OwnerThread->AcquiredMutexList->Mutex.OriginalSyncLevel; Status = AcpiExReleaseMutexObject (ObjDesc); if (ACPI_FAILURE (Status)) @@ -548,7 +551,7 @@ AcpiExReleaseMutex ( { /* Restore the previous SyncLevel */ - WalkState->Thread->CurrentSyncLevel = PreviousSyncLevel; + OwnerThread->CurrentSyncLevel = PreviousSyncLevel; } return_ACPI_STATUS (Status); } diff --git a/executer/exnames.c b/executer/exnames.c index a0ee8a5dbd65..9a2b6e48f45e 100644 --- a/executer/exnames.c +++ b/executer/exnames.c @@ -189,7 +189,7 @@ AcpiExAllocateNameString ( if (!NameString) { ACPI_ERROR ((AE_INFO, - "Could not allocate size %d", SizeNeeded)); + "Could not allocate size %u", SizeNeeded)); return_PTR (NULL); } @@ -325,7 +325,7 @@ AcpiExNameSegment ( */ Status = AE_AML_BAD_NAME; ACPI_ERROR ((AE_INFO, - "Bad character %02x in name, at %p", + "Bad character 0x%02x in name, at %p", *AmlAddress, AmlAddress)); } diff --git a/executer/exoparg1.c b/executer/exoparg1.c index b7ee459685d9..1bff09b09cc1 100644 --- a/executer/exoparg1.c +++ b/executer/exoparg1.c @@ -193,7 +193,7 @@ AcpiExOpcode_0A_0T_1R ( default: /* Unknown opcode */ - ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X", + ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", WalkState->Opcode)); Status = AE_AML_BAD_OPCODE; break; @@ -286,7 +286,7 @@ AcpiExOpcode_1A_0T_0R ( default: /* Unknown opcode */ - ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X", + ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", WalkState->Opcode)); Status = AE_AML_BAD_OPCODE; break; @@ -332,7 +332,7 @@ AcpiExOpcode_1A_1T_0R ( default: /* Unknown opcode */ - ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X", + ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", WalkState->Opcode)); Status = AE_AML_BAD_OPCODE; goto Cleanup; @@ -514,7 +514,7 @@ AcpiExOpcode_1A_1T_1R ( if (Digit > 0) { ACPI_ERROR ((AE_INFO, - "Integer too large to convert to BCD: %8.8X%8.8X", + "Integer too large to convert to BCD: 0x%8.8X%8.8X", ACPI_FORMAT_UINT64 (Operand[0]->Integer.Value))); Status = AE_AML_NUMERIC_OVERFLOW; goto Cleanup; @@ -664,7 +664,7 @@ AcpiExOpcode_1A_1T_1R ( default: /* Unknown opcode */ - ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X", + ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", WalkState->Opcode)); Status = AE_AML_BAD_OPCODE; goto Cleanup; @@ -1116,7 +1116,7 @@ AcpiExOpcode_1A_0T_1R ( default: ACPI_ERROR ((AE_INFO, - "Unknown Index TargetType %X in reference object %p", + "Unknown Index TargetType 0x%X in reference object %p", Operand[0]->Reference.TargetType, Operand[0])); Status = AE_AML_OPERAND_TYPE; goto Cleanup; @@ -1143,7 +1143,7 @@ AcpiExOpcode_1A_0T_1R ( default: ACPI_ERROR ((AE_INFO, - "Unknown class in reference(%p) - %2.2X", + "Unknown class in reference(%p) - 0x%2.2X", Operand[0], Operand[0]->Reference.Class)); Status = AE_TYPE; @@ -1155,7 +1155,7 @@ AcpiExOpcode_1A_0T_1R ( default: - ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X", + ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", WalkState->Opcode)); Status = AE_AML_BAD_OPCODE; goto Cleanup; diff --git a/executer/exoparg2.c b/executer/exoparg2.c index 81eda0e191b0..d71c91020434 100644 --- a/executer/exoparg2.c +++ b/executer/exoparg2.c @@ -246,7 +246,7 @@ AcpiExOpcode_2A_0T_0R ( default: - ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X", + ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", WalkState->Opcode)); Status = AE_AML_BAD_OPCODE; } @@ -319,7 +319,7 @@ AcpiExOpcode_2A_2T_1R ( default: - ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X", + ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", WalkState->Opcode)); Status = AE_AML_BAD_OPCODE; goto Cleanup; @@ -555,7 +555,7 @@ AcpiExOpcode_2A_1T_1R ( if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, - "Index (%X%8.8X) is beyond end of object", + "Index (0x%8.8X%8.8X) is beyond end of object", ACPI_FORMAT_UINT64 (Index))); goto Cleanup; } @@ -579,7 +579,7 @@ AcpiExOpcode_2A_1T_1R ( default: - ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X", + ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", WalkState->Opcode)); Status = AE_AML_BAD_OPCODE; break; @@ -702,7 +702,7 @@ AcpiExOpcode_2A_0T_1R ( default: - ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X", + ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", WalkState->Opcode)); Status = AE_AML_BAD_OPCODE; goto Cleanup; diff --git a/executer/exoparg3.c b/executer/exoparg3.c index 923337cd2737..2bdd56e7dc55 100644 --- a/executer/exoparg3.c +++ b/executer/exoparg3.c @@ -206,7 +206,7 @@ AcpiExOpcode_3A_0T_0R ( default: - ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X", + ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", WalkState->Opcode)); Status = AE_AML_BAD_OPCODE; goto Cleanup; @@ -345,7 +345,7 @@ AcpiExOpcode_3A_1T_1R ( default: - ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X", + ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", WalkState->Opcode)); Status = AE_AML_BAD_OPCODE; goto Cleanup; diff --git a/executer/exoparg6.c b/executer/exoparg6.c index 5b35710c9a1e..0c540ed28140 100644 --- a/executer/exoparg6.c +++ b/executer/exoparg6.c @@ -337,7 +337,7 @@ AcpiExOpcode_6A_0T_1R ( if (Index >= Operand[0]->Package.Count) { ACPI_ERROR ((AE_INFO, - "Index (%X%8.8X) beyond package end (%X)", + "Index (0x%8.8X%8.8X) beyond package end (0x%X)", ACPI_FORMAT_UINT64 (Index), Operand[0]->Package.Count)); Status = AE_AML_PACKAGE_LIMIT; goto Cleanup; @@ -411,7 +411,7 @@ AcpiExOpcode_6A_0T_1R ( default: - ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X", + ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", WalkState->Opcode)); Status = AE_AML_BAD_OPCODE; goto Cleanup; diff --git a/executer/exprep.c b/executer/exprep.c index d6b144bf848f..6cc371945157 100644 --- a/executer/exprep.c +++ b/executer/exprep.c @@ -362,7 +362,7 @@ AcpiExDecodeFieldAccess ( /* Invalid field access type */ ACPI_ERROR ((AE_INFO, - "Unknown field access type %X", + "Unknown field access type 0x%X", Access)); return_UINT32 (0); } @@ -533,7 +533,7 @@ AcpiExPrepFieldValue ( if (Type != ACPI_TYPE_REGION) { ACPI_ERROR ((AE_INFO, - "Needed Region, found type %X (%s)", + "Needed Region, found type 0x%X (%s)", Type, AcpiUtGetTypeName (Type))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); diff --git a/executer/exregion.c b/executer/exregion.c index f551f1768770..efe83ebc83c3 100644 --- a/executer/exregion.c +++ b/executer/exregion.c @@ -188,7 +188,7 @@ AcpiExSystemMemorySpaceHandler ( break; default: - ACPI_ERROR ((AE_INFO, "Invalid SystemMemory width %d", + ACPI_ERROR ((AE_INFO, "Invalid SystemMemory width %u", BitWidth)); return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } @@ -265,7 +265,7 @@ AcpiExSystemMemorySpaceHandler ( if (!MemInfo->MappedLogicalAddress) { ACPI_ERROR ((AE_INFO, - "Could not map memory at %8.8X%8.8X, size %X", + "Could not map memory at 0x%8.8X%8.8X, size %u", ACPI_FORMAT_NATIVE_UINT (Address), (UINT32) MapLength)); MemInfo->MappedLength = 0; return_ACPI_STATUS (AE_NO_MEMORY); diff --git a/executer/exresnte.c b/executer/exresnte.c index a4922c0b7172..59eef550c135 100644 --- a/executer/exresnte.c +++ b/executer/exresnte.c @@ -344,7 +344,7 @@ AcpiExResolveNodeToValue ( /* No named references are allowed here */ ACPI_ERROR ((AE_INFO, - "Unsupported Reference type %X", + "Unsupported Reference type 0x%X", SourceDesc->Reference.Class)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); @@ -357,7 +357,7 @@ AcpiExResolveNodeToValue ( /* Default case is for unknown types */ ACPI_ERROR ((AE_INFO, - "Node %p - Unknown object type %X", + "Node %p - Unknown object type 0x%X", Node, EntryType)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); diff --git a/executer/exresolv.c b/executer/exresolv.c index f78c119aedcb..f965293c788d 100644 --- a/executer/exresolv.c +++ b/executer/exresolv.c @@ -326,7 +326,7 @@ AcpiExResolveObjectToValue ( /* Invalid reference object */ ACPI_ERROR ((AE_INFO, - "Unknown TargetType %X in Index/Reference object %p", + "Unknown TargetType 0x%X in Index/Reference object %p", StackDesc->Reference.TargetType, StackDesc)); Status = AE_AML_INTERNAL; break; @@ -367,7 +367,7 @@ AcpiExResolveObjectToValue ( default: ACPI_ERROR ((AE_INFO, - "Unknown Reference type %X in %p", RefType, StackDesc)); + "Unknown Reference type 0x%X in %p", RefType, StackDesc)); Status = AE_AML_INTERNAL; break; } @@ -503,7 +503,7 @@ AcpiExResolveMultiple ( if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED) { ACPI_ERROR ((AE_INFO, - "Not a NS node %p [%s]", + "Not a namespace node %p [%s]", Node, AcpiUtGetDescriptorName (Node))); return_ACPI_STATUS (AE_AML_INTERNAL); } @@ -605,7 +605,7 @@ AcpiExResolveMultiple ( default: ACPI_ERROR ((AE_INFO, - "Unknown Reference Class %2.2X", ObjDesc->Reference.Class)); + "Unknown Reference Class 0x%2.2X", ObjDesc->Reference.Class)); return_ACPI_STATUS (AE_AML_INTERNAL); } } diff --git a/executer/exresop.c b/executer/exresop.c index ed60d2a42af6..b9700d6dad40 100644 --- a/executer/exresop.c +++ b/executer/exresop.c @@ -243,7 +243,7 @@ AcpiExResolveOperands ( ArgTypes = OpInfo->RuntimeArgs; if (ArgTypes == ARGI_INVALID_OPCODE) { - ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X", + ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", Opcode)); return_ACPI_STATUS (AE_AML_INTERNAL); @@ -309,7 +309,7 @@ AcpiExResolveOperands ( if (!AcpiUtValidObjectType (ObjectType)) { ACPI_ERROR ((AE_INFO, - "Bad operand object type [%X]", ObjectType)); + "Bad operand object type [0x%X]", ObjectType)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -342,7 +342,7 @@ AcpiExResolveOperands ( default: ACPI_ERROR ((AE_INFO, - "Unknown Reference Class %2.2X in %p", + "Unknown Reference Class 0x%2.2X in %p", ObjDesc->Reference.Class, ObjDesc)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); @@ -773,7 +773,7 @@ AcpiExResolveOperands ( /* Unknown type */ ACPI_ERROR ((AE_INFO, - "Internal - Unknown ARGI (required operand) type %X", + "Internal - Unknown ARGI (required operand) type 0x%X", ThisArgType)); return_ACPI_STATUS (AE_BAD_PARAMETER); diff --git a/executer/exstore.c b/executer/exstore.c index 5ff117586799..3e55fe5b1896 100644 --- a/executer/exstore.c +++ b/executer/exstore.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exstore - AML Interpreter object store support @@ -129,12 +128,6 @@ /* Local prototypes */ -static void -AcpiExDoDebugObject ( - ACPI_OPERAND_OBJECT *SourceDesc, - UINT32 Level, - UINT32 Index); - static ACPI_STATUS AcpiExStoreObjectToIndex ( ACPI_OPERAND_OBJECT *ValDesc, @@ -142,218 +135,6 @@ AcpiExStoreObjectToIndex ( ACPI_WALK_STATE *WalkState); -/******************************************************************************* - * - * FUNCTION: AcpiExDoDebugObject - * - * PARAMETERS: SourceDesc - Value to be stored - * Level - Indentation level (used for packages) - * Index - Current package element, zero if not pkg - * - * RETURN: None - * - * DESCRIPTION: Handles stores to the Debug Object. - * - ******************************************************************************/ - -static void -AcpiExDoDebugObject ( - ACPI_OPERAND_OBJECT *SourceDesc, - UINT32 Level, - UINT32 Index) -{ - UINT32 i; - - - ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc); - - - /* Print line header as long as we are not in the middle of an object display */ - - if (!((Level > 0) && Index == 0)) - { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %*s", - Level, " ")); - } - - /* Display index for package output only */ - - if (Index > 0) - { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, - "(%.2u) ", Index -1)); - } - - if (!SourceDesc) - { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[Null Object]\n")); - return_VOID; - } - - if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_OPERAND) - { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%s ", - AcpiUtGetObjectTypeName (SourceDesc))); - - if (!AcpiUtValidInternalObject (SourceDesc)) - { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, - "%p, Invalid Internal Object!\n", SourceDesc)); - return_VOID; - } - } - else if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_NAMED) - { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%s: %p\n", - AcpiUtGetTypeName (((ACPI_NAMESPACE_NODE *) SourceDesc)->Type), - SourceDesc)); - return_VOID; - } - else - { - return_VOID; - } - - /* SourceDesc is of type ACPI_DESC_TYPE_OPERAND */ - - switch (SourceDesc->Common.Type) - { - case ACPI_TYPE_INTEGER: - - /* Output correct integer width */ - - if (AcpiGbl_IntegerByteWidth == 4) - { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%8.8X\n", - (UINT32) SourceDesc->Integer.Value)); - } - else - { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%8.8X%8.8X\n", - ACPI_FORMAT_UINT64 (SourceDesc->Integer.Value))); - } - break; - - case ACPI_TYPE_BUFFER: - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[0x%.2X]\n", - (UINT32) SourceDesc->Buffer.Length)); - ACPI_DUMP_BUFFER (SourceDesc->Buffer.Pointer, - (SourceDesc->Buffer.Length < 256) ? SourceDesc->Buffer.Length : 256); - break; - - case ACPI_TYPE_STRING: - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[0x%.2X] \"%s\"\n", - SourceDesc->String.Length, SourceDesc->String.Pointer)); - break; - - case ACPI_TYPE_PACKAGE: - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[Contains 0x%.2X Elements]\n", - SourceDesc->Package.Count)); - - /* Output the entire contents of the package */ - - for (i = 0; i < SourceDesc->Package.Count; i++) - { - AcpiExDoDebugObject (SourceDesc->Package.Elements[i], - Level+4, i+1); - } - break; - - case ACPI_TYPE_LOCAL_REFERENCE: - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[%s] ", - AcpiUtGetReferenceName (SourceDesc))); - - /* Decode the reference */ - - switch (SourceDesc->Reference.Class) - { - case ACPI_REFCLASS_INDEX: - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%X\n", - SourceDesc->Reference.Value)); - break; - - case ACPI_REFCLASS_TABLE: - - /* Case for DdbHandle */ - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Table Index 0x%X\n", - SourceDesc->Reference.Value)); - return; - - default: - break; - } - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, " ")); - - /* Check for valid node first, then valid object */ - - if (SourceDesc->Reference.Node) - { - if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Node) != - ACPI_DESC_TYPE_NAMED) - { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, - " %p - Not a valid namespace node\n", - SourceDesc->Reference.Node)); - } - else - { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Node %p [%4.4s] ", - SourceDesc->Reference.Node, (SourceDesc->Reference.Node)->Name.Ascii)); - - switch ((SourceDesc->Reference.Node)->Type) - { - /* These types have no attached object */ - - case ACPI_TYPE_DEVICE: - AcpiOsPrintf ("Device\n"); - break; - - case ACPI_TYPE_THERMAL: - AcpiOsPrintf ("Thermal Zone\n"); - break; - - default: - AcpiExDoDebugObject ((SourceDesc->Reference.Node)->Object, - Level+4, 0); - break; - } - } - } - else if (SourceDesc->Reference.Object) - { - if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Object) == - ACPI_DESC_TYPE_NAMED) - { - AcpiExDoDebugObject (((ACPI_NAMESPACE_NODE *) - SourceDesc->Reference.Object)->Object, - Level+4, 0); - } - else - { - AcpiExDoDebugObject (SourceDesc->Reference.Object, Level+4, 0); - } - } - break; - - default: - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%p\n", - SourceDesc)); - break; - } - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "\n")); - return_VOID; -} - - /******************************************************************************* * * FUNCTION: AcpiExStore @@ -487,13 +268,13 @@ AcpiExStore ( "**** Write to Debug Object: Object %p %s ****:\n\n", SourceDesc, AcpiUtGetObjectTypeName (SourceDesc))); - AcpiExDoDebugObject (SourceDesc, 0, 0); + ACPI_DEBUG_OBJECT (SourceDesc, 0, 0); break; default: - ACPI_ERROR ((AE_INFO, "Unknown Reference Class %2.2X", + ACPI_ERROR ((AE_INFO, "Unknown Reference Class 0x%2.2X", RefDesc->Reference.Class)); ACPI_DUMP_ENTRY (RefDesc, ACPI_LV_INFO); diff --git a/executer/exsystem.c b/executer/exsystem.c index 9f4583fc1383..f43ef215527f 100644 --- a/executer/exsystem.c +++ b/executer/exsystem.c @@ -265,7 +265,7 @@ AcpiExSystemDoStall ( * (ACPI specifies 100 usec as max, but this gives some slack in * order to support existing BIOSs) */ - ACPI_ERROR ((AE_INFO, "Time parameter is too large (%d)", + ACPI_ERROR ((AE_INFO, "Time parameter is too large (%u)", HowLong)); Status = AE_AML_OPERAND_VALUE; } diff --git a/hardware/hwregs.c b/hardware/hwregs.c index 60ca92cc8143..cee244450d79 100644 --- a/hardware/hwregs.c +++ b/hardware/hwregs.c @@ -412,7 +412,7 @@ AcpiHwGetBitRegisterInfo ( if (RegisterId > ACPI_BITREG_MAX) { - ACPI_ERROR ((AE_INFO, "Invalid BitRegister ID: %X", RegisterId)); + ACPI_ERROR ((AE_INFO, "Invalid BitRegister ID: 0x%X", RegisterId)); return (NULL); } @@ -539,7 +539,7 @@ AcpiHwRegisterRead ( default: - ACPI_ERROR ((AE_INFO, "Unknown Register ID: %X", + ACPI_ERROR ((AE_INFO, "Unknown Register ID: 0x%X", RegisterId)); Status = AE_BAD_PARAMETER; break; @@ -682,7 +682,7 @@ AcpiHwRegisterWrite ( default: - ACPI_ERROR ((AE_INFO, "Unknown Register ID: %X", + ACPI_ERROR ((AE_INFO, "Unknown Register ID: 0x%X", RegisterId)); Status = AE_BAD_PARAMETER; break; diff --git a/hardware/hwsleep.c b/hardware/hwsleep.c index ad6ad1e796f0..d9e38061b7c3 100644 --- a/hardware/hwsleep.c +++ b/hardware/hwsleep.c @@ -319,7 +319,7 @@ AcpiEnterSleepState ( if ((AcpiGbl_SleepTypeA > ACPI_SLEEP_TYPE_MAX) || (AcpiGbl_SleepTypeB > ACPI_SLEEP_TYPE_MAX)) { - ACPI_ERROR ((AE_INFO, "Sleep values out of range: A=%X B=%X", + ACPI_ERROR ((AE_INFO, "Sleep values out of range: A=0x%X B=0x%X", AcpiGbl_SleepTypeA, AcpiGbl_SleepTypeB)); return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } diff --git a/hardware/hwvalid.c b/hardware/hwvalid.c index 905dc7950f04..23b508b0a21f 100644 --- a/hardware/hwvalid.c +++ b/hardware/hwvalid.c @@ -237,7 +237,7 @@ AcpiHwValidateIoRequest ( if (LastAddress > ACPI_UINT16_MAX) { ACPI_ERROR ((AE_INFO, - "Illegal I/O port address/length above 64K: 0x%p/%X", + "Illegal I/O port address/length above 64K: %p/0x%X", ACPI_CAST_PTR (void, Address), ByteWidth)); return_ACPI_STATUS (AE_LIMIT); } diff --git a/include/acdisasm.h b/include/acdisasm.h index 1fe077b059a1..ab32086e2f28 100644 --- a/include/acdisasm.h +++ b/include/acdisasm.h @@ -286,6 +286,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[]; diff --git a/include/acglobal.h b/include/acglobal.h index 4469ee334e3b..0df0c2719ecf 100644 --- a/include/acglobal.h +++ b/include/acglobal.h @@ -186,6 +186,11 @@ UINT8 ACPI_INIT_GLOBAL (AcpiGbl_LeaveWakeGpesDisabled, TRUE); */ UINT8 ACPI_INIT_GLOBAL (AcpiGbl_UseDefaultRegisterWidths, TRUE); +/* + * Optionally enable output from the AML Debug Object. + */ +UINT8 ACPI_INIT_GLOBAL (AcpiGbl_EnableAmlDebugObject, FALSE); + /* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */ diff --git a/include/acinterp.h b/include/acinterp.h index de7dbf8030eb..67142c8911b5 100644 --- a/include/acinterp.h +++ b/include/acinterp.h @@ -202,6 +202,16 @@ AcpiExConvertToTargetType ( ACPI_WALK_STATE *WalkState); +/* + * exdebug - AML debug object + */ +void +AcpiExDoDebugObject ( + ACPI_OPERAND_OBJECT *SourceDesc, + UINT32 Level, + UINT32 Index); + + /* * exfield - ACPI AML (p-code) execution - field manipulation */ diff --git a/include/acoutput.h b/include/acoutput.h index 8018fed53842..8fca0de33953 100644 --- a/include/acoutput.h +++ b/include/acoutput.h @@ -281,6 +281,7 @@ #define ACPI_WARNING(plist) AcpiWarning plist #define ACPI_EXCEPTION(plist) AcpiException plist #define ACPI_ERROR(plist) AcpiError plist +#define ACPI_DEBUG_OBJECT(obj,l,i) AcpiExDoDebugObject(obj,l,i) #else @@ -290,6 +291,7 @@ #define ACPI_WARNING(plist) #define ACPI_EXCEPTION(plist) #define ACPI_ERROR(plist) +#define ACPI_DEBUG_OBJECT(obj,l,i) #endif /* ACPI_NO_ERROR_MESSAGES */ diff --git a/include/acpixf.h b/include/acpixf.h index c67b8b9f4587..220350afc807 100644 --- a/include/acpixf.h +++ b/include/acpixf.h @@ -120,7 +120,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20100121 +#define ACPI_CA_VERSION 0x20100304 #include "actypes.h" #include "actbl.h" @@ -145,6 +145,7 @@ extern UINT8 AcpiGbl_LeaveWakeGpesDisabled; extern UINT8 AcpiGbl_UseDefaultRegisterWidths; extern ACPI_NAME AcpiGbl_TraceMethodName; extern UINT32 AcpiGbl_TraceFlags; +extern UINT8 AcpiGbl_EnableAmlDebugObject; /* diff --git a/include/actbl2.h b/include/actbl2.h index c96715d3c05e..7f6ecf84a93c 100644 --- a/include/actbl2.h +++ b/include/actbl2.h @@ -143,6 +143,7 @@ #define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */ #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */ #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ +#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */ #define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */ #define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */ #define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */ @@ -862,6 +863,35 @@ typedef struct acpi_mcfg_allocation } ACPI_MCFG_ALLOCATION; +/******************************************************************************* + * + * MCHI - Management Controller Host Interface Table + * Version 1 + * + * Conforms to "Management Component Transport Protocol (MCTP) Host + * Interface Specification", Revision 1.0.0a, October 13, 2009 + * + ******************************************************************************/ + +typedef struct acpi_table_mchi +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT8 InterfaceType; + UINT8 Protocol; + UINT64 ProtocolData; + UINT8 InterruptType; + UINT8 Gpe; + UINT8 PciDeviceFlag; + UINT32 GlobalInterrupt; + ACPI_GENERIC_ADDRESS ControlRegister; + UINT8 PciSegment; + UINT8 PciBus; + UINT8 PciDevice; + UINT8 PciFunction; + +} ACPI_TABLE_MCHI; + + /******************************************************************************* * * SPCR - Serial Port Console Redirection table diff --git a/namespace/nsaccess.c b/namespace/nsaccess.c index 86f412a9c897..7a8dc6d1a77e 100644 --- a/namespace/nsaccess.c +++ b/namespace/nsaccess.c @@ -306,7 +306,7 @@ AcpiNsRootInitialize ( default: - ACPI_ERROR ((AE_INFO, "Unsupported initial type value %X", + ACPI_ERROR ((AE_INFO, "Unsupported initial type value 0x%X", InitVal->Type)); AcpiUtRemoveReference (ObjDesc); ObjDesc = NULL; diff --git a/namespace/nsdump.c b/namespace/nsdump.c index a0dd59e3d203..0b0af613f24d 100644 --- a/namespace/nsdump.c +++ b/namespace/nsdump.c @@ -314,7 +314,7 @@ AcpiNsDumpOneObject ( if (Type > ACPI_TYPE_LOCAL_MAX) { - ACPI_WARNING ((AE_INFO, "Invalid ACPI Object Type %08X", Type)); + ACPI_WARNING ((AE_INFO, "Invalid ACPI Object Type 0x%08X", Type)); } AcpiOsPrintf ("%4.4s", AcpiUtGetNodeName (ThisNode)); diff --git a/namespace/nsnames.c b/namespace/nsnames.c index 9423d561b71a..7eb3e549bf93 100644 --- a/namespace/nsnames.c +++ b/namespace/nsnames.c @@ -191,7 +191,7 @@ AcpiNsBuildExternalPath ( if (Index != 0) { ACPI_ERROR ((AE_INFO, - "Could not construct external pathname; index=%X, size=%X, Path=%s", + "Could not construct external pathname; index=%u, size=%u, Path=%s", (UINT32) Index, (UINT32) Size, &NameBuffer[Size])); return (AE_BAD_PARAMETER); diff --git a/namespace/nssearch.c b/namespace/nssearch.c index b17f60f7bd90..fa15b9c5bb0f 100644 --- a/namespace/nssearch.c +++ b/namespace/nssearch.c @@ -397,7 +397,7 @@ AcpiNsSearchAndEnter ( if (!Node || !TargetName || !ReturnNode) { ACPI_ERROR ((AE_INFO, - "Null parameter: Node %p Name %X ReturnNode %p", + "Null parameter: Node %p Name 0x%X ReturnNode %p", Node, TargetName, ReturnNode)); return_ACPI_STATUS (AE_BAD_PARAMETER); } diff --git a/namespace/nsutils.c b/namespace/nsutils.c index ee40473aaf3e..98ec9ff3c4b6 100644 --- a/namespace/nsutils.c +++ b/namespace/nsutils.c @@ -389,7 +389,7 @@ AcpiNsLocal ( { /* Type code out of range */ - ACPI_WARNING ((AE_INFO, "Invalid Object Type %X", Type)); + ACPI_WARNING ((AE_INFO, "Invalid Object Type 0x%X", Type)); return_UINT32 (ACPI_NS_NORMAL); } @@ -965,7 +965,7 @@ AcpiNsOpensScope ( { /* type code out of range */ - ACPI_WARNING ((AE_INFO, "Invalid Object Type %X", Type)); + ACPI_WARNING ((AE_INFO, "Invalid Object Type 0x%X", Type)); return_UINT32 (ACPI_NS_NORMAL); } diff --git a/os_specific/service_layers/oswinxf.c b/os_specific/service_layers/oswinxf.c index c932c2ca6c96..3e441968e099 100644 --- a/os_specific/service_layers/oswinxf.c +++ b/os_specific/service_layers/oswinxf.c @@ -727,7 +727,7 @@ AcpiOsCreateSemaphore ( if (i >= ACPI_OS_MAX_SEMAPHORES) { ACPI_EXCEPTION ((AE_INFO, AE_LIMIT, - "Reached max semaphores (%d), could not create", ACPI_OS_MAX_SEMAPHORES)); + "Reached max semaphores (%u), could not create", ACPI_OS_MAX_SEMAPHORES)); return AE_LIMIT; } @@ -862,7 +862,7 @@ AcpiOsWaitSemaphore ( if (AcpiGbl_Semaphores[Index].CurrentUnits == 0) { - ACPI_ERROR ((AE_INFO, "%s - No unit received. Timeout %X, OSstatus 0x%X", + ACPI_ERROR ((AE_INFO, "%s - No unit received. Timeout 0x%X, OS_Status 0x%X", AcpiUtGetMutexName (Index), Timeout, WaitStatus)); return AE_OK; @@ -923,7 +923,7 @@ AcpiOsSignalSemaphore ( AcpiGbl_Semaphores[Index].MaxUnits) { ACPI_ERROR ((AE_INFO, - "Oversignalled semaphore[%d]! Current %d Max %d", + "Oversignalled semaphore[%u]! Current %u Max %u", Index, AcpiGbl_Semaphores[Index].CurrentUnits, AcpiGbl_Semaphores[Index].MaxUnits)); @@ -1409,3 +1409,78 @@ AcpiOsSignal ( return (AE_OK); } + +/****************************************************************************** + * + * FUNCTION: Local cache interfaces + * + * DESCRIPTION: Implements cache interfaces via malloc/free for testing + * purposes only. + * + *****************************************************************************/ + +#ifndef ACPI_USE_LOCAL_CACHE + +ACPI_STATUS +AcpiOsCreateCache ( + char *CacheName, + UINT16 ObjectSize, + UINT16 MaxDepth, + ACPI_CACHE_T **ReturnCache) +{ + ACPI_MEMORY_LIST *NewCache; + + + NewCache = malloc (sizeof (ACPI_MEMORY_LIST)); + if (!NewCache) + { + return (AE_NO_MEMORY); + } + + memset (NewCache, 0, sizeof (ACPI_MEMORY_LIST)); + NewCache->LinkOffset = 8; + NewCache->ListName = CacheName; + NewCache->ObjectSize = ObjectSize; + NewCache->MaxDepth = MaxDepth; + + *ReturnCache = (ACPI_CACHE_T) NewCache; + return (AE_OK); +} + +ACPI_STATUS +AcpiOsDeleteCache ( + ACPI_CACHE_T *Cache) +{ + free (Cache); + return (AE_OK); +} + +ACPI_STATUS +AcpiOsPurgeCache ( + ACPI_CACHE_T *Cache) +{ + return (AE_OK); +} + +void * +AcpiOsAcquireObject ( + ACPI_CACHE_T *Cache) +{ + void *NewObject; + + NewObject = malloc (((ACPI_MEMORY_LIST *) Cache)->ObjectSize); + memset (NewObject, 0, ((ACPI_MEMORY_LIST *) Cache)->ObjectSize); + + return (NewObject); +} + +ACPI_STATUS +AcpiOsReleaseObject ( + ACPI_CACHE_T *Cache, + void *Object) +{ + free (Object); + return (AE_OK); +} + +#endif diff --git a/parser/psargs.c b/parser/psargs.c index 78127e5d4d33..35cc45188a04 100644 --- a/parser/psargs.c +++ b/parser/psargs.c @@ -577,7 +577,7 @@ AcpiPsGetNextSimpleArg ( default: - ACPI_ERROR ((AE_INFO, "Invalid ArgType %X", ArgType)); + ACPI_ERROR ((AE_INFO, "Invalid ArgType 0x%X", ArgType)); return_VOID; } @@ -883,7 +883,7 @@ AcpiPsGetNextArg ( default: - ACPI_ERROR ((AE_INFO, "Invalid ArgType: %X", ArgType)); + ACPI_ERROR ((AE_INFO, "Invalid ArgType: 0x%X", ArgType)); Status = AE_AML_OPERAND_TYPE; break; } diff --git a/parser/psloop.c b/parser/psloop.c index 67f79261f3f8..e3e2d0ca6bf2 100644 --- a/parser/psloop.c +++ b/parser/psloop.c @@ -228,7 +228,7 @@ AcpiPsGetAmlOpcode ( /* The opcode is unrecognized. Just skip unknown opcodes */ ACPI_ERROR ((AE_INFO, - "Found unknown opcode %X at AML address %p offset %X, ignoring", + "Found unknown opcode 0x%X at AML address %p offset 0x%X, ignoring", WalkState->Opcode, WalkState->ParserState.Aml, WalkState->AmlOffset)); ACPI_DUMP_BUFFER (WalkState->ParserState.Aml, 128); @@ -1149,7 +1149,6 @@ AcpiPsParseLoop ( { ACPI_EXCEPTION ((AE_INFO, Status, "Invoked method did not return a value")); - } ACPI_EXCEPTION ((AE_INFO, Status, "GetPredicate Failed")); diff --git a/resources/rscreate.c b/resources/rscreate.c index c2929aa43044..5f78b9e5ee2c 100644 --- a/resources/rscreate.c +++ b/resources/rscreate.c @@ -301,7 +301,7 @@ AcpiRsCreatePciRoutingTable ( if ((*TopObjectList)->Common.Type != ACPI_TYPE_PACKAGE) { ACPI_ERROR ((AE_INFO, - "(PRT[%X]) Need sub-package, found %s", + "(PRT[%u]) Need sub-package, found %s", Index, AcpiUtGetObjectTypeName (*TopObjectList))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -311,7 +311,7 @@ AcpiRsCreatePciRoutingTable ( if ((*TopObjectList)->Package.Count != 4) { ACPI_ERROR ((AE_INFO, - "(PRT[%X]) Need package of length 4, found length %d", + "(PRT[%u]) Need package of length 4, found length %u", Index, (*TopObjectList)->Package.Count)); return_ACPI_STATUS (AE_AML_PACKAGE_LIMIT); } @@ -328,7 +328,7 @@ AcpiRsCreatePciRoutingTable ( ObjDesc = SubObjectList[0]; if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER) { - ACPI_ERROR ((AE_INFO, "(PRT[%X].Address) Need Integer, found %s", + ACPI_ERROR ((AE_INFO, "(PRT[%u].Address) Need Integer, found %s", Index, AcpiUtGetObjectTypeName (ObjDesc))); return_ACPI_STATUS (AE_BAD_DATA); } @@ -340,7 +340,7 @@ AcpiRsCreatePciRoutingTable ( ObjDesc = SubObjectList[1]; if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER) { - ACPI_ERROR ((AE_INFO, "(PRT[%X].Pin) Need Integer, found %s", + ACPI_ERROR ((AE_INFO, "(PRT[%u].Pin) Need Integer, found %s", Index, AcpiUtGetObjectTypeName (ObjDesc))); return_ACPI_STATUS (AE_BAD_DATA); } @@ -378,7 +378,7 @@ AcpiRsCreatePciRoutingTable ( if (ObjDesc->Reference.Class != ACPI_REFCLASS_NAME) { ACPI_ERROR ((AE_INFO, - "(PRT[%X].Source) Need name, found Reference Class %X", + "(PRT[%u].Source) Need name, found Reference Class 0x%X", Index, ObjDesc->Reference.Class)); return_ACPI_STATUS (AE_BAD_DATA); } @@ -426,7 +426,7 @@ AcpiRsCreatePciRoutingTable ( default: ACPI_ERROR ((AE_INFO, - "(PRT[%X].Source) Need Ref/String/Integer, found %s", + "(PRT[%u].Source) Need Ref/String/Integer, found %s", Index, AcpiUtGetObjectTypeName (ObjDesc))); return_ACPI_STATUS (AE_BAD_DATA); } @@ -442,7 +442,7 @@ AcpiRsCreatePciRoutingTable ( if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER) { ACPI_ERROR ((AE_INFO, - "(PRT[%X].SourceIndex) Need Integer, found %s", + "(PRT[%u].SourceIndex) Need Integer, found %s", Index, AcpiUtGetObjectTypeName (ObjDesc))); return_ACPI_STATUS (AE_BAD_DATA); } diff --git a/resources/rslist.c b/resources/rslist.c index 8d31a9151975..75f50487a3fc 100644 --- a/resources/rslist.c +++ b/resources/rslist.c @@ -174,7 +174,7 @@ AcpiRsConvertAmlToResources ( if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, - "Could not convert AML resource (Type %X)", *Aml)); + "Could not convert AML resource (Type 0x%X)", *Aml)); return_ACPI_STATUS (Status); } @@ -232,7 +232,7 @@ AcpiRsConvertResourcesToAml ( if (Resource->Type > ACPI_RESOURCE_TYPE_MAX) { ACPI_ERROR ((AE_INFO, - "Invalid descriptor type (%X) in resource list", + "Invalid descriptor type (0x%X) in resource list", Resource->Type)); return_ACPI_STATUS (AE_BAD_DATA); } @@ -245,7 +245,7 @@ AcpiRsConvertResourcesToAml ( if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, - "Could not convert resource (type %X) to AML", + "Could not convert resource (type 0x%X) to AML", Resource->Type)); return_ACPI_STATUS (Status); } diff --git a/resources/rsmisc.c b/resources/rsmisc.c index ecea3e0c1aff..191c7a91c9ca 100644 --- a/resources/rsmisc.c +++ b/resources/rsmisc.c @@ -171,7 +171,7 @@ AcpiRsConvertAmlToResource ( /* Each internal resource struct is expected to be 32-bit aligned */ ACPI_WARNING ((AE_INFO, - "Misaligned resource pointer (get): %p Type %2.2X Len %X", + "Misaligned resource pointer (get): %p Type 0x%2.2X Length %u", Resource, Resource->Type, Resource->Length)); } @@ -659,7 +659,7 @@ AcpiRsConvertResourceToAml ( * "IRQ Format"), so 0x00 and 0x09 are illegal. */ ACPI_ERROR ((AE_INFO, - "Invalid interrupt polarity/trigger in resource list, %X", + "Invalid interrupt polarity/trigger in resource list, 0x%X", Aml->Irq.Flags)); return_ACPI_STATUS (AE_BAD_DATA); } diff --git a/tables/tbfadt.c b/tables/tbfadt.c index b6d32f3cc14c..9ae4669d94ae 100644 --- a/tables/tbfadt.c +++ b/tables/tbfadt.c @@ -388,7 +388,7 @@ AcpiTbCreateLocalFadt ( { ACPI_WARNING ((AE_INFO, "FADT (revision %u) is longer than ACPI 2.0 version, " - "truncating length 0x%X to 0x%X", + "truncating length %u to %u", Table->Revision, Length, (UINT32) sizeof (ACPI_TABLE_FADT))); } @@ -521,7 +521,7 @@ AcpiTbConvertFadt ( (Address64->Address != (UINT64) Address32)) { ACPI_ERROR ((AE_INFO, - "32/64X address mismatch in %s: %8.8X/%8.8X%8.8X, using 32", + "32/64X address mismatch in %s: 0x%8.8X/0x%8.8X%8.8X, using 32", FadtInfoTable[i].Name, Address32, ACPI_FORMAT_UINT64 (Address64->Address))); } @@ -582,7 +582,7 @@ AcpiTbValidateFadt ( { ACPI_WARNING ((AE_INFO, "32/64X FACS address mismatch in FADT - " - "%8.8X/%8.8X%8.8X, using 32", + "0x%8.8X/0x%8.8X%8.8X, using 32", AcpiGbl_FADT.Facs, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XFacs))); AcpiGbl_FADT.XFacs = (UINT64) AcpiGbl_FADT.Facs; @@ -593,7 +593,7 @@ AcpiTbValidateFadt ( { ACPI_WARNING ((AE_INFO, "32/64X DSDT address mismatch in FADT - " - "%8.8X/%8.8X%8.8X, using 32", + "0x%8.8X/0x%8.8X%8.8X, using 32", AcpiGbl_FADT.Dsdt, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XDsdt))); AcpiGbl_FADT.XDsdt = (UINT64) AcpiGbl_FADT.Dsdt; @@ -621,7 +621,7 @@ AcpiTbValidateFadt ( (Address64->BitWidth != ACPI_MUL_8 (Length))) { ACPI_WARNING ((AE_INFO, - "32/64X length mismatch in %s: %d/%d", + "32/64X length mismatch in %s: %u/%u", Name, ACPI_MUL_8 (Length), Address64->BitWidth)); } @@ -635,7 +635,7 @@ AcpiTbValidateFadt ( { ACPI_ERROR ((AE_INFO, "Required field %s has zero address and/or length:" - " %8.8X%8.8X/%X", + " 0x%8.8X%8.8X/0x%X", Name, ACPI_FORMAT_UINT64 (Address64->Address), Length)); } } @@ -651,7 +651,7 @@ AcpiTbValidateFadt ( { ACPI_WARNING ((AE_INFO, "Optional field %s has zero address or length: " - "%8.8X%8.8X/%X", + "0x%8.8X%8.8X/0x%X", Name, ACPI_FORMAT_UINT64 (Address64->Address), Length)); } } @@ -702,7 +702,7 @@ AcpiTbSetupFadtRegisters ( (FadtInfoTable[i].DefaultLength != Target64->BitWidth)) { ACPI_WARNING ((AE_INFO, - "Invalid length for %s: %d, using default %d", + "Invalid length for %s: %u, using default %u", FadtInfoTable[i].Name, Target64->BitWidth, FadtInfoTable[i].DefaultLength)); diff --git a/tables/tbutils.c b/tables/tbutils.c index 0959ab25a5fc..a496556f43e3 100644 --- a/tables/tbutils.c +++ b/tables/tbutils.c @@ -349,7 +349,7 @@ AcpiTbVerifyChecksum ( if (Checksum) { ACPI_WARNING ((AE_INFO, - "Incorrect checksum in table [%4.4s] - %2.2X, should be %2.2X", + "Incorrect checksum in table [%4.4s] - 0x%2.2X, should be 0x%2.2X", Table->Signature, Table->Checksum, (UINT8) (Table->Checksum - Checksum))); @@ -552,7 +552,7 @@ AcpiTbGetRootTableEntry ( /* Will truncate 64-bit address to 32 bits, issue warning */ ACPI_WARNING ((AE_INFO, - "64-bit Physical Address in XSDT is too large (%8.8X%8.8X)," + "64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X)," " truncating", ACPI_FORMAT_UINT64 (Address64))); } diff --git a/tables/tbxfroot.c b/tables/tbxfroot.c index 4f0ab81084a1..6f120063b72e 100644 --- a/tables/tbxfroot.c +++ b/tables/tbxfroot.c @@ -227,7 +227,7 @@ AcpiFindRootPointer ( if (!TablePtr) { ACPI_ERROR ((AE_INFO, - "Could not map memory at %8.8X for length %X", + "Could not map memory at 0x%8.8X for length %u", ACPI_EBDA_PTR_LOCATION, ACPI_EBDA_PTR_LENGTH)); return_ACPI_STATUS (AE_NO_MEMORY); @@ -254,7 +254,7 @@ AcpiFindRootPointer ( if (!TablePtr) { ACPI_ERROR ((AE_INFO, - "Could not map memory at %8.8X for length %X", + "Could not map memory at 0x%8.8X for length %u", PhysicalAddress, ACPI_EBDA_WINDOW_SIZE)); return_ACPI_STATUS (AE_NO_MEMORY); @@ -284,7 +284,7 @@ AcpiFindRootPointer ( if (!TablePtr) { ACPI_ERROR ((AE_INFO, - "Could not map memory at %8.8X for length %X", + "Could not map memory at 0x%8.8X for length %u", ACPI_HI_RSDP_WINDOW_BASE, ACPI_HI_RSDP_WINDOW_SIZE)); return_ACPI_STATUS (AE_NO_MEMORY); diff --git a/tools/acpiexec/Makefile b/tools/acpiexec/Makefile index 2022bbbf3bb2..f21adcbe88f6 100644 --- a/tools/acpiexec/Makefile +++ b/tools/acpiexec/Makefile @@ -49,6 +49,7 @@ SRCS= aetables.c aehandlers.c aeexec.c aemain.c \ ../../executer/exconfig.c \ ../../executer/exconvrt.c \ ../../executer/excreate.c \ + ../../executer/exdebug.c \ ../../executer/exdump.c \ ../../executer/exfield.c \ ../../executer/exfldio.c \ diff --git a/tools/acpiexec/aehandlers.c b/tools/acpiexec/aehandlers.c index 28450cec74b6..53424f61e5cb 100644 --- a/tools/acpiexec/aehandlers.c +++ b/tools/acpiexec/aehandlers.c @@ -922,7 +922,7 @@ AeRegionHandler ( ((UINT64)(RegionElement->Address) + RegionElement->Length)) { ACPI_WARNING ((AE_INFO, - "Request on [%4.4s] is beyond region limit Req-%X+%X, Base=%X, Len-%X", + "Request on [%4.4s] is beyond region limit Req-0x%X+0x%X, Base=0x%X, Len-0x%X", (RegionObject->Region.Node)->Name.Ascii, (UINT32) Address, ByteWidth, (UINT32)(RegionElement->Address), RegionElement->Length)); diff --git a/tools/acpisrc/astable.c b/tools/acpisrc/astable.c index 2a9eee6b673d..51c7f3d00c75 100644 --- a/tools/acpisrc/astable.c +++ b/tools/acpisrc/astable.c @@ -523,6 +523,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_TABLE_IVRS", SRC_TYPE_STRUCT}, {"ACPI_TABLE_MADT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_MCFG", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_MCHI", SRC_TYPE_STRUCT}, {"ACPI_TABLE_MSCT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_RSDP", SRC_TYPE_STRUCT}, {"ACPI_TABLE_RSDT", SRC_TYPE_STRUCT}, diff --git a/tools/examples/examples.c b/tools/examples/examples.c index dc88bae62cb6..53623d93446b 100644 --- a/tools/examples/examples.c +++ b/tools/examples/examples.c @@ -393,7 +393,7 @@ NotifyHandler ( void *Context) { - ACPI_INFO ((AE_INFO, "Received a notify %X", Value)); + ACPI_INFO ((AE_INFO, "Received a notify 0x%X", Value)); } @@ -482,7 +482,7 @@ ExecuteOSI (void) AcpiOsPrintf ("Invalid return type from _OSI, %.2X\n", Object->Type); } - ACPI_INFO ((AE_INFO, "_OSI returned %.8X", (UINT32) Object->Integer.Value)); + ACPI_INFO ((AE_INFO, "_OSI returned 0x%8.8X", (UINT32) Object->Integer.Value)); AcpiOsFree (Object); return; } diff --git a/utilities/utalloc.c b/utilities/utalloc.c index f72959a4d82a..f2478b2962e2 100644 --- a/utilities/utalloc.c +++ b/utilities/utalloc.c @@ -438,7 +438,7 @@ AcpiUtAllocate ( /* Report allocation error */ ACPI_WARNING ((Module, Line, - "Could not allocate size %X", (UINT32) Size)); + "Could not allocate size %u", (UINT32) Size)); return_PTR (NULL); } diff --git a/utilities/utdelete.c b/utilities/utdelete.c index 31bf40b4e745..7ef61f8b065e 100644 --- a/utilities/utdelete.c +++ b/utilities/utdelete.c @@ -539,7 +539,7 @@ AcpiUtUpdateRefCount ( default: - ACPI_ERROR ((AE_INFO, "Unknown action (%X)", Action)); + ACPI_ERROR ((AE_INFO, "Unknown action (0x%X)", Action)); break; } @@ -550,7 +550,7 @@ AcpiUtUpdateRefCount ( if (Count > ACPI_MAX_REFERENCE_COUNT) { ACPI_WARNING ((AE_INFO, - "Large Reference Count (%X) in object %p", Count, Object)); + "Large Reference Count (0x%X) in object %p", Count, Object)); } } diff --git a/utilities/uteval.c b/utilities/uteval.c index c959d44bb594..bb7110bf18e4 100644 --- a/utilities/uteval.c +++ b/utilities/uteval.c @@ -381,7 +381,7 @@ AcpiUtEvaluateObject ( PrefixNode, Path, AE_TYPE); ACPI_ERROR ((AE_INFO, - "Type returned from %s was incorrect: %s, expected Btypes: %X", + "Type returned from %s was incorrect: %s, expected Btypes: 0x%X", Path, AcpiUtGetObjectTypeName (Info->ReturnObject), ExpectedReturnBtypes)); diff --git a/utilities/utmisc.c b/utilities/utmisc.c index 37b15e2c4c7b..8357aceb318d 100644 --- a/utilities/utmisc.c +++ b/utilities/utmisc.c @@ -308,7 +308,7 @@ AcpiUtAllocateOwnerId ( if (*OwnerId) { - ACPI_ERROR ((AE_INFO, "Owner ID [%2.2X] already exists", *OwnerId)); + ACPI_ERROR ((AE_INFO, "Owner ID [0x%2.2X] already exists", *OwnerId)); return_ACPI_STATUS (AE_ALREADY_EXISTS); } @@ -427,7 +427,7 @@ AcpiUtReleaseOwnerId ( if (OwnerId == 0) { - ACPI_ERROR ((AE_INFO, "Invalid OwnerId: %2.2X", OwnerId)); + ACPI_ERROR ((AE_INFO, "Invalid OwnerId: 0x%2.2X", OwnerId)); return_VOID; } @@ -457,7 +457,7 @@ AcpiUtReleaseOwnerId ( else { ACPI_ERROR ((AE_INFO, - "Release of non-allocated OwnerId: %2.2X", OwnerId + 1)); + "Release of non-allocated OwnerId: 0x%2.2X", OwnerId + 1)); } (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); diff --git a/utilities/utmutex.c b/utilities/utmutex.c index 9e0ed3b713c7..ec29616eb2d7 100644 --- a/utilities/utmutex.c +++ b/utilities/utmutex.c @@ -374,7 +374,7 @@ AcpiUtAcquireMutex ( else { ACPI_EXCEPTION ((AE_INFO, Status, - "Thread %p could not acquire Mutex [%X]", + "Thread %p could not acquire Mutex [0x%X]", ACPI_CAST_PTR (void, ThisThreadId), MutexId)); } @@ -419,7 +419,7 @@ AcpiUtReleaseMutex ( if (AcpiGbl_MutexInfo[MutexId].ThreadId == ACPI_MUTEX_NOT_ACQUIRED) { ACPI_ERROR ((AE_INFO, - "Mutex [%X] is not acquired, cannot release", MutexId)); + "Mutex [0x%X] is not acquired, cannot release", MutexId)); return (AE_NOT_ACQUIRED); } diff --git a/utilities/utobject.c b/utilities/utobject.c index fabed520c798..0a9f1e7f6f0d 100644 --- a/utilities/utobject.c +++ b/utilities/utobject.c @@ -354,7 +354,7 @@ AcpiUtCreateBufferObject ( Buffer = ACPI_ALLOCATE_ZEROED (BufferSize); if (!Buffer) { - ACPI_ERROR ((AE_INFO, "Could not allocate size %X", + ACPI_ERROR ((AE_INFO, "Could not allocate size %u", (UINT32) BufferSize)); AcpiUtRemoveReference (BufferDesc); return_PTR (NULL); @@ -413,7 +413,7 @@ AcpiUtCreateStringObject ( String = ACPI_ALLOCATE_ZEROED (StringSize + 1); if (!String) { - ACPI_ERROR ((AE_INFO, "Could not allocate size %X", + ACPI_ERROR ((AE_INFO, "Could not allocate size %u", (UINT32) StringSize)); AcpiUtRemoveReference (StringDesc); return_PTR (NULL); @@ -671,7 +671,7 @@ AcpiUtGetSimpleObjectSize ( * required eventually. */ ACPI_ERROR ((AE_INFO, "Cannot convert to external object - " - "unsupported Reference Class [%s] %X in object %p", + "unsupported Reference Class [%s] 0x%X in object %p", AcpiUtGetReferenceName (InternalObject), InternalObject->Reference.Class, InternalObject)); Status = AE_TYPE; @@ -683,7 +683,7 @@ AcpiUtGetSimpleObjectSize ( default: ACPI_ERROR ((AE_INFO, "Cannot convert to external object - " - "unsupported type [%s] %X in object %p", + "unsupported type [%s] 0x%X in object %p", AcpiUtGetObjectTypeName (InternalObject), InternalObject->Common.Type, InternalObject)); Status = AE_TYPE; diff --git a/utilities/uttrack.c b/utilities/uttrack.c index 500ed458248c..37fdba1c446c 100644 --- a/utilities/uttrack.c +++ b/utilities/uttrack.c @@ -282,7 +282,7 @@ AcpiUtAllocateZeroedAndTrack ( /* Report allocation error */ ACPI_ERROR ((Module, Line, - "Could not allocate size %X", (UINT32) Size)); + "Could not allocate size %u", (UINT32) Size)); return (NULL); } @@ -715,7 +715,7 @@ AcpiUtDumpAllocations ( else { ACPI_ERROR ((AE_INFO, - "%d(%X) Outstanding allocations", + "%d(0x%X) Outstanding allocations", NumOutstanding, NumOutstanding)); }