这篇教程C++ ACPI_WARNING函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ACPI_WARNING函数的典型用法代码示例。如果您正苦于以下问题:C++ ACPI_WARNING函数的具体用法?C++ ACPI_WARNING怎么用?C++ ACPI_WARNING使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ACPI_WARNING函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: acpi_ut_repair_namevoid acpi_ut_repair_name(char *name){ u32 i; u8 found_bad_char = FALSE; u32 original_name; ACPI_FUNCTION_NAME(ut_repair_name); ACPI_MOVE_NAME(&original_name, name); /* Check each character in the name */ for (i = 0; i < ACPI_NAME_SIZE; i++) { if (acpi_ut_valid_acpi_char(name[i], i)) { continue; } /* * Replace a bad character with something printable, yet technically * still invalid. This prevents any collisions with existing "good" * names in the namespace. */ name[i] = '*'; found_bad_char = TRUE; } if (found_bad_char) { /* Report warning only if in strict mode or debug mode */ if (!acpi_gbl_enable_interpreter_slack) { ACPI_WARNING((AE_INFO, "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]", original_name, name)); } else { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]", original_name, name)); } }}
开发者ID:JcShang,项目名称:linux-80211n-csitool,代码行数:41,
示例2: acpi_ev_release_global_lockacpi_status acpi_ev_release_global_lock(void){ u8 pending = FALSE; acpi_status status = AE_OK; ACPI_FUNCTION_TRACE(ev_release_global_lock); if (!acpi_gbl_global_lock_thread_count) { ACPI_WARNING((AE_INFO, "Cannot release HW Global Lock, it has not been acquired")); return_ACPI_STATUS(AE_NOT_ACQUIRED); } /* One fewer thread has the global lock */ acpi_gbl_global_lock_thread_count--; if (acpi_gbl_global_lock_thread_count) { /* There are still some threads holding the lock, cannot release */ return_ACPI_STATUS(AE_OK); } /* * No more threads holding lock, we can do the actual hardware * release */ ACPI_RELEASE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, pending); acpi_gbl_global_lock_acquired = FALSE; /* * If the pending bit was set, we must write GBL_RLS to the control * register */ if (pending) { status = acpi_set_register(ACPI_BITREG_GLOBAL_LOCK_RELEASE, 1, ACPI_MTX_LOCK); } return_ACPI_STATUS(status);}
开发者ID:FatSunHYS,项目名称:OSCourseDesign,代码行数:41,
示例3: ACPI_FUNCTION_TRACE_PTRunion acpi_operand_object *acpi_ns_get_attached_object(struct acpi_namespace_node *node){ ACPI_FUNCTION_TRACE_PTR(ns_get_attached_object, node); if (!node) { ACPI_WARNING((AE_INFO, "Null Node ptr")); return_PTR(NULL); } if (!node->object || ((ACPI_GET_DESCRIPTOR_TYPE(node->object) != ACPI_DESC_TYPE_OPERAND) && (ACPI_GET_DESCRIPTOR_TYPE(node->object) != ACPI_DESC_TYPE_NAMED)) || ((node->object)->common.type == ACPI_TYPE_LOCAL_DATA)) { return_PTR(NULL); } return_PTR(node->object);}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:21,
示例4: AcpiTbCreateLocalFadtvoidAcpiTbCreateLocalFadt ( ACPI_TABLE_HEADER *Table, UINT32 Length){ /* * Check if the FADT is larger than the largest table that we expect * (the ACPI 2.0/3.0 version). If so, truncate the table, and issue * a warning. */ if (Length > sizeof (ACPI_TABLE_FADT)) { ACPI_WARNING ((AE_INFO, "FADT (revision %u) is longer than ACPI 2.0 version, " "truncating length %u to %u", Table->Revision, Length, (UINT32) sizeof (ACPI_TABLE_FADT))); } /* Clear the entire local FADT */ ACPI_MEMSET (&AcpiGbl_FADT, 0, sizeof (ACPI_TABLE_FADT)); /* Copy the original FADT, up to sizeof (ACPI_TABLE_FADT) */ ACPI_MEMCPY (&AcpiGbl_FADT, Table, ACPI_MIN (Length, sizeof (ACPI_TABLE_FADT))); /* Convert the local copy of the FADT to the common internal format */ AcpiTbConvertFadt (); /* Validate FADT values now, before we make any changes */ AcpiTbValidateFadt (); /* Initialize the global ACPI register structures */ AcpiTbSetupFadtRegisters ();}
开发者ID:mikess,项目名称:illumos-gate,代码行数:40,
示例5: AcpiTbGetTableACPI_STATUSAcpiTbGetTable ( ACPI_TABLE_DESC *TableDesc, ACPI_TABLE_HEADER **OutTable){ ACPI_STATUS Status; ACPI_FUNCTION_TRACE (AcpiTbGetTable); if (TableDesc->ValidationCount == 0) { /* Table need to be "VALIDATED" */ Status = AcpiTbValidateTable (TableDesc); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } if (TableDesc->ValidationCount < ACPI_MAX_TABLE_VALIDATIONS) { TableDesc->ValidationCount++; /* * Detect ValidationCount overflows to ensure that the warning * message will only be printed once. */ if (TableDesc->ValidationCount >= ACPI_MAX_TABLE_VALIDATIONS) { ACPI_WARNING((AE_INFO, "Table %p, Validation count overflows/n", TableDesc)); } } *OutTable = TableDesc->Pointer; return_ACPI_STATUS (AE_OK);}
开发者ID:9elements,项目名称:fwts,代码行数:40,
示例6: acpi_remove_fixed_event_handler/******************************************************************************* * * FUNCTION: acpi_remove_fixed_event_handler * * PARAMETERS: event - Event type to disable. * handler - Address of the handler * * RETURN: Status * * DESCRIPTION: Disables the event and unregisters the event handler. * ******************************************************************************/acpi_statusacpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler){ acpi_status status = AE_OK; ACPI_FUNCTION_TRACE(acpi_remove_fixed_event_handler); /* Parameter validation */ if (event > ACPI_EVENT_MAX) { return_ACPI_STATUS(AE_BAD_PARAMETER); } status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } /* Disable the event before removing the handler */ status = acpi_disable_event(event, 0); /* Always Remove the handler */ acpi_gbl_fixed_event_handlers[event].handler = NULL; acpi_gbl_fixed_event_handlers[event].context = NULL; if (ACPI_FAILURE(status)) { ACPI_WARNING((AE_INFO, "Could not disable fixed event - %s (%u)", acpi_ut_get_event_name(event), event)); } else { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event - %s (%X)/n", acpi_ut_get_event_name(event), event)); } (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); return_ACPI_STATUS(status);}
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:52,
示例7: acpi_ev_release_global_lockacpi_status acpi_ev_release_global_lock(void){ u8 pending = FALSE; acpi_status status = AE_OK; ACPI_FUNCTION_TRACE(ev_release_global_lock); if (!acpi_gbl_global_lock_acquired) { ACPI_WARNING((AE_INFO, "Cannot release the ACPI Global Lock, it has not been acquired")); return_ACPI_STATUS(AE_NOT_ACQUIRED); } if (acpi_gbl_global_lock_present) { ACPI_RELEASE_GLOBAL_LOCK(acpi_gbl_FACS, pending); if (pending) { status = acpi_write_bit_register (ACPI_BITREG_GLOBAL_LOCK_RELEASE, ACPI_ENABLE_EVENT); } ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Released hardware Global Lock/n")); } acpi_gbl_global_lock_acquired = FALSE; acpi_os_release_mutex(acpi_gbl_global_lock_mutex->mutex.os_mutex); return_ACPI_STATUS(status);}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:39,
示例8: acpi_tb_create_local_fadtvoid __init acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length){ /* * Check if the FADT is larger than the largest table that we expect * (the ACPI 5.0 version). If so, truncate the table, and issue * a warning. */ if (length > sizeof(struct acpi_table_fadt)) { ACPI_WARNING((AE_INFO, "FADT (revision %u) is longer than ACPI 5.0 version," " truncating length %u to %zu", table->revision, (unsigned)length, sizeof(struct acpi_table_fadt))); } /* Clear the entire local FADT */ ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt)); /* Copy the original FADT, up to sizeof (struct acpi_table_fadt) */ ACPI_MEMCPY(&acpi_gbl_FADT, table, ACPI_MIN(length, sizeof(struct acpi_table_fadt))); /* Take a copy of the Hardware Reduced flag */ acpi_gbl_reduced_hardware = FALSE; if (acpi_gbl_FADT.flags & ACPI_FADT_HW_REDUCED) { acpi_gbl_reduced_hardware = TRUE; } /* * 1) Convert the local copy of the FADT to the common internal format * 2) Validate some of the important values within the FADT */ acpi_tb_convert_fadt(); acpi_tb_validate_fadt();}
开发者ID:0day-ci,项目名称:xen,代码行数:39,
示例9: AcpiNsGetAttachedObjectACPI_OPERAND_OBJECT *AcpiNsGetAttachedObject ( ACPI_NAMESPACE_NODE *Node){ ACPI_FUNCTION_TRACE_PTR (NsGetAttachedObject, Node); if (!Node) { ACPI_WARNING ((AE_INFO, "Null Node ptr")); return_PTR (NULL); } if (!Node->Object || ((ACPI_GET_DESCRIPTOR_TYPE (Node->Object) != ACPI_DESC_TYPE_OPERAND) && (ACPI_GET_DESCRIPTOR_TYPE (Node->Object) != ACPI_DESC_TYPE_NAMED)) || ((Node->Object)->Common.Type == ACPI_TYPE_LOCAL_DATA)) { return_PTR (NULL); } return_PTR (Node->Object);}
开发者ID:ahs3,项目名称:acpica-tools,代码行数:23,
示例10: acpi_tb_create_local_fadtvoid acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length){ /* * Check if the FADT is larger than the largest table that we expect * (the ACPI 2.0/3.0 version). If so, truncate the table, and issue * a warning. */ if (length > sizeof(struct acpi_table_fadt)) { ACPI_WARNING((AE_INFO, "FADT (revision %u) is longer than ACPI 2.0 version, " "truncating length %u to %u", table->revision, length, (u32)sizeof(struct acpi_table_fadt))); } /* Clear the entire local FADT */ ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt)); /* Copy the original FADT, up to sizeof (struct acpi_table_fadt) */ ACPI_MEMCPY(&acpi_gbl_FADT, table, ACPI_MIN(length, sizeof(struct acpi_table_fadt))); /* Convert the local copy of the FADT to the common internal format */ acpi_tb_convert_fadt(); /* Validate FADT values now, before we make any changes */ acpi_tb_validate_fadt(); /* Initialize the global ACPI register structures */ acpi_tb_setup_fadt_registers();}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:36,
示例11: AcpiUtUpdateRefCountstatic voidAcpiUtUpdateRefCount ( ACPI_OPERAND_OBJECT *Object, UINT32 Action){ UINT16 OriginalCount; UINT16 NewCount = 0; ACPI_CPU_FLAGS LockFlags; ACPI_FUNCTION_NAME (UtUpdateRefCount); if (!Object) { return; } /* * Always get the reference count lock. Note: Interpreter and/or * Namespace is not always locked when this function is called. */ LockFlags = AcpiOsAcquireLock (AcpiGbl_ReferenceCountLock); OriginalCount = Object->Common.ReferenceCount; /* Perform the reference count action (increment, decrement) */ switch (Action) { case REF_INCREMENT: NewCount = OriginalCount + 1; Object->Common.ReferenceCount = NewCount; AcpiOsReleaseLock (AcpiGbl_ReferenceCountLock, LockFlags); /* The current reference count should never be zero here */ if (!OriginalCount) { ACPI_WARNING ((AE_INFO, "Obj %p, Reference Count was zero before increment/n", Object)); } ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Type %.2X Refs %.2X [Incremented]/n", Object, Object->Common.Type, NewCount)); break; case REF_DECREMENT: /* The current reference count must be non-zero */ if (OriginalCount) { NewCount = OriginalCount - 1; Object->Common.ReferenceCount = NewCount; } AcpiOsReleaseLock (AcpiGbl_ReferenceCountLock, LockFlags); if (!OriginalCount) { ACPI_WARNING ((AE_INFO, "Obj %p, Reference Count is already zero, cannot decrement/n", Object)); } ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Type %.2X Refs %.2X [Decremented]/n", Object, Object->Common.Type, NewCount)); /* Actually delete the object on a reference count of zero */ if (NewCount == 0) { AcpiUtDeleteInternalObj (Object); } break; default: AcpiOsReleaseLock (AcpiGbl_ReferenceCountLock, LockFlags); ACPI_ERROR ((AE_INFO, "Unknown Reference Count action (0x%X)", Action)); return; } /* * Sanity check the reference count, for debug purposes only. * (A deleted object will have a huge reference count) */ if (NewCount > ACPI_MAX_REFERENCE_COUNT) { ACPI_WARNING ((AE_INFO, "Large Reference Count (0x%X) in object %p, Type=0x%.2X", NewCount, Object, Object->Common.Type)); }}
开发者ID:99corps,项目名称:runtime,代码行数:99,
示例12: AcpiDsScopeStackPushACPI_STATUSAcpiDsScopeStackPush ( ACPI_NAMESPACE_NODE *Node, ACPI_OBJECT_TYPE Type, ACPI_WALK_STATE *WalkState){ ACPI_GENERIC_STATE *ScopeInfo; ACPI_GENERIC_STATE *OldScopeInfo; ACPI_FUNCTION_TRACE (DsScopeStackPush); if (!Node) { /* Invalid scope */ ACPI_ERROR ((AE_INFO, "Null scope parameter")); return_ACPI_STATUS (AE_BAD_PARAMETER); } /* Make sure object type is valid */ if (!AcpiUtValidObjectType (Type)) { ACPI_WARNING ((AE_INFO, "Invalid object type: 0x%X", Type)); } /* Allocate a new scope object */ ScopeInfo = AcpiUtCreateGenericState (); if (!ScopeInfo) { return_ACPI_STATUS (AE_NO_MEMORY); } /* Init new scope object */ ScopeInfo->Common.DescriptorType = ACPI_DESC_TYPE_STATE_WSCOPE; ScopeInfo->Scope.Node = Node; ScopeInfo->Common.Value = (UINT16) Type; WalkState->ScopeDepth++; ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%.2d] Pushed scope ", (UINT32) WalkState->ScopeDepth)); OldScopeInfo = WalkState->ScopeInfo; if (OldScopeInfo) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "[%4.4s] (%s)", AcpiUtGetNodeName (OldScopeInfo->Scope.Node), AcpiUtGetTypeName (OldScopeInfo->Common.Value))); } else { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, ACPI_NAMESPACE_ROOT)); } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, ", New scope -> [%4.4s] (%s)/n", AcpiUtGetNodeName (ScopeInfo->Scope.Node), AcpiUtGetTypeName (ScopeInfo->Common.Value))); /* Push new scope object onto stack */ AcpiUtPushGenericState (&WalkState->ScopeInfo, ScopeInfo); return_ACPI_STATUS (AE_OK);}
开发者ID:Moteesh,项目名称:reactos,代码行数:71,
示例13: AcpiExStoreObjectToObjectACPI_STATUSAcpiExStoreObjectToObject ( ACPI_OPERAND_OBJECT *SourceDesc, ACPI_OPERAND_OBJECT *DestDesc, ACPI_OPERAND_OBJECT **NewDesc, ACPI_WALK_STATE *WalkState){ ACPI_OPERAND_OBJECT *ActualSrcDesc; ACPI_STATUS Status = AE_OK; ACPI_FUNCTION_TRACE_PTR (ExStoreObjectToObject, SourceDesc); ActualSrcDesc = SourceDesc; if (!DestDesc) { /* * There is no destination object (An uninitialized node or * package element), so we can simply copy the source object * creating a new destination object */ Status = AcpiUtCopyIobjectToIobject (ActualSrcDesc, NewDesc, WalkState); return_ACPI_STATUS (Status); } if (SourceDesc->Common.Type != DestDesc->Common.Type) { /* * The source type does not match the type of the destination. * Perform the "implicit conversion" of the source to the current type * of the target as per the ACPI specification. * * If no conversion performed, ActualSrcDesc = SourceDesc. * Otherwise, ActualSrcDesc is a temporary object to hold the * converted object. */ Status = AcpiExConvertToTargetType (DestDesc->Common.Type, SourceDesc, &ActualSrcDesc, WalkState); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } if (SourceDesc == ActualSrcDesc) { /* * No conversion was performed. Return the SourceDesc as the * new object. */ *NewDesc = SourceDesc; return_ACPI_STATUS (AE_OK); } } /* * We now have two objects of identical types, and we can perform a * copy of the *value* of the source object. */ switch (DestDesc->Common.Type) { case ACPI_TYPE_INTEGER: DestDesc->Integer.Value = ActualSrcDesc->Integer.Value; /* Truncate value if we are executing from a 32-bit ACPI table */ AcpiExTruncateFor32bitTable (DestDesc); break; case ACPI_TYPE_STRING: Status = AcpiExStoreStringToString (ActualSrcDesc, DestDesc); break; case ACPI_TYPE_BUFFER: Status = AcpiExStoreBufferToBuffer (ActualSrcDesc, DestDesc); break; case ACPI_TYPE_PACKAGE: Status = AcpiUtCopyIobjectToIobject (ActualSrcDesc, &DestDesc, WalkState); break; default: /* * All other types come here. */ ACPI_WARNING ((AE_INFO, "Store into type %s not implemented", AcpiUtGetObjectTypeName (DestDesc))); Status = AE_NOT_IMPLEMENTED; break; } if (ActualSrcDesc != SourceDesc) { /* Delete the intermediate (temporary) source object *///.........这里部分代码省略.........
开发者ID:Aresthu,项目名称:ucore_plus,代码行数:101,
示例14: MtMethodAnalysisWalkBegin//.........这里部分代码省略......... if (Op->Asl.CompileFlags & NODE_IS_TARGET) { MethodInfo->ArgInitialized[RegisterNumber] = TRUE; } /* * Otherwise, this is a reference, check if the Arg * has been previously initialized. * * The only operator that accepts an uninitialized value is ObjectType() */ else if ((!MethodInfo->ArgInitialized[RegisterNumber]) && (Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_OBJECTTYPE)) { AslError (ASL_ERROR, ASL_MSG_ARG_INIT, Op, ArgName); } /* Flag this arg if it is not a "real" argument to the method */ if (RegisterNumber >= MethodInfo->NumArguments) { AslError (ASL_REMARK, ASL_MSG_NOT_PARAMETER, Op, ArgName); } break; case PARSEOP_RETURN: if (!MethodInfo) { /* * Probably was an error in the method declaration, * no additional error here */ ACPI_WARNING ((AE_INFO, "%p, No parent method", Op)); return (AE_ERROR); } /* * A child indicates a possible return value. A simple Return or * Return() is marked with NODE_IS_NULL_RETURN by the parser so * that it is not counted as a "real" return-with-value, although * the AML code that is actually emitted is Return(0). The AML * definition of Return has a required parameter, so we are * forced to convert a null return to Return(0). */ if ((Op->Asl.Child) && (Op->Asl.Child->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) && (!(Op->Asl.Child->Asl.CompileFlags & NODE_IS_NULL_RETURN))) { MethodInfo->NumReturnWithValue++; } else { MethodInfo->NumReturnNoValue++; } break; case PARSEOP_BREAK: case PARSEOP_CONTINUE: Next = Op->Asl.Parent; while (Next) { if (Next->Asl.ParseOpcode == PARSEOP_WHILE) { break;
开发者ID:yazshel,项目名称:netbsd-kernel,代码行数:67,
示例15: AcpiEvTerminatevoidAcpiEvTerminate ( void){ UINT32 i; ACPI_STATUS Status; ACPI_FUNCTION_TRACE (EvTerminate); if (AcpiGbl_EventsInitialized) { /* * Disable all event-related functionality. In all cases, on error, * print a message but obviously we don't abort. */ /* Disable all fixed events */ for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { Status = AcpiDisableEvent (i, 0); if (ACPI_FAILURE (Status)) { ACPI_ERROR ((AE_INFO, "Could not disable fixed event %u", (UINT32) i)); } } /* Disable all GPEs in all GPE blocks */ Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL); Status = AcpiEvRemoveGlobalLockHandler (); if (ACPI_FAILURE(Status)) { ACPI_ERROR ((AE_INFO, "Could not remove Global Lock handler")); } AcpiGbl_EventsInitialized = FALSE; } /* Remove SCI handlers */ Status = AcpiEvRemoveAllSciHandlers (); if (ACPI_FAILURE(Status)) { ACPI_ERROR ((AE_INFO, "Could not remove SCI handler")); } /* Deallocate all handler objects installed within GPE info structs */ Status = AcpiEvWalkGpeList (AcpiEvDeleteGpeHandlers, NULL); /* Return to original mode if necessary */ if (AcpiGbl_OriginalMode == ACPI_SYS_MODE_LEGACY) { Status = AcpiDisable (); if (ACPI_FAILURE (Status)) { ACPI_WARNING ((AE_INFO, "AcpiDisable failed")); } } return_VOID;}
开发者ID:JamesLinus,项目名称:ChaiOS,代码行数:69,
示例16: AcpiTbValidateFadtstatic voidAcpiTbValidateFadt ( void){ char *Name; ACPI_GENERIC_ADDRESS *Address64; UINT8 Length; UINT32 i; /* * Check for FACS and DSDT address mismatches. An address mismatch between * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables. */ if (AcpiGbl_FADT.Facs && (AcpiGbl_FADT.XFacs != (UINT64) AcpiGbl_FADT.Facs)) { ACPI_WARNING ((AE_INFO, "32/64X FACS address mismatch in FADT - " "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; } if (AcpiGbl_FADT.Dsdt && (AcpiGbl_FADT.XDsdt != (UINT64) AcpiGbl_FADT.Dsdt)) { ACPI_WARNING ((AE_INFO, "32/64X DSDT address mismatch in FADT - " "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; } /* Examine all of the 64-bit extended address fields (X fields) */ for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) { /* * Generate pointer to the 64-bit address, get the register * length (width) and the register name */ Address64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS, &AcpiGbl_FADT, FadtInfoTable[i].Address64); Length = *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT, FadtInfoTable[i].Length); Name = FadtInfoTable[i].Name; /* * For each extended field, check for length mismatch between the * legacy length field and the corresponding 64-bit X length field. */ if (Address64->Address && (Address64->BitWidth != ACPI_MUL_8 (Length))) { ACPI_WARNING ((AE_INFO, "32/64X length mismatch in %s: %u/%u", Name, ACPI_MUL_8 (Length), Address64->BitWidth)); } if (FadtInfoTable[i].Type & ACPI_FADT_REQUIRED) { /* * Field is required (PM1aEvent, PM1aControl, PmTimer). * Both the address and length must be non-zero. */ if (!Address64->Address || !Length) { ACPI_ERROR ((AE_INFO, "Required field %s has zero address and/or length:" " 0x%8.8X%8.8X/0x%X", Name, ACPI_FORMAT_UINT64 (Address64->Address), Length)); } } else if (FadtInfoTable[i].Type & ACPI_FADT_SEPARATE_LENGTH) { /* * Field is optional (PM2Control, GPE0, GPE1) AND has its own * length field. If present, both the address and length must * be valid. */ if ((Address64->Address && !Length) || (!Address64->Address && Length)) { ACPI_WARNING ((AE_INFO, "Optional field %s has zero address or length: " "0x%8.8X%8.8X/0x%X", Name, ACPI_FORMAT_UINT64 (Address64->Address), Length)); } } }}
开发者ID:mikess,项目名称:illumos-gate,代码行数:95,
示例17: AcpiDsInitObjectFromOp//.........这里部分代码省略......... ObjDesc->Integer.Value = ACPI_UINT64_MAX; /* Truncate value if we are executing from a 32-bit ACPI table */#ifndef ACPI_NO_METHOD_EXECUTION (void) AcpiExTruncateFor32bitTable (ObjDesc);#endif break; case AML_REVISION_OP: ObjDesc->Integer.Value = ACPI_CA_VERSION; break; default: ACPI_ERROR ((AE_INFO, "Unknown constant opcode 0x%X", Opcode)); Status = AE_AML_OPERAND_TYPE; break; } break; case AML_TYPE_LITERAL: ObjDesc->Integer.Value = Op->Common.Value.Integer;#ifndef ACPI_NO_METHOD_EXECUTION if (AcpiExTruncateFor32bitTable (ObjDesc)) { /* Warn if we found a 64-bit constant in a 32-bit table */ ACPI_WARNING ((AE_INFO, "Truncated 64-bit constant found in 32-bit table: %8.8X%8.8X => %8.8X", ACPI_FORMAT_UINT64 (Op->Common.Value.Integer), (UINT32) ObjDesc->Integer.Value)); }#endif break; default: 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;
开发者ID:ornarium,项目名称:freebsd,代码行数:67,
示例18: AcpiUtUpdateRefCountstatic voidAcpiUtUpdateRefCount ( ACPI_OPERAND_OBJECT *Object, UINT32 Action){ UINT16 Count; UINT16 NewCount; ACPI_FUNCTION_NAME (UtUpdateRefCount); if (!Object) { return; } Count = Object->Common.ReferenceCount; NewCount = Count; /* * Perform the reference count action (increment, decrement, force delete) */ switch (Action) { case REF_INCREMENT: NewCount++; Object->Common.ReferenceCount = NewCount; ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, [Incremented]/n", Object, NewCount)); break; case REF_DECREMENT: if (Count < 1) { ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, can't decrement! (Set to 0)/n", Object, NewCount)); NewCount = 0; } else { NewCount--; ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, [Decremented]/n", Object, NewCount)); } if (Object->Common.Type == ACPI_TYPE_METHOD) { ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Method Obj %p Refs=%X, [Decremented]/n", Object, NewCount)); } Object->Common.ReferenceCount = NewCount; if (NewCount == 0) { AcpiUtDeleteInternalObj (Object); } break; case REF_FORCE_DELETE: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, Force delete! (Set to 0)/n", Object, Count)); NewCount = 0; Object->Common.ReferenceCount = NewCount; AcpiUtDeleteInternalObj (Object); break; default: ACPI_ERROR ((AE_INFO, "Unknown action (0x%X)", Action)); break; } /* * Sanity check the reference count, for debug purposes only. * (A deleted object will have a huge reference count) */ if (Count > ACPI_MAX_REFERENCE_COUNT) { ACPI_WARNING ((AE_INFO, "Large Reference Count (0x%X) in object %p", Count, Object)); }}
开发者ID:KyulingLee,项目名称:L4Re,代码行数:93,
示例19: acpi_enable_subsystem/******************************************************************************* * * FUNCTION: acpi_enable_subsystem * * PARAMETERS: Flags - Init/enable Options * * RETURN: Status * * DESCRIPTION: Completes the subsystem initialization including hardware. * Puts system into ACPI mode if it isn't already. * ******************************************************************************/acpi_status acpi_enable_subsystem(u32 flags){ acpi_status status = AE_OK; ACPI_FUNCTION_TRACE(acpi_enable_subsystem); /* Enable ACPI mode */ if (!(flags & ACPI_NO_ACPI_ENABLE)) { ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[Init] Going into ACPI mode/n")); acpi_gbl_original_mode = acpi_hw_get_mode(); status = acpi_enable(); if (ACPI_FAILURE(status)) { ACPI_WARNING((AE_INFO, "AcpiEnable failed")); return_ACPI_STATUS(status); } } /* * Obtain a permanent mapping for the FACS. This is required for the * Global Lock and the Firmware Waking Vector */ status = acpi_tb_initialize_facs(); if (ACPI_FAILURE(status)) { ACPI_WARNING((AE_INFO, "Could not map the FACS table")); return_ACPI_STATUS(status); } /* * Install the default op_region handlers. These are installed unless * other handlers have already been installed via the * install_address_space_handler interface. */ if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) { ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[Init] Installing default address space handlers/n")); status = acpi_ev_install_region_handlers(); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } } /* * Initialize ACPI Event handling (Fixed and General Purpose) * * Note1: We must have the hardware and events initialized before we can * execute any control methods safely. Any control method can require * ACPI hardware support, so the hardware must be fully initialized before * any method execution! * * Note2: Fixed events are initialized and enabled here. GPEs are * initialized, but cannot be enabled until after the hardware is * completely initialized (SCI and global_lock activated) */ if (!(flags & ACPI_NO_EVENT_INIT)) { ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[Init] Initializing ACPI events/n")); status = acpi_ev_initialize_events(); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } } /* * Install the SCI handler and Global Lock handler. This completes the * hardware initialization. */ if (!(flags & ACPI_NO_HANDLER_INIT)) { ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[Init] Installing SCI/GL handlers/n")); status = acpi_ev_install_xrupt_handlers(); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } } return_ACPI_STATUS(status);}
开发者ID:Adjustxx,项目名称:Savaged-Zen,代码行数:96,
示例20: AcpiRsCreatePciRoutingTable//.........这里部分代码省略......... if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER) { ACPI_ERROR ((AE_INFO, "(PRT[%u].Address) Need Integer, found %s", Index, AcpiUtGetObjectTypeName (ObjDesc))); return_ACPI_STATUS (AE_BAD_DATA); } UserPrt->Address = ObjDesc->Integer.Value; /* 2) Second subobject: Dereference the PRT.Pin */ ObjDesc = SubObjectList[1]; if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER) { ACPI_ERROR ((AE_INFO, "(PRT[%u].Pin) Need Integer, found %s", Index, AcpiUtGetObjectTypeName (ObjDesc))); return_ACPI_STATUS (AE_BAD_DATA); } UserPrt->Pin = (UINT32) ObjDesc->Integer.Value; /* * If the BIOS has erroneously reversed the _PRT SourceName (index 2) * and the SourceIndex (index 3), fix it. _PRT is important enough to * workaround this BIOS error. This also provides compatibility with * other ACPI implementations. */ ObjDesc = SubObjectList[3]; if (!ObjDesc || (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)) { SubObjectList[3] = SubObjectList[2]; SubObjectList[2] = ObjDesc; ACPI_WARNING ((AE_INFO, "(PRT[%X].Source) SourceName and SourceIndex are reversed, fixed", Index)); } /* * 3) Third subobject: Dereference the PRT.SourceName * The name may be unresolved (slack mode), so allow a null object */ ObjDesc = SubObjectList[2]; if (ObjDesc) { switch (ObjDesc->Common.Type) { case ACPI_TYPE_LOCAL_REFERENCE: if (ObjDesc->Reference.Class != ACPI_REFCLASS_NAME) { ACPI_ERROR ((AE_INFO, "(PRT[%u].Source) Need name, found Reference Class 0x%X", Index, ObjDesc->Reference.Class)); return_ACPI_STATUS (AE_BAD_DATA); } Node = ObjDesc->Reference.Node; /* Use *remaining* length of the buffer as max for pathname */ PathBuffer.Length = OutputBuffer->Length - (UINT32) ((UINT8 *) UserPrt->Source - (UINT8 *) OutputBuffer->Pointer); PathBuffer.Pointer = UserPrt->Source;
开发者ID:libkeiser,项目名称:illumos-nexenta,代码行数:66,
示例21: AcpiEvInstallGpeHandlerstatic ACPI_STATUSAcpiEvInstallGpeHandler ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber, UINT32 Type, BOOLEAN IsRawHandler, ACPI_GPE_HANDLER Address, void *Context){ ACPI_GPE_EVENT_INFO *GpeEventInfo; ACPI_GPE_HANDLER_INFO *Handler; ACPI_STATUS Status; ACPI_CPU_FLAGS Flags; ACPI_FUNCTION_TRACE (EvInstallGpeHandler); /* Parameter validation */ if ((!Address) || (Type & ~ACPI_GPE_XRUPT_TYPE_MASK)) { return_ACPI_STATUS (AE_BAD_PARAMETER); } Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Allocate and init handler object (before lock) */ Handler = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_HANDLER_INFO)); if (!Handler) { Status = AE_NO_MEMORY; goto UnlockAndExit; } Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); /* Ensure that we have a valid GPE number */ GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber); if (!GpeEventInfo) { Status = AE_BAD_PARAMETER; goto FreeAndExit; } /* Make sure that there isn't a handler there already */ if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_HANDLER) || (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_RAW_HANDLER)) { Status = AE_ALREADY_EXISTS; goto FreeAndExit; } Handler->Address = Address; Handler->Context = Context; Handler->MethodNode = GpeEventInfo->Dispatch.MethodNode; Handler->OriginalFlags = (UINT8) (GpeEventInfo->Flags & (ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK)); /* * If the GPE is associated with a method, it may have been enabled * automatically during initialization, in which case it has to be * disabled now to avoid spurious execution of the handler. */ if (((ACPI_GPE_DISPATCH_TYPE (Handler->OriginalFlags) == ACPI_GPE_DISPATCH_METHOD) || (ACPI_GPE_DISPATCH_TYPE (Handler->OriginalFlags) == ACPI_GPE_DISPATCH_NOTIFY)) && GpeEventInfo->RuntimeCount) { Handler->OriginallyEnabled = TRUE; (void) AcpiEvRemoveGpeReference (GpeEventInfo); /* Sanity check of original type against new type */ if (Type != (UINT32) (GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK)) { ACPI_WARNING ((AE_INFO, "GPE type mismatch (level/edge)")); } } /* Install the handler */ GpeEventInfo->Dispatch.Handler = Handler; /* Setup up dispatch flags to indicate handler (vs. method/notify) */ GpeEventInfo->Flags &= ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); GpeEventInfo->Flags |= (UINT8) (Type | (IsRawHandler ? ACPI_GPE_DISPATCH_RAW_HANDLER : ACPI_GPE_DISPATCH_HANDLER));//.........这里部分代码省略.........
开发者ID:ikitayama,项目名称:acpica-tools,代码行数:101,
示例22: AcpiInstallFixedEventHandlerACPI_STATUSAcpiInstallFixedEventHandler ( UINT32 Event, ACPI_EVENT_HANDLER Handler, void *Context){ ACPI_STATUS Status; ACPI_FUNCTION_TRACE (AcpiInstallFixedEventHandler); /* Parameter validation */ if (Event > ACPI_EVENT_MAX) { return_ACPI_STATUS (AE_BAD_PARAMETER); } Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Do not allow multiple handlers */ if (AcpiGbl_FixedEventHandlers[Event].Handler) { Status = AE_ALREADY_EXISTS; goto Cleanup; } /* Install the handler before enabling the event */ AcpiGbl_FixedEventHandlers[Event].Handler = Handler; AcpiGbl_FixedEventHandlers[Event].Context = Context; Status = AcpiEnableEvent (Event, 0); if (ACPI_FAILURE (Status)) { ACPI_WARNING ((AE_INFO, "Could not enable fixed event - %s (%u)", AcpiUtGetEventName (Event), Event)); /* Remove the handler */ AcpiGbl_FixedEventHandlers[Event].Handler = NULL; AcpiGbl_FixedEventHandlers[Event].Context = NULL; } else { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Enabled fixed event %s (%X), Handler=%p/n", AcpiUtGetEventName (Event), Event, Handler)); }Cleanup: (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); return_ACPI_STATUS (Status);}
开发者ID:ikitayama,项目名称:acpica-tools,代码行数:62,
示例23: AcpiPsGetArguments//.........这里部分代码省略......... * and easiest to support since they open an AML * package. */ if (WalkState->PassNumber == ACPI_IMODE_LOAD_PASS1) { AcpiPsLinkModuleCode (Op->Common.Parent, AmlOpStart, (UINT32) (WalkState->ParserState.PkgEnd - AmlOpStart), WalkState->OwnerId); } ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Pass1: Skipping an If/Else/While body/n")); /* Skip body of if/else/while in pass 1 */ WalkState->ParserState.Aml = WalkState->ParserState.PkgEnd; WalkState->ArgCount = 0; break; default: /* * Check for an unsupported executable opcode at module * level. We must be in PASS1, the parent must be a SCOPE, * The opcode class must be EXECUTE, and the opcode must * not be an argument to another opcode. */ if ((WalkState->PassNumber == ACPI_IMODE_LOAD_PASS1) && (Op->Common.Parent->Common.AmlOpcode == AML_SCOPE_OP)) { OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); if ((OpInfo->Class == AML_CLASS_EXECUTE) && (!Arg)) { ACPI_WARNING ((AE_INFO, "Unsupported module-level executable opcode " "0x%.2X at table offset 0x%.4X", Op->Common.AmlOpcode, (UINT32) (ACPI_PTR_DIFF (AmlOpStart, WalkState->ParserState.AmlStart) + sizeof (ACPI_TABLE_HEADER)))); } } break; } } /* Special processing for certain opcodes */ switch (Op->Common.AmlOpcode) { case AML_METHOD_OP: /* * Skip parsing of control method because we don't have enough * info in the first pass to parse it correctly. * * Save the length and address of the body */ Op->Named.Data = WalkState->ParserState.Aml; Op->Named.Length = (UINT32) (WalkState->ParserState.PkgEnd - WalkState->ParserState.Aml); /* Skip body of method */ WalkState->ParserState.Aml = WalkState->ParserState.PkgEnd; WalkState->ArgCount = 0; break;
开发者ID:Jyang772,项目名称:XEOS,代码行数:67,
示例24: AcpiTbSetupFadtRegistersstatic voidAcpiTbSetupFadtRegisters ( void){ ACPI_GENERIC_ADDRESS *Target64; ACPI_GENERIC_ADDRESS *Source64; UINT8 Pm1RegisterByteWidth; UINT32 i; /* * Optionally check all register lengths against the default values and * update them if they are incorrect. */ if (AcpiGbl_UseDefaultRegisterWidths) { for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) { Target64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS, &AcpiGbl_FADT, FadtInfoTable[i].Address64); /* * If a valid register (Address != 0) and the (DefaultLength > 0) * (Not a GPE register), then check the width against the default. */ if ((Target64->Address) && (FadtInfoTable[i].DefaultLength > 0) && (FadtInfoTable[i].DefaultLength != Target64->BitWidth)) { ACPI_WARNING ((AE_INFO, "Invalid length for %s: %u, using default %u", FadtInfoTable[i].Name, Target64->BitWidth, FadtInfoTable[i].DefaultLength)); /* Incorrect size, set width to the default */ Target64->BitWidth = FadtInfoTable[i].DefaultLength; } } } /* * Get the length of the individual PM1 registers (enable and status). * Each register is defined to be (event block length / 2). Extra divide * by 8 converts bits to bytes. */ Pm1RegisterByteWidth = (UINT8) ACPI_DIV_16 (AcpiGbl_FADT.XPm1aEventBlock.BitWidth); /* * Calculate separate GAS structs for the PM1x (A/B) Status and Enable * registers. These addresses do not appear (directly) in the FADT, so it * is useful to pre-calculate them from the PM1 Event Block definitions. * * The PM event blocks are split into two register blocks, first is the * PM Status Register block, followed immediately by the PM Enable * Register block. Each is of length (Pm1EventLength/2) * * Note: The PM1A event block is required by the ACPI specification. * However, the PM1B event block is optional and is rarely, if ever, * used. */ for (i = 0; i < ACPI_FADT_PM_INFO_ENTRIES; i++) { Source64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS, &AcpiGbl_FADT, FadtPmInfoTable[i].Source); if (Source64->Address) { AcpiTbInitGenericAddress (FadtPmInfoTable[i].Target, Source64->SpaceId, Pm1RegisterByteWidth, Source64->Address + (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth)); } }}
开发者ID:mikess,项目名称:illumos-gate,代码行数:77,
示例25: AcpiEnableSubsystemACPI_STATUSAcpiEnableSubsystem ( UINT32 Flags){ ACPI_STATUS Status = AE_OK; ACPI_FUNCTION_TRACE (AcpiEnableSubsystem);#if (!ACPI_REDUCED_HARDWARE) /* Enable ACPI mode */ if (!(Flags & ACPI_NO_ACPI_ENABLE)) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Going into ACPI mode/n")); AcpiGbl_OriginalMode = AcpiHwGetMode(); Status = AcpiEnable (); if (ACPI_FAILURE (Status)) { ACPI_WARNING ((AE_INFO, "AcpiEnable failed")); return_ACPI_STATUS (Status); } } /* * Obtain a permanent mapping for the FACS. This is required for the * Global Lock and the Firmware Waking Vector */ Status = AcpiTbInitializeFacs (); if (ACPI_FAILURE (Status)) { ACPI_WARNING ((AE_INFO, "Could not map the FACS table")); return_ACPI_STATUS (Status); }#endif /* !ACPI_REDUCED_HARDWARE */ /* * Install the default OpRegion handlers. These are installed unless * other handlers have already been installed via the * InstallAddressSpaceHandler interface. */ if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT)) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Installing default address space handlers/n")); Status = AcpiEvInstallRegionHandlers (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } }#if (!ACPI_REDUCED_HARDWARE) /* * Initialize ACPI Event handling (Fixed and General Purpose) * * Note1: We must have the hardware and events initialized before we can * execute any control methods safely. Any control method can require * ACPI hardware support, so the hardware must be fully initialized before * any method execution! * * Note2: Fixed events are initialized and enabled here. GPEs are * initialized, but cannot be enabled until after the hardware is * completely initialized (SCI and GlobalLock activated) and the various * initialization control methods are run (_REG, _STA, _INI) on the * entire namespace. */ if (!(Flags & ACPI_NO_EVENT_INIT)) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI events/n")); Status = AcpiEvInitializeEvents (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } /* * Install the SCI handler and Global Lock handler. This completes the * hardware initialization. */ if (!(Flags & ACPI_NO_HANDLER_INIT)) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Installing SCI/GL handlers/n")); Status = AcpiEvInstallXruptHandlers (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } }//.........这里部分代码省略.........
开发者ID:SESA,项目名称:EbbRT-ACPICA,代码行数:101,
示例26: AcpiEvaluateObject//.........这里部分代码省略......... } } Info->Parameters[Info->ParamCount] = NULL; }#if 0 /* * Begin incoming argument count analysis. Check for too few args * and too many args. */ switch (AcpiNsGetType (Info->Node)) { case ACPI_TYPE_METHOD: /* Check incoming argument count against the method definition */ if (Info->ObjDesc->Method.ParamCount > Info->ParamCount) { ACPI_ERROR ((AE_INFO, "Insufficient arguments (%u) - %u are required", Info->ParamCount, Info->ObjDesc->Method.ParamCount)); Status = AE_MISSING_ARGUMENTS; goto Cleanup; } else if (Info->ObjDesc->Method.ParamCount < Info->ParamCount) { ACPI_WARNING ((AE_INFO, "Excess arguments (%u) - only %u are required", Info->ParamCount, Info->ObjDesc->Method.ParamCount)); /* Just pass the required number of arguments */ Info->ParamCount = Info->ObjDesc->Method.ParamCount; } /* * Any incoming external objects to be passed as arguments to the * method must be converted to internal objects */ if (Info->ParamCount) { /* * Allocate a new parameter block for the internal objects * Add 1 to count to allow for null terminated internal list */ Info->Parameters = ACPI_ALLOCATE_ZEROED ( ((ACPI_SIZE) Info->ParamCount + 1) * sizeof (void *)); if (!Info->Parameters) { Status = AE_NO_MEMORY; goto Cleanup; } /* Convert each external object in the list to an internal object */ for (i = 0; i < Info->ParamCount; i++) { Status = AcpiUtCopyEobjectToIobject (
开发者ID:AmirAbrams,项目名称:haiku,代码行数:67,
示例27: acpi_evaluate_object//.........这里部分代码省略......... pointer[i], &info-> parameters[i]); if (ACPI_FAILURE(status)) { goto cleanup; } } info->parameters[info->param_count] = NULL; }#ifdef _FUTURE_FEATURE /* * Begin incoming argument count analysis. Check for too few args * and too many args. */ switch (acpi_ns_get_type(info->node)) { case ACPI_TYPE_METHOD: /* Check incoming argument count against the method definition */ if (info->obj_desc->method.param_count > info->param_count) { ACPI_ERROR((AE_INFO, "Insufficient arguments (%u) - %u are required", info->param_count, info->obj_desc->method.param_count)); status = AE_MISSING_ARGUMENTS; goto cleanup; } else if (info->obj_desc->method.param_count < info->param_count) { ACPI_WARNING((AE_INFO, "Excess arguments (%u) - only %u are required", info->param_count, info->obj_desc->method.param_count)); /* Just pass the required number of arguments */ info->param_count = info->obj_desc->method.param_count; } /* * Any incoming external objects to be passed as arguments to the * method must be converted to internal objects */ if (info->param_count) { /* * Allocate a new parameter block for the internal objects * Add 1 to count to allow for null terminated internal list */ info->parameters = ACPI_ALLOCATE_ZEROED(((acpi_size) info-> param_count + 1) * sizeof(void *)); if (!info->parameters) { status = AE_NO_MEMORY; goto cleanup; } /* Convert each external object in the list to an internal object */ for (i = 0; i < info->param_count; i++) { status =
开发者ID:AshishNamdev,项目名称:linux,代码行数:67,
示例28: acpi_ns_dump_one_objectacpi_statusacpi_ns_dump_one_object(acpi_handle obj_handle, u32 level, void *context, void **return_value){ struct acpi_walk_info *info = (struct acpi_walk_info *)context; struct acpi_namespace_node *this_node; union acpi_operand_object *obj_desc = NULL; acpi_object_type obj_type; acpi_object_type type; u32 bytes_to_dump; u32 dbg_level; u32 i; ACPI_FUNCTION_NAME(ns_dump_one_object); /* Is output enabled? */ if (!(acpi_dbg_level & info->debug_level)) { return (AE_OK); } if (!obj_handle) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Null object handle/n")); return (AE_OK); } this_node = acpi_ns_map_handle_to_node(obj_handle); type = this_node->type; /* Check if the owner matches */ if ((info->owner_id != ACPI_OWNER_ID_MAX) && (info->owner_id != this_node->owner_id)) { return (AE_OK); } if (!(info->display_type & ACPI_DISPLAY_SHORT)) { /* Indent the object according to the level */ acpi_os_printf("%2d%*s", (u32) level - 1, (int)level * 2, " "); /* Check the node type and name */ if (type > ACPI_TYPE_LOCAL_MAX) { ACPI_WARNING((AE_INFO, "Invalid ACPI Object Type %08X", type)); } if (!acpi_ut_valid_acpi_name(this_node->name.integer)) { this_node->name.integer = acpi_ut_repair_name(this_node->name.ascii); ACPI_WARNING((AE_INFO, "Invalid ACPI Name %08X", this_node->name.integer)); } acpi_os_printf("%4.4s", acpi_ut_get_node_name(this_node)); } /* * Now we can print out the pertinent information */ acpi_os_printf(" %-12s %p %2.2X ", acpi_ut_get_type_name(type), this_node, this_node->owner_id); dbg_level = acpi_dbg_level; acpi_dbg_level = 0; obj_desc = acpi_ns_get_attached_object(this_node); acpi_dbg_level = dbg_level; /* Temp nodes are those nodes created by a control method */ if (this_node->flags & ANOBJ_TEMPORARY) { acpi_os_printf("(T) "); } switch (info->display_type & ACPI_DISPLAY_MASK) { case ACPI_DISPLAY_SUMMARY: if (!obj_desc) { /* No attached object, we are done */ acpi_os_printf("/n"); return (AE_OK); } switch (type) { case ACPI_TYPE_PROCESSOR: acpi_os_printf("ID %X Len %.4X Addr %p/n", obj_desc->processor.proc_id, obj_desc->processor.length, ACPI_CAST_PTR(void, obj_desc->processor. address)); break;//.........这里部分代码省略.........
开发者ID:PyroOS,项目名称:Pyro,代码行数:101,
注:本文中的ACPI_WARNING函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ACQUIRE_LOCK函数代码示例 C++ ACPI_VPRINT函数代码示例 |