diff options
Diffstat (limited to 'source/components')
-rw-r--r-- | source/components/debugger/dbdisply.c | 11 | ||||
-rw-r--r-- | source/components/debugger/dbexec.c | 6 | ||||
-rw-r--r-- | source/components/debugger/dbutils.c | 4 | ||||
-rw-r--r-- | source/components/disassembler/dmopcode.c | 213 | ||||
-rw-r--r-- | source/components/disassembler/dmwalk.c | 55 | ||||
-rw-r--r-- | source/components/dispatcher/dsfield.c | 4 | ||||
-rw-r--r-- | source/components/dispatcher/dsopcode.c | 14 | ||||
-rw-r--r-- | source/components/events/evgpe.c | 15 | ||||
-rw-r--r-- | source/components/events/evgpeutil.c | 19 | ||||
-rw-r--r-- | source/components/events/evxfgpe.c | 70 | ||||
-rw-r--r-- | source/components/executer/exconfig.c | 2 | ||||
-rw-r--r-- | source/components/utilities/utmisc.c | 4 |
12 files changed, 375 insertions, 42 deletions
diff --git a/source/components/debugger/dbdisply.c b/source/components/debugger/dbdisply.c index 7facc8dd08ffa..b58cb1c346fb5 100644 --- a/source/components/debugger/dbdisply.c +++ b/source/components/debugger/dbdisply.c @@ -792,10 +792,12 @@ AcpiDbDisplayGpes ( ACPI_GPE_EVENT_INFO *GpeEventInfo; ACPI_GPE_REGISTER_INFO *GpeRegisterInfo; char *GpeType; + ACPI_GPE_NOTIFY_INFO *Notify; UINT32 GpeIndex; UINT32 Block = 0; UINT32 i; UINT32 j; + UINT32 Count; char Buffer[80]; ACPI_BUFFER RetBuf; ACPI_STATUS Status; @@ -916,7 +918,14 @@ AcpiDbDisplayGpes ( AcpiOsPrintf ("Handler"); break; case ACPI_GPE_DISPATCH_NOTIFY: - AcpiOsPrintf ("Notify"); + Count = 0; + Notify = GpeEventInfo->Dispatch.NotifyList; + while (Notify) + { + Count++; + Notify = Notify->Next; + } + AcpiOsPrintf ("Implicit Notify on %u devices", Count); break; default: AcpiOsPrintf ("UNKNOWN: %X", diff --git a/source/components/debugger/dbexec.c b/source/components/debugger/dbexec.c index 7818c9ddbef83..4b59f22053a7b 100644 --- a/source/components/debugger/dbexec.c +++ b/source/components/debugger/dbexec.c @@ -872,8 +872,8 @@ AcpiDbMethodThread ( if (Info->InitArgs) { - AcpiDbUInt32ToHexString (Info->NumCreated, Info->IndexOfThreadStr); - AcpiDbUInt32ToHexString ((UINT32) AcpiOsGetThreadId (), Info->IdOfThreadStr); + AcpiDbUint32ToHexString (Info->NumCreated, Info->IndexOfThreadStr); + AcpiDbUint32ToHexString ((UINT32) AcpiOsGetThreadId (), Info->IdOfThreadStr); } if (Info->Threads && (Info->NumCreated < Info->NumThreads)) @@ -1063,7 +1063,7 @@ AcpiDbCreateExecutionThreads ( AcpiGbl_DbMethodInfo.ArgTypes[1] = ACPI_TYPE_INTEGER; AcpiGbl_DbMethodInfo.ArgTypes[2] = ACPI_TYPE_INTEGER; - AcpiDbUInt32ToHexString (NumThreads, AcpiGbl_DbMethodInfo.NumThreadsStr); + AcpiDbUint32ToHexString (NumThreads, AcpiGbl_DbMethodInfo.NumThreadsStr); AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo); diff --git a/source/components/debugger/dbutils.c b/source/components/debugger/dbutils.c index cf29b225de0fb..7ce909033965b 100644 --- a/source/components/debugger/dbutils.c +++ b/source/components/debugger/dbutils.c @@ -360,7 +360,7 @@ AcpiDbLocalNsLookup ( /******************************************************************************* * - * FUNCTION: AcpiDbUInt32ToHexString + * FUNCTION: AcpiDbUint32ToHexString * * PARAMETERS: Value - The value to be converted to string * Buffer - Buffer for result (not less than 11 bytes) @@ -375,7 +375,7 @@ AcpiDbLocalNsLookup ( ******************************************************************************/ void -AcpiDbUInt32ToHexString ( +AcpiDbUint32ToHexString ( UINT32 Value, char *Buffer) { diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c index 6d2c3e1ecf552..b52bdb28151fe 100644 --- a/source/components/disassembler/dmopcode.c +++ b/source/components/disassembler/dmopcode.c @@ -46,6 +46,7 @@ #include "acparser.h" #include "amlcode.h" #include "acdisasm.h" +#include "acnamesp.h" #ifdef ACPI_DISASSEMBLER @@ -61,6 +62,218 @@ AcpiDmMatchKeyword ( /******************************************************************************* * + * FUNCTION: AcpiDmPredefinedDescription + * + * PARAMETERS: Op - Name() parse object + * + * RETURN: None + * + * DESCRIPTION: Emit a description comment for a predefined ACPI name. + * Used for iASL compiler only. + * + ******************************************************************************/ + +void +AcpiDmPredefinedDescription ( + ACPI_PARSE_OBJECT *Op) +{ +#ifdef ACPI_ASL_COMPILER + const AH_PREDEFINED_NAME *Info; + char *NameString; + int LastCharIsDigit; + int LastCharsAreHex; + + + if (!Op) + { + return; + } + + /* Ensure that the comment field is emitted only once */ + + if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEF_CHECKED) + { + return; + } + Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEF_CHECKED; + + /* Predefined name must start with an underscore */ + + NameString = ACPI_CAST_PTR (char, &Op->Named.Name); + if (NameString[0] != '_') + { + return; + } + + /* + * Check for the special ACPI names: + * _ACd, _ALd, _EJd, _Exx, _Lxx, _Qxx, _Wxx, _T_a + * (where d=decimal_digit, x=hex_digit, a=anything) + * + * Convert these to the generic name for table lookup. + * Note: NameString is guaranteed to be upper case here. + */ + LastCharIsDigit = + (ACPI_IS_DIGIT (NameString[3])); /* d */ + LastCharsAreHex = + (ACPI_IS_XDIGIT (NameString[2]) && /* xx */ + ACPI_IS_XDIGIT (NameString[3])); + + switch (NameString[1]) + { + case 'A': + if ((NameString[2] == 'C') && (LastCharIsDigit)) + { + NameString = "_ACx"; + } + else if ((NameString[2] == 'L') && (LastCharIsDigit)) + { + NameString = "_ALx"; + } + break; + + case 'E': + if ((NameString[2] == 'J') && (LastCharIsDigit)) + { + NameString = "_EJx"; + } + else if (LastCharsAreHex) + { + NameString = "_Exx"; + } + break; + + case 'L': + if (LastCharsAreHex) + { + NameString = "_Lxx"; + } + break; + + case 'Q': + if (LastCharsAreHex) + { + NameString = "_Qxx"; + } + break; + + case 'T': + if (NameString[2] == '_') + { + NameString = "_T_x"; + } + break; + + case 'W': + if (LastCharsAreHex) + { + NameString = "_Wxx"; + } + break; + + default: + break; + } + + /* Match the name in the info table */ + + for (Info = AslPredefinedInfo; Info->Name; Info++) + { + if (ACPI_COMPARE_NAME (NameString, Info->Name)) + { + AcpiOsPrintf (" // %4.4s: %s", + NameString, ACPI_CAST_PTR (char, Info->Description)); + return; + } + } + +#endif + return; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmFieldPredefinedDescription + * + * PARAMETERS: Op - Parse object + * + * RETURN: None + * + * DESCRIPTION: Emit a description comment for a resource descriptor tag + * (which is a predefined ACPI name.) Used for iASL compiler only. + * + ******************************************************************************/ + +void +AcpiDmFieldPredefinedDescription ( + ACPI_PARSE_OBJECT *Op) +{ +#ifdef ACPI_ASL_COMPILER + ACPI_PARSE_OBJECT *IndexOp; + char *Tag; + const ACPI_OPCODE_INFO *OpInfo; + const AH_PREDEFINED_NAME *Info; + + + if (!Op) + { + return; + } + + /* Ensure that the comment field is emitted only once */ + + if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEF_CHECKED) + { + return; + } + Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEF_CHECKED; + + /* + * Op must be one of the Create* operators: CreateField, CreateBitField, + * CreateByteField, CreateWordField, CreateDwordField, CreateQwordField + */ + OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); + if (!(OpInfo->Flags & AML_CREATE)) + { + return; + } + + /* Second argument is the Index argument */ + + IndexOp = Op->Common.Value.Arg; + IndexOp = IndexOp->Common.Next; + + /* Index argument must be a namepath */ + + if (IndexOp->Common.AmlOpcode != AML_INT_NAMEPATH_OP) + { + return; + } + + /* Major cheat: We previously put the Tag ptr in the Node field */ + + Tag = ACPI_CAST_PTR (char, IndexOp->Common.Node); + + /* Match the name in the info table */ + + for (Info = AslPredefinedInfo; Info->Name; Info++) + { + if (ACPI_COMPARE_NAME (Tag, Info->Name)) + { + AcpiOsPrintf (" // %4.4s: %s", Tag, + ACPI_CAST_PTR (char, Info->Description)); + return; + } + } + +#endif + return; +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmMethodFlags * * PARAMETERS: Op - Method Object to be examined diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c index dd3ee002557bb..6a6b95e1f71d6 100644 --- a/source/components/disassembler/dmwalk.c +++ b/source/components/disassembler/dmwalk.c @@ -453,7 +453,7 @@ AcpiDmDescendingOp ( * keep track of the current column. */ Info->Count++; - if (Info->Count /*+Info->LastLevel*/ > 10) + if (Info->Count /* +Info->LastLevel */ > 10) { Info->Count = 0; AcpiOsPrintf ("\n"); @@ -533,6 +533,10 @@ AcpiDmDescendingOp ( AcpiDmMethodFlags (Op); AcpiOsPrintf (")"); + + /* Emit description comment for Method() with a predefined ACPI name */ + + AcpiDmPredefinedDescription (Op); break; @@ -603,7 +607,8 @@ AcpiDmDescendingOp ( default: - AcpiOsPrintf ("*** Unhandled named opcode %X\n", Op->Common.AmlOpcode); + AcpiOsPrintf ("*** Unhandled named opcode %X\n", + Op->Common.AmlOpcode); break; } } @@ -644,7 +649,8 @@ AcpiDmDescendingOp ( NextOp = NextOp->Common.Next; Info->Flags = ACPI_PARSEOP_PARAMLIST; - AcpiDmWalkParseTree (NextOp, AcpiDmDescendingOp, AcpiDmAscendingOp, Info); + AcpiDmWalkParseTree (NextOp, AcpiDmDescendingOp, + AcpiDmAscendingOp, Info); Info->Flags = 0; Info->Level = Level; @@ -686,12 +692,18 @@ AcpiDmDescendingOp ( if (Op->Common.DisasmOpcode == ACPI_DASM_RESOURCE) { /* - * We have a resource list. Don't need to output - * the buffer size Op. Open up a new block + * We have a resource list. Don't need to output + * the buffer size Op. Open up a new block */ NextOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; NextOp = NextOp->Common.Next; - AcpiOsPrintf (")\n"); + AcpiOsPrintf (")"); + + /* Emit description comment for Name() with a predefined ACPI name */ + + AcpiDmPredefinedDescription (Op->Asl.Parent); + + AcpiOsPrintf ("\n"); AcpiDmIndent (Info->Level); AcpiOsPrintf ("{\n"); return (AE_OK); @@ -719,7 +731,7 @@ AcpiDmDescendingOp ( case AML_PACKAGE_OP: - /* The next op is the size or predicate parameter */ + /* The next op is the size parameter */ NextOp = AcpiPsGetDepthNext (NULL, Op); if (NextOp) @@ -772,6 +784,7 @@ AcpiDmAscendingOp ( void *Context) { ACPI_OP_WALK_INFO *Info = Context; + ACPI_PARSE_OBJECT *ParentOp; if (Op->Common.DisasmFlags & ACPI_PARSEOP_IGNORE) @@ -797,6 +810,19 @@ AcpiDmAscendingOp ( AcpiOsPrintf (")"); + if (Op->Common.AmlOpcode == AML_NAME_OP) + { + /* Emit description comment for Name() with a predefined ACPI name */ + + AcpiDmPredefinedDescription (Op); + } + else + { + /* For Create* operators, attempt to emit resource tag description */ + + AcpiDmFieldPredefinedDescription (Op); + } + /* Could be a nested operator, check if comma required */ if (!AcpiDmCommaIfListMember (Op)) @@ -911,7 +937,20 @@ AcpiDmAscendingOp ( */ if (Op->Common.Next) { - AcpiOsPrintf (")\n"); + AcpiOsPrintf (")"); + + /* Emit description comment for Name() with a predefined ACPI name */ + + ParentOp = Op->Common.Parent; + if (ParentOp) + { + ParentOp = ParentOp->Common.Parent; + if (ParentOp && ParentOp->Asl.AmlOpcode == AML_NAME_OP) + { + AcpiDmPredefinedDescription (ParentOp); + } + } + AcpiOsPrintf ("\n"); AcpiDmIndent (Level - 1); AcpiOsPrintf ("{\n"); } diff --git a/source/components/dispatcher/dsfield.c b/source/components/dispatcher/dsfield.c index 8a364c8a90bce..e3e05b925c2df 100644 --- a/source/components/dispatcher/dsfield.c +++ b/source/components/dispatcher/dsfield.c @@ -152,8 +152,8 @@ AcpiDsCreateExternalRegion ( * CreateBitFieldOp, * CreateByteFieldOp, * CreateWordFieldOp, - * CreateDWordFieldOp, - * CreateQWordFieldOp, + * CreateDwordFieldOp, + * CreateQwordFieldOp, * CreateFieldOp (all of which define a field in a buffer) * ******************************************************************************/ diff --git a/source/components/dispatcher/dsopcode.c b/source/components/dispatcher/dsopcode.c index 7569236f2ebe7..6fd58d86e6ef6 100644 --- a/source/components/dispatcher/dsopcode.c +++ b/source/components/dispatcher/dsopcode.c @@ -523,18 +523,18 @@ AcpiDsEvalTableRegionOperands ( /* - * This is where we evaluate the SignatureString and OemIDString - * and OemTableIDString of the DataTableRegion declaration + * This is where we evaluate the Signature string, OemId string, + * and OemTableId string of the Data Table Region declaration */ Node = Op->Common.Node; - /* NextOp points to SignatureString op */ + /* NextOp points to Signature string op */ NextOp = Op->Common.Value.Arg; /* - * Evaluate/create the SignatureString and OemIDString - * and OemTableIDString operands + * Evaluate/create the Signature string, OemId string, + * and OemTableId string operands */ Status = AcpiDsCreateOperands (WalkState, NextOp); if (ACPI_FAILURE (Status)) @@ -543,8 +543,8 @@ AcpiDsEvalTableRegionOperands ( } /* - * Resolve the SignatureString and OemIDString - * and OemTableIDString operands + * Resolve the Signature string, OemId string, + * and OemTableId string operands */ Status = AcpiExResolveOperands (Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState); diff --git a/source/components/events/evgpe.c b/source/components/events/evgpe.c index a3781a55c66bf..623795a836199 100644 --- a/source/components/events/evgpe.c +++ b/source/components/events/evgpe.c @@ -518,6 +518,7 @@ AcpiEvAsynchExecuteGpeMethod ( ACPI_STATUS Status; ACPI_GPE_EVENT_INFO *LocalGpeEventInfo; ACPI_EVALUATE_INFO *Info; + ACPI_GPE_NOTIFY_INFO *Notify; ACPI_FUNCTION_TRACE (EvAsynchExecuteGpeMethod); @@ -573,10 +574,18 @@ AcpiEvAsynchExecuteGpeMethod ( * completes. The notify handlers are NOT invoked synchronously * from this thread -- because handlers may in turn run other * control methods. + * + * June 2012: Expand implicit notify mechanism to support + * notifies on multiple device objects. */ - Status = AcpiEvQueueNotifyRequest ( - LocalGpeEventInfo->Dispatch.DeviceNode, - ACPI_NOTIFY_DEVICE_WAKE); + Notify = LocalGpeEventInfo->Dispatch.NotifyList; + while (ACPI_SUCCESS (Status) && Notify) + { + Status = AcpiEvQueueNotifyRequest (Notify->DeviceNode, + ACPI_NOTIFY_DEVICE_WAKE); + + Notify = Notify->Next; + } break; case ACPI_GPE_DISPATCH_METHOD: diff --git a/source/components/events/evgpeutil.c b/source/components/events/evgpeutil.c index 70580cd853c93..00057350c46a8 100644 --- a/source/components/events/evgpeutil.c +++ b/source/components/events/evgpeutil.c @@ -391,6 +391,8 @@ AcpiEvDeleteGpeHandlers ( void *Context) { ACPI_GPE_EVENT_INFO *GpeEventInfo; + ACPI_GPE_NOTIFY_INFO *Notify; + ACPI_GPE_NOTIFY_INFO *Next; UINT32 i; UINT32 j; @@ -412,10 +414,27 @@ AcpiEvDeleteGpeHandlers ( if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_HANDLER) { + /* Delete an installed handler block */ + ACPI_FREE (GpeEventInfo->Dispatch.Handler); GpeEventInfo->Dispatch.Handler = NULL; GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK; } + else if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == + ACPI_GPE_DISPATCH_NOTIFY) + { + /* Delete the implicit notification device list */ + + Notify = GpeEventInfo->Dispatch.NotifyList; + while (Notify) + { + Next = Notify->Next; + ACPI_FREE (Notify); + Notify = Next; + } + GpeEventInfo->Dispatch.NotifyList = NULL; + GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK; + } } } diff --git a/source/components/events/evxfgpe.c b/source/components/events/evxfgpe.c index c0dd88c77752c..daea88804ddbf 100644 --- a/source/components/events/evxfgpe.c +++ b/source/components/events/evxfgpe.c @@ -295,9 +295,10 @@ AcpiSetupGpeForWake ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber) { - ACPI_STATUS Status = AE_BAD_PARAMETER; + ACPI_STATUS Status; ACPI_GPE_EVENT_INFO *GpeEventInfo; ACPI_NAMESPACE_NODE *DeviceNode; + ACPI_GPE_NOTIFY_INFO *Notify; ACPI_CPU_FLAGS Flags; @@ -338,26 +339,69 @@ AcpiSetupGpeForWake ( /* Ensure that we have a valid GPE number */ GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber); - if (GpeEventInfo) + if (!GpeEventInfo) + { + Status = AE_BAD_PARAMETER; + goto UnlockAndExit; + } + + /* + * If there is no method or handler for this GPE, then the + * WakeDevice will be notified whenever this GPE fires. This is + * known as an "implicit notify". Note: The GPE is assumed to be + * level-triggered (for windows compatibility). + */ + if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == + ACPI_GPE_DISPATCH_NONE) { /* - * If there is no method or handler for this GPE, then the - * WakeDevice will be notified whenever this GPE fires (aka - * "implicit notify") Note: The GPE is assumed to be - * level-triggered (for windows compatibility). + * This is the first device for implicit notify on this GPE. + * Just set the flags here, and enter the NOTIFY block below. */ - if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == - ACPI_GPE_DISPATCH_NONE) + GpeEventInfo->Flags = + (ACPI_GPE_DISPATCH_NOTIFY | ACPI_GPE_LEVEL_TRIGGERED); + } + + /* + * If we already have an implicit notify on this GPE, add + * this device to the notify list. + */ + if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == + ACPI_GPE_DISPATCH_NOTIFY) + { + /* Ensure that the device is not already in the list */ + + Notify = GpeEventInfo->Dispatch.NotifyList; + while (Notify) { - GpeEventInfo->Flags = - (ACPI_GPE_DISPATCH_NOTIFY | ACPI_GPE_LEVEL_TRIGGERED); - GpeEventInfo->Dispatch.DeviceNode = DeviceNode; + if (Notify->DeviceNode == DeviceNode) + { + Status = AE_ALREADY_EXISTS; + goto UnlockAndExit; + } + Notify = Notify->Next; } - GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE; - Status = AE_OK; + /* Add this device to the notify list for this GPE */ + + Notify = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_NOTIFY_INFO)); + if (!Notify) + { + Status = AE_NO_MEMORY; + goto UnlockAndExit; + } + + Notify->DeviceNode = DeviceNode; + Notify->Next = GpeEventInfo->Dispatch.NotifyList; + GpeEventInfo->Dispatch.NotifyList = Notify; } + /* Mark the GPE as a possible wake event */ + + GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE; + Status = AE_OK; + +UnlockAndExit: AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); return_ACPI_STATUS (Status); } diff --git a/source/components/executer/exconfig.c b/source/components/executer/exconfig.c index 9e05497b9f560..581bc574e4dc4 100644 --- a/source/components/executer/exconfig.c +++ b/source/components/executer/exconfig.c @@ -179,7 +179,7 @@ AcpiExLoadTableOp ( ACPI_FUNCTION_TRACE (ExLoadTableOp); - /* Validate lengths for the SignatureString, OEMIDString, OEMTableID */ + /* Validate lengths for the Signature, OemId, and OemTableId strings */ if ((Operand[0]->String.Length > ACPI_NAME_SIZE) || (Operand[1]->String.Length > ACPI_OEM_ID_SIZE) || diff --git a/source/components/utilities/utmisc.c b/source/components/utilities/utmisc.c index 7ce00df642818..72662b95dd01f 100644 --- a/source/components/utilities/utmisc.c +++ b/source/components/utilities/utmisc.c @@ -53,6 +53,7 @@ ACPI_MODULE_NAME ("utmisc") +#if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP /******************************************************************************* * * FUNCTION: UtConvertBackslashes @@ -86,6 +87,7 @@ UtConvertBackslashes ( Pathname++; } } +#endif /******************************************************************************* @@ -1330,5 +1332,3 @@ AcpiUtWalkPackageTree ( return_ACPI_STATUS (AE_AML_INTERNAL); } - - |