本文整理匯總了C++中ACPI_CAST_INDIRECT_PTR函數的典型用法代碼示例。如果您正苦於以下問題:C++ ACPI_CAST_INDIRECT_PTR函數的具體用法?C++ ACPI_CAST_INDIRECT_PTR怎麽用?C++ ACPI_CAST_INDIRECT_PTR使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ACPI_CAST_INDIRECT_PTR函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: AcpiTbInitializeFacs
ACPI_STATUS
AcpiTbInitializeFacs (
void)
{
/* If Hardware Reduced flag is set, there is no FACS */
if (AcpiGbl_ReducedHardware)
{
AcpiGbl_FACS = NULL;
return (AE_OK);
}
(void) AcpiGetTableByIndex (ACPI_TABLE_INDEX_FACS,
ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_Facs32));
(void) AcpiGetTableByIndex (ACPI_TABLE_INDEX_X_FACS,
ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_Facs64));
if (AcpiGbl_Facs64 && (!AcpiGbl_Facs32 || !AcpiGbl_Use32BitFacsAddresses))
{
AcpiGbl_FACS = AcpiGbl_Facs64;
}
else if (AcpiGbl_Facs32)
{
AcpiGbl_FACS = AcpiGbl_Facs32;
}
/* If there is no FACS, just continue. There was already an error msg */
return (AE_OK);
}
示例2: AcpiTbInitializeFacs
ACPI_STATUS
AcpiTbInitializeFacs (
void)
{
ACPI_TABLE_FACS *Facs;
/* If Hardware Reduced flag is set, there is no FACS */
if (AcpiGbl_ReducedHardware)
{
AcpiGbl_FACS = NULL;
return (AE_OK);
}
else if (AcpiGbl_FADT.XFacs &&
(!AcpiGbl_FADT.Facs || !AcpiGbl_Use32BitFacsAddresses))
{
(void) AcpiGetTableByIndex (AcpiGbl_XFacsIndex,
ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Facs));
AcpiGbl_FACS = Facs;
}
else if (AcpiGbl_FADT.Facs)
{
(void) AcpiGetTableByIndex (AcpiGbl_FacsIndex,
ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Facs));
AcpiGbl_FACS = Facs;
}
/* If there is no FACS, just continue. There was already an error msg */
return (AE_OK);
}
示例3: AcpiExResolveToValue
ACPI_STATUS
AcpiExResolveToValue (
ACPI_OPERAND_OBJECT **StackPtr,
ACPI_WALK_STATE *WalkState)
{
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE_PTR (ExResolveToValue, StackPtr);
if (!StackPtr || !*StackPtr)
{
ACPI_ERROR ((AE_INFO, "Internal - null pointer"));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
/*
* The entity pointed to by the StackPtr can be either
* 1) A valid ACPI_OPERAND_OBJECT, or
* 2) A ACPI_NAMESPACE_NODE (NamedObj)
*/
if (ACPI_GET_DESCRIPTOR_TYPE (*StackPtr) == ACPI_DESC_TYPE_OPERAND)
{
Status = AcpiExResolveObjectToValue (StackPtr, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
if (!*StackPtr)
{
ACPI_ERROR ((AE_INFO, "Internal - null pointer"));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
}
/*
* Object on the stack may have changed if AcpiExResolveObjectToValue()
* was called (i.e., we can't use an _else_ here.)
*/
if (ACPI_GET_DESCRIPTOR_TYPE (*StackPtr) == ACPI_DESC_TYPE_NAMED)
{
Status = AcpiExResolveNodeToValue (
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, StackPtr),
WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
}
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Resolved object %p\n", *StackPtr));
return_ACPI_STATUS (AE_OK);
}
示例4: AcpiTbInitializeFacs
ACPI_STATUS
AcpiTbInitializeFacs (
void)
{
ACPI_STATUS Status;
Status = AcpiGetTableByIndex (ACPI_TABLE_INDEX_FACS,
ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_FACS));
return (Status);
}
示例5: AcpiTbInitializeFacs
ACPI_STATUS
AcpiTbInitializeFacs (
void)
{
ACPI_STATUS Status;
/* If Hardware Reduced flag is set, there is no FACS */
if (AcpiGbl_ReducedHardware)
{
AcpiGbl_FACS = NULL;
return (AE_OK);
}
Status = AcpiGetTableByIndex (ACPI_TABLE_INDEX_FACS,
ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_FACS));
return (Status);
}
示例6: AcpiDsBuildInternalObject
static ACPI_STATUS
AcpiDsBuildInternalObject (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
ACPI_OPERAND_OBJECT **ObjDescPtr)
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (DsBuildInternalObject);
*ObjDescPtr = NULL;
if (Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
{
/*
* This is a named object reference. If this name was
* previously looked up in the namespace, it was stored in this op.
* Otherwise, go ahead and look it up now
*/
if (!Op->Common.Node)
{
Status = AcpiNsLookup (WalkState->ScopeInfo,
Op->Common.Value.String,
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &(Op->Common.Node)));
if (ACPI_FAILURE (Status))
{
/* Check if we are resolving a named reference within a package */
if ((Status == AE_NOT_FOUND) && (AcpiGbl_EnableInterpreterSlack) &&
((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP)))
{
/*
* We didn't find the target and we are populating elements
* of a package - ignore if slack enabled. Some ASL code
* contains dangling invalid references in packages and
* expects that no exception will be issued. Leave the
* element as a null element. It cannot be used, but it
* can be overwritten by subsequent ASL code - this is
* typically the case.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Ignoring unresolved reference in package [%4.4s]\n",
WalkState->ScopeInfo->Scope.Node->Name.Ascii));
return_ACPI_STATUS (AE_OK);
}
else
{
ACPI_ERROR_NAMESPACE (Op->Common.Value.String, Status);
}
return_ACPI_STATUS (Status);
}
}
}
/* Create and init a new internal ACPI object */
ObjDesc = AcpiUtCreateInternalObject (
(AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode))->ObjectType);
if (!ObjDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Status = AcpiDsInitObjectFromOp (WalkState, Op, Op->Common.AmlOpcode,
&ObjDesc);
if (ACPI_FAILURE (Status))
{
AcpiUtRemoveReference (ObjDesc);
return_ACPI_STATUS (Status);
}
*ObjDescPtr = ObjDesc;
return_ACPI_STATUS (AE_OK);
}
示例7: AcpiDsInitObjectFromOp
//.........這裏部分代碼省略.........
ACPI_ERROR ((AE_INFO, "Unknown Integer type 0x%X",
OpInfo->Type));
Status = AE_AML_OPERAND_TYPE;
break;
}
break;
case ACPI_TYPE_STRING:
ObjDesc->String.Pointer = Op->Common.Value.String;
ObjDesc->String.Length = (UINT32) ACPI_STRLEN (Op->Common.Value.String);
/*
* The string is contained in the ACPI table, don't ever try
* to delete it
*/
ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER;
break;
case ACPI_TYPE_METHOD:
break;
case ACPI_TYPE_LOCAL_REFERENCE:
switch (OpInfo->Type)
{
case AML_TYPE_LOCAL_VARIABLE:
/* Local ID (0-7) is (AML opcode - base AML_LOCAL_OP) */
ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_LOCAL_OP;
ObjDesc->Reference.Class = ACPI_REFCLASS_LOCAL;
#ifndef ACPI_NO_METHOD_EXECUTION
Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_LOCAL,
ObjDesc->Reference.Value, WalkState,
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
&ObjDesc->Reference.Object));
#endif
break;
case AML_TYPE_METHOD_ARGUMENT:
/* Arg ID (0-6) is (AML opcode - base AML_ARG_OP) */
ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_ARG_OP;
ObjDesc->Reference.Class = ACPI_REFCLASS_ARG;
#ifndef ACPI_NO_METHOD_EXECUTION
Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_ARG,
ObjDesc->Reference.Value, WalkState,
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
&ObjDesc->Reference.Object));
#endif
break;
default: /* Object name or Debug object */
switch (Op->Common.AmlOpcode)
{
case AML_INT_NAMEPATH_OP:
/* Node was saved in Op */
ObjDesc->Reference.Node = Op->Common.Node;
ObjDesc->Reference.Object = Op->Common.Node->Object;
ObjDesc->Reference.Class = ACPI_REFCLASS_NAME;
break;
case AML_DEBUG_OP:
ObjDesc->Reference.Class = ACPI_REFCLASS_DEBUG;
break;
default:
ACPI_ERROR ((AE_INFO,
"Unimplemented reference type for AML opcode: 0x%4.4X", Opcode));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
break;
}
break;
default:
ACPI_ERROR ((AE_INFO, "Unimplemented data type: 0x%X",
ObjDesc->Common.Type));
Status = AE_AML_OPERAND_TYPE;
break;
}
return_ACPI_STATUS (Status);
}
示例8: AcpiDsBuildInternalObject
static ACPI_STATUS
AcpiDsBuildInternalObject (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
ACPI_OPERAND_OBJECT **ObjDescPtr)
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_STATUS Status;
ACPI_OBJECT_TYPE Type;
ACPI_FUNCTION_TRACE (DsBuildInternalObject);
*ObjDescPtr = NULL;
if (Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
{
/*
* This is a named object reference. If this name was
* previously looked up in the namespace, it was stored in this op.
* Otherwise, go ahead and look it up now
*/
if (!Op->Common.Node)
{
Status = AcpiNsLookup (WalkState->ScopeInfo,
Op->Common.Value.String,
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &(Op->Common.Node)));
if (ACPI_FAILURE (Status))
{
/* Check if we are resolving a named reference within a package */
if ((Status == AE_NOT_FOUND) && (AcpiGbl_EnableInterpreterSlack) &&
((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP)))
{
/*
* We didn't find the target and we are populating elements
* of a package - ignore if slack enabled. Some ASL code
* contains dangling invalid references in packages and
* expects that no exception will be issued. Leave the
* element as a null element. It cannot be used, but it
* can be overwritten by subsequent ASL code - this is
* typically the case.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Ignoring unresolved reference in package [%4.4s]\n",
WalkState->ScopeInfo->Scope.Node->Name.Ascii));
return_ACPI_STATUS (AE_OK);
}
else
{
ACPI_ERROR_NAMESPACE (Op->Common.Value.String, Status);
}
return_ACPI_STATUS (Status);
}
}
/* Special object resolution for elements of a package */
if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
{
/*
* Attempt to resolve the node to a value before we insert it into
* the package. If this is a reference to a common data type,
* resolve it immediately. According to the ACPI spec, package
* elements can only be "data objects" or method references.
* Attempt to resolve to an Integer, Buffer, String or Package.
* If cannot, return the named reference (for things like Devices,
* Methods, etc.) Buffer Fields and Fields will resolve to simple
* objects (int/buf/str/pkg).
*
* NOTE: References to things like Devices, Methods, Mutexes, etc.
* will remain as named references. This behavior is not described
* in the ACPI spec, but it appears to be an oversight.
*/
ObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Op->Common.Node);
Status = AcpiExResolveNodeToValue (
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc),
WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/*
* Special handling for Alias objects. We need to setup the type
* and the Op->Common.Node to point to the Alias target. Note,
* Alias has at most one level of indirection internally.
*/
Type = Op->Common.Node->Type;
if (Type == ACPI_TYPE_LOCAL_ALIAS)
{
Type = ObjDesc->Common.Type;
//.........這裏部分代碼省略.........
示例9: AcpiDsCreateOperand
ACPI_STATUS
AcpiDsCreateOperand (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Arg,
UINT32 ArgIndex)
{
ACPI_STATUS Status = AE_OK;
char *NameString;
UINT32 NameLength;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_PARSE_OBJECT *ParentOp;
UINT16 Opcode;
ACPI_INTERPRETER_MODE InterpreterMode;
const ACPI_OPCODE_INFO *OpInfo;
ACPI_FUNCTION_TRACE_PTR (DsCreateOperand, Arg);
/* A valid name must be looked up in the namespace */
if ((Arg->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
(Arg->Common.Value.String) &&
!(Arg->Common.Flags & ACPI_PARSEOP_IN_STACK))
{
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Getting a name: Arg=%p\n", Arg));
/* Get the entire name string from the AML stream */
Status = AcpiExGetNameString (ACPI_TYPE_ANY, Arg->Common.Value.Buffer,
&NameString, &NameLength);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* All prefixes have been handled, and the name is in NameString */
/*
* Special handling for BufferField declarations. This is a deferred
* opcode that unfortunately defines the field name as the last
* parameter instead of the first. We get here when we are performing
* the deferred execution, so the actual name of the field is already
* in the namespace. We don't want to attempt to look it up again
* because we may be executing in a different scope than where the
* actual opcode exists.
*/
if ((WalkState->DeferredNode) &&
(WalkState->DeferredNode->Type == ACPI_TYPE_BUFFER_FIELD) &&
(ArgIndex == (UINT32) ((WalkState->Opcode == AML_CREATE_FIELD_OP) ? 3 : 2)))
{
ObjDesc = ACPI_CAST_PTR (
ACPI_OPERAND_OBJECT, WalkState->DeferredNode);
Status = AE_OK;
}
else /* All other opcodes */
{
/*
* Differentiate between a namespace "create" operation
* versus a "lookup" operation (IMODE_LOAD_PASS2 vs.
* IMODE_EXECUTE) in order to support the creation of
* namespace objects during the execution of control methods.
*/
ParentOp = Arg->Common.Parent;
OpInfo = AcpiPsGetOpcodeInfo (ParentOp->Common.AmlOpcode);
if ((OpInfo->Flags & AML_NSNODE) &&
(ParentOp->Common.AmlOpcode != AML_INT_METHODCALL_OP) &&
(ParentOp->Common.AmlOpcode != AML_REGION_OP) &&
(ParentOp->Common.AmlOpcode != AML_INT_NAMEPATH_OP))
{
/* Enter name into namespace if not found */
InterpreterMode = ACPI_IMODE_LOAD_PASS2;
}
else
{
/* Return a failure if name not found */
InterpreterMode = ACPI_IMODE_EXECUTE;
}
Status = AcpiNsLookup (WalkState->ScopeInfo, NameString,
ACPI_TYPE_ANY, InterpreterMode,
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
WalkState,
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc));
/*
* The only case where we pass through (ignore) a NOT_FOUND
* error is for the CondRefOf opcode.
*/
if (Status == AE_NOT_FOUND)
{
if (ParentOp->Common.AmlOpcode == AML_COND_REF_OF_OP)
{
/*
* For the Conditional Reference op, it's OK if
* the name is not found; We just need a way to
* indicate this to the interpreter, set the
* object to the root
//.........這裏部分代碼省略.........
示例10: AcpiExOpcode_1A_0T_1R
//.........這裏部分代碼省略.........
default:
/* Must be an Index op - handled below */
break;
}
break;
case ACPI_TYPE_STRING:
break;
default:
Status = AE_AML_OPERAND_TYPE;
goto Cleanup;
}
}
if (ACPI_GET_DESCRIPTOR_TYPE (Operand[0]) != ACPI_DESC_TYPE_NAMED)
{
if ((Operand[0])->Common.Type == ACPI_TYPE_STRING)
{
/*
* This is a DerefOf (String). The string is a reference
* to a named ACPI object.
*
* 1) Find the owning Node
* 2) Dereference the node to an actual object. Could be a
* Field, so we need to resolve the node to a value.
*/
Status = AcpiNsGetNodeUnlocked (WalkState->ScopeInfo->Scope.Node,
Operand[0]->String.Pointer,
ACPI_NS_SEARCH_PARENT,
ACPI_CAST_INDIRECT_PTR (
ACPI_NAMESPACE_NODE, &ReturnDesc));
if (ACPI_FAILURE (Status))
{
goto Cleanup;
}
Status = AcpiExResolveNodeToValue (
ACPI_CAST_INDIRECT_PTR (
ACPI_NAMESPACE_NODE, &ReturnDesc),
WalkState);
goto Cleanup;
}
}
/* Operand[0] may have changed from the code above */
if (ACPI_GET_DESCRIPTOR_TYPE (Operand[0]) == ACPI_DESC_TYPE_NAMED)
{
/*
* This is a DerefOf (ObjectReference)
* Get the actual object from the Node (This is the dereference).
* This case may only happen when a LocalX or ArgX is
* dereferenced above.
*/
ReturnDesc = AcpiNsGetAttachedObject (
(ACPI_NAMESPACE_NODE *) Operand[0]);
AcpiUtAddReference (ReturnDesc);
}
else
{
/*
* This must be a reference object produced by either the
示例11: AcpiDsBuildInternalObject
ACPI_STATUS
AcpiDsBuildInternalObject (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
ACPI_OPERAND_OBJECT **ObjDescPtr)
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (DsBuildInternalObject);
*ObjDescPtr = NULL;
if (Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
{
/*
* This is a named object reference. If this name was
* previously looked up in the namespace, it was stored in
* this op. Otherwise, go ahead and look it up now
*/
if (!Op->Common.Node)
{
/* Check if we are resolving a named reference within a package */
if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
{
/*
* We won't resolve package elements here, we will do this
* after all ACPI tables are loaded into the namespace. This
* behavior supports both forward references to named objects
* and external references to objects in other tables.
*/
goto CreateNewObject;
}
else
{
Status = AcpiNsLookup (WalkState->ScopeInfo,
Op->Common.Value.String,
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
ACPI_CAST_INDIRECT_PTR (
ACPI_NAMESPACE_NODE, &(Op->Common.Node)));
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
Op->Common.Value.String, Status);
return_ACPI_STATUS (Status);
}
}
}
}
CreateNewObject:
/* Create and init a new internal ACPI object */
ObjDesc = AcpiUtCreateInternalObject (
(AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode))->ObjectType);
if (!ObjDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Status = AcpiDsInitObjectFromOp (
WalkState, Op, Op->Common.AmlOpcode, &ObjDesc);
if (ACPI_FAILURE (Status))
{
AcpiUtRemoveReference (ObjDesc);
return_ACPI_STATUS (Status);
}
/*
* Handling for unresolved package reference elements.
* These are elements that are namepaths.
*/
if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
{
ObjDesc->Reference.Resolved = TRUE;
if ((Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
!ObjDesc->Reference.Node)
{
/*
* Name was unresolved above.
* Get the prefix node for later lookup
*/
ObjDesc->Reference.Node = WalkState->ScopeInfo->Scope.Node;
ObjDesc->Reference.Aml = Op->Common.Aml;
ObjDesc->Reference.Resolved = FALSE;
}
}
*ObjDescPtr = ObjDesc;
return_ACPI_STATUS (Status);
}
示例12: AcpiEvOrphanEcRegMethod
static void
AcpiEvOrphanEcRegMethod (
void)
{
ACPI_TABLE_ECDT *Table;
ACPI_STATUS Status;
ACPI_OBJECT_LIST Args;
ACPI_OBJECT Objects[2];
ACPI_NAMESPACE_NODE *EcDeviceNode;
ACPI_NAMESPACE_NODE *RegMethod;
ACPI_NAMESPACE_NODE *NextNode;
ACPI_FUNCTION_TRACE (EvOrphanEcRegMethod);
/* Get the ECDT (if present in system) */
Status = AcpiGetTable (ACPI_SIG_ECDT, 0,
ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Table));
if (ACPI_FAILURE (Status))
{
return_VOID;
}
/* We need a valid EC_ID string */
if (!(*Table->Id))
{
return_VOID;
}
/* Namespace is currently locked, must release */
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
/* Get a handle to the EC device referenced in the ECDT */
Status = AcpiGetHandle (NULL,
ACPI_CAST_PTR (char, Table->Id),
ACPI_CAST_PTR (ACPI_HANDLE, &EcDeviceNode));
if (ACPI_FAILURE (Status))
{
goto Exit;
}
/* Get a handle to a _REG method immediately under the EC device */
Status = AcpiGetHandle (EcDeviceNode,
METHOD_NAME__REG, ACPI_CAST_PTR (ACPI_HANDLE, &RegMethod));
if (ACPI_FAILURE (Status))
{
goto Exit;
}
/*
* Execute the _REG method only if there is no Operation Region in
* this scope with the Embedded Controller space ID. Otherwise, it
* will already have been executed. Note, this allows for Regions
* with other space IDs to be present; but the code below will then
* execute the _REG method with the EC space ID argument.
*/
NextNode = AcpiNsGetNextNode (EcDeviceNode, NULL);
while (NextNode)
{
if ((NextNode->Type == ACPI_TYPE_REGION) &&
(NextNode->Object) &&
(NextNode->Object->Region.SpaceId == ACPI_ADR_SPACE_EC))
{
goto Exit; /* Do not execute _REG */
}
NextNode = AcpiNsGetNextNode (EcDeviceNode, NextNode);
}
/* Evaluate the _REG(EC,Connect) method */
Args.Count = 2;
Args.Pointer = Objects;
Objects[0].Type = ACPI_TYPE_INTEGER;
Objects[0].Integer.Value = ACPI_ADR_SPACE_EC;
Objects[1].Type = ACPI_TYPE_INTEGER;
Objects[1].Integer.Value = ACPI_REG_CONNECT;
Status = AcpiEvaluateObject (RegMethod, NULL, &Args, NULL);
Exit:
/* We ignore all errors from above, don't care */
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
return_VOID;
}
示例13: acpi_rs_dump_descriptor
//.........這裏部分代碼省略.........
table->
pointer[*target &
0x03]));
break;
case ACPI_RSD_3BITFLAG:
acpi_rs_out_string(name, ACPI_CAST_PTR(char,
table->
pointer[*target &
0x07]));
break;
case ACPI_RSD_SHORTLIST:
/*
* Short byte list (single line output) for DMA and IRQ resources
* Note: The list length is obtained from the previous table entry
*/
if (previous_target) {
acpi_rs_out_title(name);
acpi_rs_dump_short_byte_list(*previous_target,
target);
}
break;
case ACPI_RSD_SHORTLISTX:
/*
* Short byte list (single line output) for GPIO vendor data
* Note: The list length is obtained from the previous table entry
*/
if (previous_target) {
acpi_rs_out_title(name);
acpi_rs_dump_short_byte_list(*previous_target,
*
(ACPI_CAST_INDIRECT_PTR
(u8, target)));
}
break;
case ACPI_RSD_LONGLIST:
/*
* Long byte list for Vendor resource data
* Note: The list length is obtained from the previous table entry
*/
if (previous_target) {
acpi_rs_dump_byte_list(ACPI_GET16
(previous_target),
target);
}
break;
case ACPI_RSD_DWORDLIST:
/*
* Dword list for Extended Interrupt resources
* Note: The list length is obtained from the previous table entry
*/
if (previous_target) {
acpi_rs_dump_dword_list(*previous_target,
ACPI_CAST_PTR(u32,
target));
}
break;
case ACPI_RSD_WORDLIST:
/*
* Word list for GPIO Pin Table
* Note: The list length is obtained from the previous table entry
*/
if (previous_target) {
acpi_rs_dump_word_list(*previous_target,
*(ACPI_CAST_INDIRECT_PTR
(u16, target)));
}
break;
case ACPI_RSD_ADDRESS:
/*
* Common flags for all Address resources
*/
acpi_rs_dump_address_common(ACPI_CAST_PTR
(union acpi_resource_data,
target));
break;
case ACPI_RSD_SOURCE:
/*
* Optional resource_source for Address resources
*/
acpi_rs_dump_resource_source(ACPI_CAST_PTR
(struct
acpi_resource_source,
target));
break;
default:
acpi_os_printf("**** Invalid table opcode [%X] ****\n",
table->opcode);
return;
}
示例14: AcpiRsConvertAmlToResources
ACPI_STATUS
AcpiRsConvertAmlToResources (
UINT8 *Aml,
UINT32 Length,
UINT32 Offset,
UINT8 ResourceIndex,
void **Context)
{
ACPI_RESOURCE **ResourcePtr = ACPI_CAST_INDIRECT_PTR (
ACPI_RESOURCE, Context);
ACPI_RESOURCE *Resource;
AML_RESOURCE *AmlResource;
ACPI_RSCONVERT_INFO *ConversionTable;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (RsConvertAmlToResources);
/*
* Check that the input buffer and all subsequent pointers into it
* are aligned on a native word boundary. Most important on IA64
*/
Resource = *ResourcePtr;
if (ACPI_IS_MISALIGNED (Resource))
{
ACPI_WARNING ((AE_INFO,
"Misaligned resource pointer %p", Resource));
}
/* Get the appropriate conversion info table */
AmlResource = ACPI_CAST_PTR (AML_RESOURCE, Aml);
if (AcpiUtGetResourceType (Aml) == ACPI_RESOURCE_NAME_SERIAL_BUS)
{
if (AmlResource->CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE)
{
ConversionTable = NULL;
}
else
{
/* This is an I2C, SPI, or UART SerialBus descriptor */
ConversionTable =
AcpiGbl_ConvertResourceSerialBusDispatch[
AmlResource->CommonSerialBus.Type];
}
}
else
{
ConversionTable =
AcpiGbl_GetResourceDispatch[ResourceIndex];
}
if (!ConversionTable)
{
ACPI_ERROR ((AE_INFO,
"Invalid/unsupported resource descriptor: Type 0x%2.2X",
ResourceIndex));
return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
}
/* Convert the AML byte stream resource to a local resource struct */
Status = AcpiRsConvertAmlToResource (
Resource, AmlResource, ConversionTable);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not convert AML resource (Type 0x%X)", *Aml));
return_ACPI_STATUS (Status);
}
ACPI_DEBUG_PRINT ((ACPI_DB_RESOURCES,
"Type %.2X, AmlLength %.2X InternalLength %.2X\n",
AcpiUtGetResourceType (Aml), Length,
Resource->Length));
/* Point to the next structure in the output buffer */
*ResourcePtr = ACPI_NEXT_RESOURCE (Resource);
return_ACPI_STATUS (AE_OK);
}
示例15: AcpiRsDumpDescriptor
static void
AcpiRsDumpDescriptor (
void *Resource,
ACPI_RSDUMP_INFO *Table)
{
UINT8 *Target = NULL;
UINT8 *PreviousTarget;
const char *Name;
UINT8 Count;
/* First table entry must contain the table length (# of table entries) */
Count = Table->Offset;
while (Count)
{
PreviousTarget = Target;
Target = ACPI_ADD_PTR (UINT8, Resource, Table->Offset);
Name = Table->Name;
switch (Table->Opcode)
{
case ACPI_RSD_TITLE:
/*
* Optional resource title
*/
if (Table->Name)
{
AcpiOsPrintf ("%s Resource\n", Name);
}
break;
/* Strings */
case ACPI_RSD_LITERAL:
AcpiRsOutString (Name, ACPI_CAST_PTR (char, Table->Pointer));
break;
case ACPI_RSD_STRING:
AcpiRsOutString (Name, ACPI_CAST_PTR (char, Target));
break;
/* Data items, 8/16/32/64 bit */
case ACPI_RSD_UINT8:
if (Table->Pointer)
{
AcpiRsOutString (Name, Table->Pointer [*Target]);
}
else
{
AcpiRsOutInteger8 (Name, ACPI_GET8 (Target));
}
break;
case ACPI_RSD_UINT16:
AcpiRsOutInteger16 (Name, ACPI_GET16 (Target));
break;
case ACPI_RSD_UINT32:
AcpiRsOutInteger32 (Name, ACPI_GET32 (Target));
break;
case ACPI_RSD_UINT64:
AcpiRsOutInteger64 (Name, ACPI_GET64 (Target));
break;
/* Flags: 1-bit and 2-bit flags supported */
case ACPI_RSD_1BITFLAG:
AcpiRsOutString (Name, Table->Pointer [*Target & 0x01]);
break;
case ACPI_RSD_2BITFLAG:
AcpiRsOutString (Name, Table->Pointer [*Target & 0x03]);
break;
case ACPI_RSD_3BITFLAG:
AcpiRsOutString (Name, Table->Pointer [*Target & 0x07]);
break;
case ACPI_RSD_SHORTLIST:
/*
* Short byte list (single line output) for DMA and IRQ resources
* Note: The list length is obtained from the previous table entry
*/
if (PreviousTarget)
{
AcpiRsOutTitle (Name);
AcpiRsDumpShortByteList (*PreviousTarget, Target);
//.........這裏部分代碼省略.........