这篇教程C++ ACPI_TO_POINTER函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ACPI_TO_POINTER函数的典型用法代码示例。如果您正苦于以下问题:C++ ACPI_TO_POINTER函数的具体用法?C++ ACPI_TO_POINTER怎么用?C++ ACPI_TO_POINTER使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ACPI_TO_POINTER函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AcpiDbGenerateGpevoidAcpiDbGenerateGpe ( char *GpeArg, char *BlockArg){ UINT32 BlockNumber = 0; UINT32 GpeNumber; ACPI_GPE_EVENT_INFO *GpeEventInfo; GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0); /* * If no block arg, or block arg == 0 or 1, use the FADT-defined * GPE blocks. */ if (BlockArg) { BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0); if (BlockNumber == 1) { BlockNumber = 0; } } GpeEventInfo = AcpiEvGetGpeEventInfo (ACPI_TO_POINTER (BlockNumber), GpeNumber); if (!GpeEventInfo) { AcpiOsPrintf ("Invalid GPE/n"); return; } (void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber);}
开发者ID:zenny,项目名称:DragonFlyBSD,代码行数:35,
示例2: acpi_db_generate_gpevoid acpi_db_generate_gpe(char *gpe_arg, char *block_arg){ u32 block_number = 0; u32 gpe_number; struct acpi_gpe_event_info *gpe_event_info; gpe_number = strtoul(gpe_arg, NULL, 0); /* * If no block arg, or block arg == 0 or 1, use the FADT-defined * GPE blocks. */ if (block_arg) { block_number = strtoul(block_arg, NULL, 0); if (block_number == 1) { block_number = 0; } } gpe_event_info = acpi_ev_get_gpe_event_info(ACPI_TO_POINTER(block_number), gpe_number); if (!gpe_event_info) { acpi_os_printf("Invalid GPE/n"); return; } (void)acpi_ev_gpe_dispatch(NULL, gpe_event_info, gpe_number);}
开发者ID:125radheyshyam,项目名称:linux-1,代码行数:29,
示例3: AcpiDbGetPointervoid *AcpiDbGetPointer ( void *Target){ void *ObjPtr;#if ACPI_MACHINE_WIDTH == 16#include <stdio.h> /* Have to handle 16-bit pointers of the form segment:offset */ if (!sscanf (Target, "%p", &ObjPtr)) { AcpiOsPrintf ("Invalid pointer: %s/n", Target); return (NULL); }#else /* Simple flat pointer */ ObjPtr = ACPI_TO_POINTER (ACPI_STRTOUL (Target, NULL, 16));#endif return (ObjPtr);}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:27,
示例4: AcpiOsMapMemoryvoid *AcpiOsMapMemory ( ACPI_PHYSICAL_ADDRESS Where, ACPI_SIZE Length){ return (ACPI_TO_POINTER ((ACPI_SIZE) Where));}
开发者ID:zenny,项目名称:DragonFlyBSD,代码行数:8,
示例5: strtoulstatic void *acpi_db_get_pointer(void *target){ void *obj_ptr; acpi_size address; address = strtoul(target, NULL, 16); obj_ptr = ACPI_TO_POINTER(address); return (obj_ptr);}
开发者ID:a2hojsjsjs,项目名称:linux,代码行数:9,
示例6: acpi_db_dump_buffervoid acpi_db_dump_buffer(u32 address){ acpi_os_printf("/nLocation %X:/n", address); acpi_dbg_level |= ACPI_LV_TABLES; acpi_ut_debug_dump_buffer(ACPI_TO_POINTER(address), 64, DB_BYTE_DISPLAY, ACPI_UINT32_MAX);}
开发者ID:a2hojsjsjs,项目名称:linux,代码行数:9,
示例7: AcpiDbDisplayObjectTypevoidAcpiDbDisplayObjectType ( char *ObjectArg){ ACPI_HANDLE Handle; ACPI_DEVICE_INFO *Info; ACPI_STATUS Status; UINT32 i; Handle = ACPI_TO_POINTER (strtoul (ObjectArg, NULL, 16)); Status = AcpiGetObjectInfo (Handle, &Info); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get object info, %s/n", AcpiFormatException (Status)); return; } AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X/n", ACPI_FORMAT_UINT64 (Info->Address), Info->CurrentStatus, Info->Flags); AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X/n", Info->HighestDstates[0], Info->HighestDstates[1], Info->HighestDstates[2], Info->HighestDstates[3]); AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X/n", Info->LowestDstates[0], Info->LowestDstates[1], Info->LowestDstates[2], Info->LowestDstates[3], Info->LowestDstates[4]); if (Info->Valid & ACPI_VALID_HID) { AcpiOsPrintf ("HID: %s/n", Info->HardwareId.String); } if (Info->Valid & ACPI_VALID_UID) { AcpiOsPrintf ("UID: %s/n", Info->UniqueId.String); } if (Info->Valid & ACPI_VALID_CID) { for (i = 0; i < Info->CompatibleIdList.Count; i++) { AcpiOsPrintf ("CID %u: %s/n", i, Info->CompatibleIdList.Ids[i].String); } } ACPI_FREE (Info);}
开发者ID:ikitayama,项目名称:acpica-tools,代码行数:54,
示例8: AcpiDbDumpBuffervoidAcpiDbDumpBuffer ( UINT32 Address){ AcpiOsPrintf ("/nLocation %X:/n", Address); AcpiDbgLevel |= ACPI_LV_TABLES; AcpiUtDebugDumpBuffer (ACPI_TO_POINTER (Address), 64, DB_BYTE_DISPLAY, ACPI_UINT32_MAX);}
开发者ID:cloudius-systems,项目名称:acpica,代码行数:11,
示例9: AcpiDbGetPointerstatic void *AcpiDbGetPointer ( void *Target){ void *ObjPtr; ACPI_SIZE Address; Address = strtoul (Target, NULL, 16); ObjPtr = ACPI_TO_POINTER (Address); return (ObjPtr);}
开发者ID:iHaD,项目名称:DragonFlyBSD,代码行数:12,
示例10: LsGenerateListingstatic voidLsGenerateListing ( UINT32 FileId){ UINT32 WalkMode = ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_DB_SEPARATELY; /* Start at the beginning of both the source and AML files */ FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0); FlSeekFile (ASL_FILE_AML_OUTPUT, 0); AslGbl_SourceLine = 0; AslGbl_CurrentHexColumn = 0; LsPushNode (AslGbl_Files[ASL_FILE_INPUT].Filename); if (FileId == ASL_FILE_C_OFFSET_OUTPUT) { AslGbl_CurrentAmlOffset = 0; /* Offset table file has a special header and footer */ LsDoOffsetTableHeader (FileId); TrWalkParseTree (AslGbl_CurrentDB, WalkMode, LsAmlOffsetWalk, NULL, (void *) ACPI_TO_POINTER (FileId)); LsDoOffsetTableFooter (FileId); return; } /* Process all parse nodes */ TrWalkParseTree (AslGbl_CurrentDB, WalkMode, LsAmlListingWalk, NULL, (void *) ACPI_TO_POINTER (FileId)); /* Final processing */ LsFinishSourceListing (FileId);}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:37,
示例11: AcpiDbConvertToNodeACPI_NAMESPACE_NODE *AcpiDbConvertToNode ( char *InString){ ACPI_NAMESPACE_NODE *Node; ACPI_SIZE Address; if ((*InString >= 0x30) && (*InString <= 0x39)) { /* Numeric argument, convert */ Address = strtoul (InString, NULL, 16); Node = ACPI_TO_POINTER (Address); if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE))) { AcpiOsPrintf ("Address %p is invalid", Node); return (NULL); } /* Make sure pointer is valid NS node */ if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED) { AcpiOsPrintf ("Address %p is not a valid namespace node [%s]/n", Node, AcpiUtGetDescriptorName (Node)); return (NULL); } } else { /* * Alpha argument: The parameter is a name string that must be * resolved to a Namespace object. */ Node = AcpiDbLocalNsLookup (InString); if (!Node) { AcpiOsPrintf ( "Could not find [%s] in namespace, defaulting to root node/n", InString); Node = AcpiGbl_RootNode; } } return (Node);}
开发者ID:iHaD,项目名称:DragonFlyBSD,代码行数:48,
示例12: acpi_db_find_referencesvoid acpi_db_find_references(char *object_arg){ union acpi_operand_object *obj_desc; acpi_size address; /* Convert string to object pointer */ address = strtoul(object_arg, NULL, 16); obj_desc = ACPI_TO_POINTER(address); /* Search all nodes in namespace */ (void)acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, acpi_db_walk_for_references, NULL, (void *)obj_desc, NULL);}
开发者ID:JamesChenFromChina,项目名称:linux,代码行数:16,
示例13: AcpiDbFindReferencesvoidAcpiDbFindReferences ( char *ObjectArg){ ACPI_OPERAND_OBJECT *ObjDesc; /* Convert string to object pointer */ ObjDesc = ACPI_TO_POINTER (ACPI_STRTOUL (ObjectArg, NULL, 16)); /* Search all nodes in namespace */ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, AcpiDbWalkForReferences, NULL, (void *) ObjDesc, NULL);}
开发者ID:Aresthu,项目名称:ucore_plus,代码行数:16,
示例14: acpi_db_display_object_typevoid acpi_db_display_object_type(char *object_arg){ acpi_handle handle; struct acpi_device_info *info; acpi_status status; u32 i; handle = ACPI_TO_POINTER(strtoul(object_arg, NULL, 16)); status = acpi_get_object_info(handle, &info); if (ACPI_FAILURE(status)) { acpi_os_printf("Could not get object info, %s/n", acpi_format_exception(status)); return; } acpi_os_printf("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X/n", ACPI_FORMAT_UINT64(info->address), info->current_status, info->flags); acpi_os_printf("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X/n", info->highest_dstates[0], info->highest_dstates[1], info->highest_dstates[2], info->highest_dstates[3]); acpi_os_printf("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X/n", info->lowest_dstates[0], info->lowest_dstates[1], info->lowest_dstates[2], info->lowest_dstates[3], info->lowest_dstates[4]); if (info->valid & ACPI_VALID_HID) { acpi_os_printf("HID: %s/n", info->hardware_id.string); } if (info->valid & ACPI_VALID_UID) { acpi_os_printf("UID: %s/n", info->unique_id.string); } if (info->valid & ACPI_VALID_CID) { for (i = 0; i < info->compatible_id_list.count; i++) { acpi_os_printf("CID %u: %s/n", i, info->compatible_id_list.ids[i].string); } } ACPI_FREE(info);}
开发者ID:a2hojsjsjs,项目名称:linux,代码行数:46,
示例15: AcpiPsPushScopeACPI_STATUSAcpiPsPushScope ( ACPI_PARSE_STATE *ParserState, ACPI_PARSE_OBJECT *Op, UINT32 RemainingArgs, UINT32 ArgCount){ ACPI_GENERIC_STATE *Scope; ACPI_FUNCTION_TRACE_PTR (PsPushScope, Op); Scope = AcpiUtCreateGenericState (); if (!Scope) { return_ACPI_STATUS (AE_NO_MEMORY); } Scope->Common.DescriptorType = ACPI_DESC_TYPE_STATE_PSCOPE; Scope->ParseScope.Op = Op; Scope->ParseScope.ArgList = RemainingArgs; Scope->ParseScope.ArgCount = ArgCount; Scope->ParseScope.PkgEnd = ParserState->PkgEnd; /* Push onto scope stack */ AcpiUtPushGenericState (&ParserState->Scope, Scope); if (ArgCount == ACPI_VAR_ARGS) { /* Multiple arguments */ Scope->ParseScope.ArgEnd = ParserState->PkgEnd; } else { /* Single argument */ Scope->ParseScope.ArgEnd = ACPI_TO_POINTER (ACPI_MAX_PTR); } return_ACPI_STATUS (AE_OK);}
开发者ID:hoangduit,项目名称:reactos,代码行数:44,
示例16: AcpiDbConvertToNodeACPI_NAMESPACE_NODE *AcpiDbConvertToNode ( char *InString){ ACPI_NAMESPACE_NODE *Node; if ((*InString >= 0x30) && (*InString <= 0x39)) { /* Numeric argument, convert */ Node = ACPI_TO_POINTER (ACPI_STRTOUL (InString, NULL, 16)); if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE))) { AcpiOsPrintf ("Address %p is invalid in this address space/n", Node); return (NULL); } /* Make sure pointer is valid NS node */ if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED) { AcpiOsPrintf ("Address %p is not a valid NS node [%s]/n", Node, AcpiUtGetDescriptorName (Node)); return (NULL); } } else { /* Alpha argument */ /* The parameter is a name string that must be resolved to a * Named obj */ Node = AcpiDbLocalNsLookup (InString); if (!Node) { Node = AcpiGbl_RootNode; } } return (Node);}
开发者ID:dmarion,项目名称:freebsd-armv6-sys,代码行数:43,
示例17: acpi_ps_push_scopeacpi_statusacpi_ps_push_scope ( struct acpi_parse_state *parser_state, union acpi_parse_object *op, u32 remaining_args, u32 arg_count){ union acpi_generic_state *scope; ACPI_FUNCTION_TRACE_PTR ("ps_push_scope", op); scope = acpi_ut_create_generic_state (); if (!scope) { return_ACPI_STATUS (AE_NO_MEMORY); } scope->common.data_type = ACPI_DESC_TYPE_STATE_PSCOPE; scope->parse_scope.op = op; scope->parse_scope.arg_list = remaining_args; scope->parse_scope.arg_count = arg_count; scope->parse_scope.pkg_end = parser_state->pkg_end; /* Push onto scope stack */ acpi_ut_push_generic_state (&parser_state->scope, scope); if (arg_count == ACPI_VAR_ARGS) { /* multiple arguments */ scope->parse_scope.arg_end = parser_state->pkg_end; } else { /* single argument */ scope->parse_scope.arg_end = ACPI_TO_POINTER (ACPI_MAX_PTR); } return_ACPI_STATUS (AE_OK);}
开发者ID:Antonio-Zhou,项目名称:Linux-2.6.11,代码行数:41,
示例18: strtoulstruct acpi_namespace_node *acpi_db_convert_to_node(char *in_string){ struct acpi_namespace_node *node; acpi_size address; if ((*in_string >= 0x30) && (*in_string <= 0x39)) { /* Numeric argument, convert */ address = strtoul(in_string, NULL, 16); node = ACPI_TO_POINTER(address); if (!acpi_os_readable(node, sizeof(struct acpi_namespace_node))) { acpi_os_printf("Address %p is invalid", node); return (NULL); } /* Make sure pointer is valid NS node */ if (ACPI_GET_DESCRIPTOR_TYPE(node) != ACPI_DESC_TYPE_NAMED) { acpi_os_printf ("Address %p is not a valid namespace node [%s]/n", node, acpi_ut_get_descriptor_name(node)); return (NULL); } } else { /* * Alpha argument: The parameter is a name string that must be * resolved to a Namespace object. */ node = acpi_db_local_ns_lookup(in_string); if (!node) { acpi_os_printf ("Could not find [%s] in namespace, defaulting to root node/n", in_string); node = acpi_gbl_root_node; } } return (node);}
开发者ID:125radheyshyam,项目名称:linux-1,代码行数:40,
示例19: LsGenerateListingstatic voidLsGenerateListing ( UINT32 FileId){ /* Start at the beginning of both the source and AML files */ FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0); FlSeekFile (ASL_FILE_AML_OUTPUT, 0); Gbl_SourceLine = 0; Gbl_CurrentHexColumn = 0; LsPushNode (Gbl_Files[ASL_FILE_INPUT].Filename); /* Process all parse nodes */ TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, LsAmlListingWalk, NULL, (void *) ACPI_TO_POINTER (FileId)); /* Final processing */ LsFinishSourceListing (FileId);}
开发者ID:oza,项目名称:FreeBSD-7.3-dyntick,代码行数:22,
示例20: AcpiDbGenerateGpevoidAcpiDbGenerateGpe ( char *GpeArg, char *BlockArg){ UINT32 BlockNumber; UINT32 GpeNumber; ACPI_GPE_EVENT_INFO *GpeEventInfo; GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0); BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0); GpeEventInfo = AcpiEvGetGpeEventInfo (ACPI_TO_POINTER (BlockNumber), GpeNumber); if (!GpeEventInfo) { AcpiOsPrintf ("Invalid GPE/n"); return; } (void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber);}
开发者ID:dmarion,项目名称:freebsd-armv6-sys,代码行数:24,
示例21: returnvoid *acpi_os_map_memory(acpi_physical_address where, acpi_size length){ return (ACPI_TO_POINTER((acpi_size)where));}
开发者ID:513855417,项目名称:linux,代码行数:5,
示例22: AeRegionHandlerACPI_STATUSAeRegionHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT64 *Value, void *HandlerContext, void *RegionContext){ ACPI_OPERAND_OBJECT *RegionObject = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, RegionContext); UINT8 *Buffer = ACPI_CAST_PTR (UINT8, Value); ACPI_PHYSICAL_ADDRESS BaseAddress; ACPI_SIZE Length; BOOLEAN BufferExists; AE_REGION *RegionElement; void *BufferValue; ACPI_STATUS Status; UINT32 ByteWidth; UINT32 i; UINT8 SpaceId; ACPI_FUNCTION_NAME (AeRegionHandler); /* * If the object is not a region, simply return */ if (RegionObject->Region.Type != ACPI_TYPE_REGION) { return AE_OK; } /* * Region support can be disabled with the -r option. * We use this to support dynamically loaded tables where we pass a valid * address to the AML. */ if (AcpiGbl_DbOpt_NoRegionSupport) { BufferValue = ACPI_TO_POINTER (Address); ByteWidth = (BitWidth / 8); if (BitWidth % 8) { ByteWidth += 1; } goto DoFunction; } /* * Find the region's address space and length before searching * the linked list. */ BaseAddress = RegionObject->Region.Address; Length = (ACPI_SIZE) RegionObject->Region.Length; SpaceId = RegionObject->Region.SpaceId; ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Operation Region request on %s at 0x%X/n", AcpiUtGetRegionName (RegionObject->Region.SpaceId), (UINT32) Address)); switch (SpaceId) { case ACPI_ADR_SPACE_SYSTEM_IO: /* * For I/O space, exercise the port validation */ switch (Function & ACPI_IO_MASK) { case ACPI_READ: Status = AcpiHwReadPort (Address, (UINT32 *) Value, BitWidth); break; case ACPI_WRITE: Status = AcpiHwWritePort (Address, (UINT32) *Value, BitWidth); break; default: Status = AE_BAD_PARAMETER; break; } if (ACPI_FAILURE (Status)) { return (Status); } /* Now go ahead and simulate the hardware */ break; case ACPI_ADR_SPACE_SMBUS: Length = 0; switch (Function & ACPI_IO_MASK) { case ACPI_READ: switch (Function >> 16)//.........这里部分代码省略.........
开发者ID:iversonjimmy,项目名称:acer_cloud_wifi_copy,代码行数:101,
示例23: AcpiPsParseLoopACPI_STATUSAcpiPsParseLoop ( ACPI_WALK_STATE *WalkState){ ACPI_STATUS Status = AE_OK; ACPI_PARSE_OBJECT *Op = NULL; /* current op */ ACPI_PARSE_STATE *ParserState; UINT8 *AmlOpStart = NULL; ACPI_FUNCTION_TRACE_PTR (PsParseLoop, WalkState); if (WalkState->DescendingCallback == NULL) { return_ACPI_STATUS (AE_BAD_PARAMETER); } ParserState = &WalkState->ParserState; WalkState->ArgTypes = 0;#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY)) if (WalkState->WalkType & ACPI_WALK_METHOD_RESTART) { /* We are restarting a preempted control method */ if (AcpiPsHasCompletedScope (ParserState)) { /* * We must check if a predicate to an IF or WHILE statement * was just completed */ if ((ParserState->Scope->ParseScope.Op) && ((ParserState->Scope->ParseScope.Op->Common.AmlOpcode == AML_IF_OP) || (ParserState->Scope->ParseScope.Op->Common.AmlOpcode == AML_WHILE_OP)) && (WalkState->ControlState) && (WalkState->ControlState->Common.State == ACPI_CONTROL_PREDICATE_EXECUTING)) { /* * A predicate was just completed, get the value of the * predicate and branch based on that value */ WalkState->Op = NULL; Status = AcpiDsGetPredicateValue (WalkState, ACPI_TO_POINTER (TRUE)); if (ACPI_FAILURE (Status) && ((Status & AE_CODE_MASK) != AE_CODE_CONTROL)) { if (Status == AE_AML_NO_RETURN_VALUE) { ACPI_EXCEPTION ((AE_INFO, Status, "Invoked method did not return a value")); } ACPI_EXCEPTION ((AE_INFO, Status, "GetPredicate Failed")); return_ACPI_STATUS (Status); } Status = AcpiPsNextParseState (WalkState, Op, Status); } AcpiPsPopScope (ParserState, &Op, &WalkState->ArgTypes, &WalkState->ArgCount); ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Popped scope, Op=%p/n", Op)); } else if (WalkState->PrevOp) { /* We were in the middle of an op */ Op = WalkState->PrevOp; WalkState->ArgTypes = WalkState->PrevArgTypes; } }#endif /* Iterative parsing loop, while there is more AML to process: */ while ((ParserState->Aml < ParserState->AmlEnd) || (Op)) { AmlOpStart = ParserState->Aml; if (!Op) { Status = AcpiPsCreateOp (WalkState, AmlOpStart, &Op); if (ACPI_FAILURE (Status)) { if (Status == AE_CTRL_PARSE_CONTINUE) { continue; } if (Status == AE_CTRL_PARSE_PENDING) { Status = AE_OK; } Status = AcpiPsCompleteOp (WalkState, &Op, Status); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status);//.........这里部分代码省略.........
开发者ID:Jyang772,项目名称:XEOS,代码行数:101,
示例24: AcpiPsParseLoopACPI_STATUSAcpiPsParseLoop ( ACPI_WALK_STATE *WalkState){ ACPI_STATUS Status = AE_OK; ACPI_PARSE_OBJECT *Op = NULL; /* current op */ ACPI_PARSE_STATE *ParserState; UINT8 *AmlOpStart = NULL; ACPI_FUNCTION_TRACE_PTR (PsParseLoop, WalkState); if (WalkState->DescendingCallback == NULL) { return_ACPI_STATUS (AE_BAD_PARAMETER); } ParserState = &WalkState->ParserState; WalkState->ArgTypes = 0;#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY)) if (WalkState->WalkType & ACPI_WALK_METHOD_RESTART) { /* We are restarting a preempted control method */ if (AcpiPsHasCompletedScope (ParserState)) { /* * We must check if a predicate to an IF or WHILE statement * was just completed */ if ((ParserState->Scope->ParseScope.Op) && ((ParserState->Scope->ParseScope.Op->Common.AmlOpcode == AML_IF_OP) || (ParserState->Scope->ParseScope.Op->Common.AmlOpcode == AML_WHILE_OP)) && (WalkState->ControlState) && (WalkState->ControlState->Common.State == ACPI_CONTROL_PREDICATE_EXECUTING)) { /* * A predicate was just completed, get the value of the * predicate and branch based on that value */ WalkState->Op = NULL; Status = AcpiDsGetPredicateValue (WalkState, ACPI_TO_POINTER (TRUE)); if (ACPI_FAILURE (Status) && ((Status & AE_CODE_MASK) != AE_CODE_CONTROL)) { if (Status == AE_AML_NO_RETURN_VALUE) { ACPI_EXCEPTION ((AE_INFO, Status, "Invoked method did not return a value")); } ACPI_EXCEPTION ((AE_INFO, Status, "GetPredicate Failed")); return_ACPI_STATUS (Status); } Status = AcpiPsNextParseState (WalkState, Op, Status); } AcpiPsPopScope (ParserState, &Op, &WalkState->ArgTypes, &WalkState->ArgCount); ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Popped scope, Op=%p/n", Op)); } else if (WalkState->PrevOp) { /* We were in the middle of an op */ Op = WalkState->PrevOp; WalkState->ArgTypes = WalkState->PrevArgTypes; } }#endif /* Iterative parsing loop, while there is more AML to process: */ while ((ParserState->Aml < ParserState->AmlEnd) || (Op)) { ASL_CV_CAPTURE_COMMENTS (WalkState); AmlOpStart = ParserState->Aml; if (!Op) { Status = AcpiPsCreateOp (WalkState, AmlOpStart, &Op); if (ACPI_FAILURE (Status)) { /* * ACPI_PARSE_MODULE_LEVEL means that we are loading a table by * executing it as a control method. However, if we encounter * an error while loading the table, we need to keep trying to * load the table rather than aborting the table load. Set the * status to AE_OK to proceed with the table load. */ if ((WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) && Status == AE_ALREADY_EXISTS) { Status = AE_OK; }//.........这里部分代码省略.........
开发者ID:jasonbking,项目名称:illumos-gate,代码行数:101,
示例25: acpi_ps_parse_loopacpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state){ acpi_status status = AE_OK; acpi_status status2; union acpi_parse_object *op = NULL; /* current op */ union acpi_parse_object *arg = NULL; union acpi_parse_object *pre_op = NULL; struct acpi_parse_state *parser_state; u8 *aml_op_start = NULL; ACPI_FUNCTION_TRACE_PTR("ps_parse_loop", walk_state); if (walk_state->descending_callback == NULL) { return_ACPI_STATUS(AE_BAD_PARAMETER); } parser_state = &walk_state->parser_state; walk_state->arg_types = 0;#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY)) if (walk_state->walk_type & ACPI_WALK_METHOD_RESTART) { /* We are restarting a preempted control method */ if (acpi_ps_has_completed_scope(parser_state)) { /* * We must check if a predicate to an IF or WHILE statement * was just completed */ if ((parser_state->scope->parse_scope.op) && ((parser_state->scope->parse_scope.op->common. aml_opcode == AML_IF_OP) || (parser_state->scope->parse_scope.op->common. aml_opcode == AML_WHILE_OP)) && (walk_state->control_state) && (walk_state->control_state->common.state == ACPI_CONTROL_PREDICATE_EXECUTING)) { /* * A predicate was just completed, get the value of the * predicate and branch based on that value */ walk_state->op = NULL; status = acpi_ds_get_predicate_value(walk_state, ACPI_TO_POINTER (TRUE)); if (ACPI_FAILURE(status) && ((status & AE_CODE_MASK) != AE_CODE_CONTROL)) { if (status == AE_AML_NO_RETURN_VALUE) { ACPI_EXCEPTION((AE_INFO, status, "Invoked method did not return a value")); } ACPI_EXCEPTION((AE_INFO, status, "get_predicate Failed")); return_ACPI_STATUS(status); } status = acpi_ps_next_parse_state(walk_state, op, status); } acpi_ps_pop_scope(parser_state, &op, &walk_state->arg_types, &walk_state->arg_count); ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "Popped scope, Op=%p/n", op)); } else if (walk_state->prev_op) { /* We were in the middle of an op */ op = walk_state->prev_op; walk_state->arg_types = walk_state->prev_arg_types; } }#endif /* Iterative parsing loop, while there is more AML to process: */ while ((parser_state->aml < parser_state->aml_end) || (op)) { aml_op_start = parser_state->aml; if (!op) { /* Get the next opcode from the AML stream */ walk_state->aml_offset = (u32) ACPI_PTR_DIFF(parser_state->aml, parser_state->aml_start); walk_state->opcode = acpi_ps_peek_opcode(parser_state); /* * First cut to determine what we have found: * 1) A valid AML opcode * 2) A name string * 3) An unknown/invalid opcode */ walk_state->op_info = acpi_ps_get_opcode_info(walk_state->opcode); switch (walk_state->op_info->class) { case AML_CLASS_ASCII://.........这里部分代码省略.........
开发者ID:devicenull,项目名称:supermicro_ipmi_firmware,代码行数:101,
注:本文中的ACPI_TO_POINTER函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ACPI_VPRINT函数代码示例 C++ ACPI_TO_INTEGER函数代码示例 |