这篇教程C++ ACPI_FUNCTION_TRACE_U32函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ACPI_FUNCTION_TRACE_U32函数的典型用法代码示例。如果您正苦于以下问题:C++ ACPI_FUNCTION_TRACE_U32函数的具体用法?C++ ACPI_FUNCTION_TRACE_U32怎么用?C++ ACPI_FUNCTION_TRACE_U32使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ACPI_FUNCTION_TRACE_U32函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AcpiUtAllocatevoid *AcpiUtAllocate ( ACPI_SIZE Size, UINT32 Component, const char *Module, UINT32 Line){ void *Allocation; ACPI_FUNCTION_TRACE_U32 (UtAllocate, Size); /* Check for an inadvertent size of zero bytes */ if (!Size) { ACPI_WARNING ((Module, Line, "Attempt to allocate zero bytes, allocating 1 byte")); Size = 1; } Allocation = AcpiOsAllocate (Size); if (!Allocation) { /* Report allocation error */ ACPI_WARNING ((Module, Line, "Could not allocate size %u", (UINT32) Size)); return_PTR (NULL); } return_PTR (Allocation);}
开发者ID:NoSuchProcess,项目名称:phantomuserland,代码行数:35,
示例2: ACPI_FUNCTION_TRACE_U32void *acpi_ut_allocate(acpi_size size, u32 component, const char *module, u32 line){ void *allocation; ACPI_FUNCTION_TRACE_U32(ut_allocate, size); /* Check for an inadvertent size of zero bytes */ if (!size) { ACPI_WARNING((module, line, "Attempt to allocate zero bytes, allocating 1 byte")); size = 1; } allocation = acpi_os_allocate(size); if (!allocation) { /* Report allocation error */ ACPI_WARNING((module, line, "Could not allocate size %u", (u32) size)); return_PTR(NULL); } return_PTR(allocation);}
开发者ID:08opt,项目名称:linux,代码行数:28,
示例3: ACPI_FUNCTION_TRACE_U32union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size){ union acpi_operand_object *string_desc; char *string; ACPI_FUNCTION_TRACE_U32(ut_create_string_object, string_size); /* Create a new String object */ string_desc = acpi_ut_create_internal_object(ACPI_TYPE_STRING); if (!string_desc) { return_PTR(NULL); } /* * Allocate the actual string buffer -- (Size + 1) for NULL terminator. * NOTE: Zero-length strings are NULL terminated */ string = ACPI_ALLOCATE_ZEROED(string_size + 1); if (!string) { ACPI_ERROR((AE_INFO, "Could not allocate size %X", (u32) string_size)); acpi_ut_remove_reference(string_desc); return_PTR(NULL); } /* Complete string object initialization */ string_desc->string.pointer = string; string_desc->string.length = (u32) string_size; /* Return the new string descriptor */ return_PTR(string_desc);}
开发者ID:420GrayFox,项目名称:dsl-n55u-bender,代码行数:35,
示例4: AcpiUtReleaseOwnerIdvoidAcpiUtReleaseOwnerId ( ACPI_OWNER_ID *OwnerIdPtr){ ACPI_OWNER_ID OwnerId = *OwnerIdPtr; ACPI_STATUS Status; UINT32 Index; UINT32 Bit; ACPI_FUNCTION_TRACE_U32 (UtReleaseOwnerId, OwnerId); /* Always clear the input OwnerId (zero is an invalid ID) */ *OwnerIdPtr = 0; /* Zero is not a valid OwnerID */ if (OwnerId == 0) { ACPI_ERROR ((AE_INFO, "Invalid OwnerId: 0x%2.2X", OwnerId)); return_VOID; } /* Mutex for the global ID mask */ Status = AcpiUtAcquireMutex (ACPI_MTX_CACHES); if (ACPI_FAILURE (Status)) { return_VOID; } /* Normalize the ID to zero */ OwnerId--; /* Decode ID to index/offset pair */ Index = ACPI_DIV_32 (OwnerId); Bit = 1 << ACPI_MOD_32 (OwnerId); /* Free the owner ID only if it is valid */ if (AcpiGbl_OwnerIdMask[Index] & Bit) { AcpiGbl_OwnerIdMask[Index] ^= Bit; } else { ACPI_ERROR ((AE_INFO, "Release of non-allocated OwnerId: 0x%2.2X", OwnerId + 1)); } (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); return_VOID;}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:57,
示例5: acpi_ut_delete_mutexstatic void acpi_ut_delete_mutex(acpi_mutex_handle mutex_id){ ACPI_FUNCTION_TRACE_U32(ut_delete_mutex, mutex_id); acpi_os_delete_mutex(acpi_gbl_mutex_info[mutex_id].mutex); acpi_gbl_mutex_info[mutex_id].mutex = NULL; acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED;}
开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:10,
示例6: AcpiUtDeleteMutexstatic voidAcpiUtDeleteMutex ( ACPI_MUTEX_HANDLE MutexId){ ACPI_FUNCTION_TRACE_U32 (UtDeleteMutex, MutexId); AcpiOsDeleteMutex (AcpiGbl_MutexInfo[MutexId].Mutex); AcpiGbl_MutexInfo[MutexId].Mutex = NULL; AcpiGbl_MutexInfo[MutexId].ThreadId = ACPI_MUTEX_NOT_ACQUIRED;}
开发者ID:apprisi,项目名称:illumos-gate,代码行数:13,
示例7: acpi_ut_release_owner_idvoid acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr){ acpi_owner_id owner_id = *owner_id_ptr; acpi_status status; u32 index; u32 bit; ACPI_FUNCTION_TRACE_U32(ut_release_owner_id, owner_id); /* Always clear the input owner_id (zero is an invalid ID) */ *owner_id_ptr = 0; /* Zero is not a valid owner_ID */ if (owner_id == 0) { ACPI_ERROR((AE_INFO, "Invalid OwnerId: 0x%2.2X", owner_id)); return_VOID; } /* Mutex for the global ID mask */ status = acpi_ut_acquire_mutex(ACPI_MTX_CACHES); if (ACPI_FAILURE(status)) { return_VOID; } /* Normalize the ID to zero */ owner_id--; /* Decode ID to index/offset pair */ index = ACPI_DIV_32(owner_id); bit = 1 << ACPI_MOD_32(owner_id); /* Free the owner ID only if it is valid */ if (acpi_gbl_owner_id_mask[index] & bit) { acpi_gbl_owner_id_mask[index] ^= bit; } else { ACPI_ERROR((AE_INFO, "Release of non-allocated OwnerId: 0x%2.2X", owner_id + 1)); } (void)acpi_ut_release_mutex(ACPI_MTX_CACHES); return_VOID;}
开发者ID:020gzh,项目名称:linux,代码行数:49,
示例8: acpi_ex_set_buffer_datumvoidacpi_ex_set_buffer_datum ( acpi_integer merged_datum, void *buffer, u32 buffer_length, u32 byte_granularity, u32 buffer_offset){ u32 index; ACPI_FUNCTION_TRACE_U32 ("ex_set_buffer_datum", byte_granularity); /* Get proper index into buffer (handles big/little endian) */ index = ACPI_BUFFER_INDEX (buffer_length, buffer_offset, byte_granularity); /* Move the requested number of bytes */ switch (byte_granularity) { case ACPI_FIELD_BYTE_GRANULARITY: ((u8 *) buffer) [index] = (u8) merged_datum; break; case ACPI_FIELD_WORD_GRANULARITY: ACPI_MOVE_64_TO_16 (&(((u16 *) buffer)[index]), &merged_datum); break; case ACPI_FIELD_DWORD_GRANULARITY: ACPI_MOVE_64_TO_32 (&(((u32 *) buffer)[index]), &merged_datum); break; case ACPI_FIELD_QWORD_GRANULARITY: ACPI_MOVE_64_TO_64 (&(((u64 *) buffer)[index]), &merged_datum); break; default: /* Should not get here */ break; } return_VOID;}
开发者ID:iPodLinux,项目名称:linux-2.4.24-ipod,代码行数:48,
示例9: acpi_ut_create_mutexstatic acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id){ acpi_status status = AE_OK; ACPI_FUNCTION_TRACE_U32(ut_create_mutex, mutex_id); if (!acpi_gbl_mutex_info[mutex_id].mutex) { status = acpi_os_create_mutex(&acpi_gbl_mutex_info[mutex_id].mutex); acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED; acpi_gbl_mutex_info[mutex_id].use_count = 0; } return_ACPI_STATUS(status);}
开发者ID:bionicOnion,项目名称:RPi-Linux-4.1.13,代码行数:16,
示例10: acpi_ut_delete_mutexstatic acpi_status acpi_ut_delete_mutex(acpi_mutex_handle mutex_id){ ACPI_FUNCTION_TRACE_U32(ut_delete_mutex, mutex_id); if (mutex_id > ACPI_MAX_MUTEX) { return_ACPI_STATUS(AE_BAD_PARAMETER); } acpi_os_delete_mutex(acpi_gbl_mutex_info[mutex_id].mutex); acpi_gbl_mutex_info[mutex_id].mutex = NULL; acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED; return_ACPI_STATUS(AE_OK);}
开发者ID:mrtos,项目名称:Logitech-Revue,代码行数:16,
示例11: acpi_lid_notify_handlerstatic void acpi_lid_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context){ struct acpi_lid_softc *sc = (struct acpi_lid_softc *)context; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, notify); switch (notify) { case ACPI_NOTIFY_STATUS_CHANGED: AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_lid_notify_status_changed, sc); break; default: break; /* unknown notification value */ } return_VOID;}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:16,
示例12: EcSpaceHandlerstatic ACPI_STATUSEcSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 width, ACPI_INTEGER *Value, void *Context, void *RegionContext){ struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; ACPI_STATUS Status = AE_OK; EC_REQUEST EcRequest; int i; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, (UINT32)Address); if ((Address > 0xFF) || (width % 8 != 0) || (Value == NULL) || (Context == NULL)) return_ACPI_STATUS(AE_BAD_PARAMETER); switch (Function) { case ACPI_READ: EcRequest.Command = EC_COMMAND_READ; EcRequest.Address = Address; (*Value) = 0; break; case ACPI_WRITE: EcRequest.Command = EC_COMMAND_WRITE; EcRequest.Address = Address; break; default: device_printf(sc->ec_dev, "invalid Address Space function %d/n", Function); return_ACPI_STATUS(AE_BAD_PARAMETER); } /* * Perform the transaction. */ for (i = 0; i < width; i += 8) { if (Function == ACPI_READ) EcRequest.Data = 0; else EcRequest.Data = (UINT8)((*Value) >> i); if (ACPI_FAILURE(Status = EcTransaction(sc, &EcRequest))) break; (*Value) |= (ACPI_INTEGER)EcRequest.Data << i; if (++EcRequest.Address == 0) return_ACPI_STATUS(AE_BAD_PARAMETER); } return_ACPI_STATUS(Status);}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:47,
示例13: AcpiUtCreateBufferObjectACPI_OPERAND_OBJECT *AcpiUtCreateBufferObject ( ACPI_SIZE BufferSize){ ACPI_OPERAND_OBJECT *BufferDesc; UINT8 *Buffer = NULL; ACPI_FUNCTION_TRACE_U32 (UtCreateBufferObject, BufferSize); /* Create a new Buffer object */ BufferDesc = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER); if (!BufferDesc) { return_PTR (NULL); } /* Create an actual buffer only if size > 0 */ if (BufferSize > 0) { /* Allocate the actual buffer */ Buffer = ACPI_ALLOCATE_ZEROED (BufferSize); if (!Buffer) { ACPI_ERROR ((AE_INFO, "Could not allocate size %u", (UINT32) BufferSize)); AcpiUtRemoveReference (BufferDesc); return_PTR (NULL); } } /* Complete buffer object initialization */ BufferDesc->Buffer.Flags |= AOPOBJ_DATA_VALID; BufferDesc->Buffer.Pointer = Buffer; BufferDesc->Buffer.Length = (UINT32) BufferSize; /* Return the new buffer descriptor */ return_PTR (BufferDesc);}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:46,
示例14: acpi_ut_delete_mutexstatic acpi_status acpi_ut_delete_mutex(acpi_mutex_handle mutex_id){ acpi_status status; ACPI_FUNCTION_TRACE_U32("ut_delete_mutex", mutex_id); if (mutex_id > MAX_MUTEX) { return_ACPI_STATUS(AE_BAD_PARAMETER); } status = acpi_os_delete_semaphore(acpi_gbl_mutex_info[mutex_id].mutex); acpi_gbl_mutex_info[mutex_id].mutex = NULL; acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED; return_ACPI_STATUS(status);}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:17,
示例15: AcpiUtCreateMutexstatic ACPI_STATUSAcpiUtCreateMutex ( ACPI_MUTEX_HANDLE MutexId){ ACPI_STATUS Status = AE_OK; ACPI_FUNCTION_TRACE_U32 (UtCreateMutex, MutexId); if (!AcpiGbl_MutexInfo[MutexId].Mutex) { Status = AcpiOsCreateMutex (&AcpiGbl_MutexInfo[MutexId].Mutex); AcpiGbl_MutexInfo[MutexId].ThreadId = ACPI_MUTEX_NOT_ACQUIRED; AcpiGbl_MutexInfo[MutexId].UseCount = 0; } return_ACPI_STATUS (Status);}
开发者ID:apprisi,项目名称:illumos-gate,代码行数:19,
示例16: acpi_fujitsu_notify_handlerstatic voidacpi_fujitsu_notify_handler(ACPI_HANDLE h, uint32_t notify, void *context){ struct acpi_fujitsu_softc *sc; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, notify); sc = (struct acpi_fujitsu_softc *)context; switch (notify) { case ACPI_NOTIFY_STATUS_CHANGED: AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_fujitsu_notify_status_changed, sc); break; default: /* unknown notification value */ break; }}
开发者ID:2asoft,项目名称:freebsd,代码行数:19,
示例17: acpi_button_notify_handlerstatic void acpi_button_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context){ struct acpi_button_softc *sc = (struct acpi_button_softc *)context; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, notify); switch (notify) { case ACPI_NOTIFY_BUTTON_PRESSED_FOR_SLEEP: AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_button_notify_pressed_for_sleep, sc); break; case ACPI_NOTIFY_BUTTON_PRESSED_FOR_WAKEUP: AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_button_notify_pressed_for_wakeup, sc); break; default: break; /* unknown notification value */ } return_VOID;}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:19,
示例18: AcpiUtCreateStringObjectACPI_OPERAND_OBJECT *AcpiUtCreateStringObject ( ACPI_SIZE StringSize){ ACPI_OPERAND_OBJECT *StringDesc; char *String; ACPI_FUNCTION_TRACE_U32 (UtCreateStringObject, StringSize); /* Create a new String object */ StringDesc = AcpiUtCreateInternalObject (ACPI_TYPE_STRING); if (!StringDesc) { return_PTR (NULL); } /* * Allocate the actual string buffer -- (Size + 1) for NULL terminator. * NOTE: Zero-length strings are NULL terminated */ String = ACPI_ALLOCATE_ZEROED (StringSize + 1); if (!String) { ACPI_ERROR ((AE_INFO, "Could not allocate size %u", (UINT32) StringSize)); AcpiUtRemoveReference (StringDesc); return_PTR (NULL); } /* Complete string object initialization */ StringDesc->String.Pointer = String; StringDesc->String.Length = (UINT32) StringSize; /* Return the new string descriptor */ return_PTR (StringDesc);}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:42,
示例19: acpi_ut_create_buffer_objectunion acpi_operand_object *acpi_ut_create_buffer_object ( acpi_size buffer_size){ union acpi_operand_object *buffer_desc; u8 *buffer = NULL; ACPI_FUNCTION_TRACE_U32 ("ut_create_buffer_object", buffer_size); /* Create a new Buffer object */ buffer_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER); if (!buffer_desc) { return_PTR (NULL); } /* Create an actual buffer only if size > 0 */ if (buffer_size > 0) { /* Allocate the actual buffer */ buffer = ACPI_MEM_CALLOCATE (buffer_size); if (!buffer) { ACPI_REPORT_ERROR (("create_buffer: could not allocate size %X/n", (u32) buffer_size)); acpi_ut_remove_reference (buffer_desc); return_PTR (NULL); } } /* Complete buffer object initialization */ buffer_desc->buffer.flags |= AOPOBJ_DATA_VALID; buffer_desc->buffer.pointer = buffer; buffer_desc->buffer.length = (u32) buffer_size; /* Return the new buffer descriptor */ return_PTR (buffer_desc);}
开发者ID:GodFox,项目名称:magx_kernel_xpixl,代码行数:42,
示例20: acpi_button_notify_handlerstatic void acpi_button_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context){ struct acpi_button_softc *sc; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, notify); sc = (struct acpi_button_softc *)context; switch (notify) { case ACPI_NOTIFY_BUTTON_PRESSED_FOR_SLEEP: AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_button_notify_sleep, sc); break; case ACPI_NOTIFY_BUTTON_PRESSED_FOR_WAKEUP: AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_button_notify_wakeup, sc); break; default: device_printf(sc->button_dev, "unknown notify %#x/n", notify); break; }}
开发者ID:Gwenio,项目名称:DragonFlyBSD,代码行数:20,
示例21: AcpiUtCreateBufferObjectACPI_OPERAND_OBJECT *AcpiUtCreateBufferObject ( ACPI_SIZE BufferSize){ ACPI_OPERAND_OBJECT *BufferDesc; UINT8 *Buffer; ACPI_FUNCTION_TRACE_U32 ("UtCreateBufferObject", BufferSize); /* * Create a new Buffer object */ BufferDesc = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER); if (!BufferDesc) { return_PTR (NULL); } /* Allocate the actual buffer */ Buffer = ACPI_MEM_CALLOCATE (BufferSize); if (!Buffer) { ACPI_REPORT_ERROR (("CreateBuffer: could not allocate size %X/n", (UINT32) BufferSize)); AcpiUtRemoveReference (BufferDesc); return_PTR (NULL); } /* Complete buffer object initialization */ BufferDesc->Buffer.Flags |= AOPOBJ_DATA_VALID; BufferDesc->Buffer.Pointer = Buffer; BufferDesc->Buffer.Length = (UINT32) BufferSize; /* Return the new buffer descriptor */ return_PTR (BufferDesc);}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:41,
示例22: acpi_ut_create_mutexstatic acpi_status acpi_ut_create_mutex(acpi_mutex_handle mutex_id){ acpi_status status = AE_OK; ACPI_FUNCTION_TRACE_U32("ut_create_mutex", mutex_id); if (mutex_id > MAX_MUTEX) { return_ACPI_STATUS(AE_BAD_PARAMETER); } if (!acpi_gbl_mutex_info[mutex_id].mutex) { status = acpi_os_create_semaphore(1, 1, &acpi_gbl_mutex_info [mutex_id].mutex); acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED; acpi_gbl_mutex_info[mutex_id].use_count = 0; } return_ACPI_STATUS(status);}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:21,
示例23: EcWaitEventIntr/* * Wait for an event interrupt for a specific condition. */static ACPI_STATUSEcWaitEventIntr(struct acpi_ec_softc *sc, EC_EVENT Event){ EC_STATUS EcStatus; int i; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, (UINT32)Event); /* XXX this should test whether interrupts are available some other way */ if (cold || acpi_ec_event_driven) return_ACPI_STATUS(EcWaitEvent(sc, Event)); if (!EcIsLocked(sc)) ACPI_VPRINT(sc->ec_dev, acpi_device_get_parent_softc(sc->ec_dev), "EcWaitEventIntr called without EC lock!/n"); EcStatus = EC_GET_CSR(sc); /* XXX waiting too long? */ for(i = 0; i < 10; i++){ /* * Check EC status against the desired event. */ if ((Event == EC_EVENT_OUTPUT_BUFFER_FULL) && (EcStatus & EC_FLAG_OUTPUT_BUFFER)) return_ACPI_STATUS(AE_OK); if ((Event == EC_EVENT_INPUT_BUFFER_EMPTY) && !(EcStatus & EC_FLAG_INPUT_BUFFER)) return_ACPI_STATUS(AE_OK); sc->ec_csrvalue = 0; if (ACPI_MSLEEP(&sc->ec_csrvalue, &acpi_mutex, PZERO, "EcWait", 1) != EWOULDBLOCK){ EcStatus = sc->ec_csrvalue; }else{ EcStatus = EC_GET_CSR(sc); } } return_ACPI_STATUS(AE_ERROR);}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:43,
示例24: AcpiUtDeleteMutexACPI_STATUSAcpiUtDeleteMutex ( ACPI_MUTEX_HANDLE MutexId){ ACPI_STATUS Status; ACPI_FUNCTION_TRACE_U32 ("UtDeleteMutex", MutexId); if (MutexId > MAX_MTX) { return_ACPI_STATUS (AE_BAD_PARAMETER); } Status = AcpiOsDeleteSemaphore (AcpiGbl_AcpiMutexInfo[MutexId].Mutex); AcpiGbl_AcpiMutexInfo[MutexId].Mutex = NULL; AcpiGbl_AcpiMutexInfo[MutexId].OwnerId = ACPI_MUTEX_NOT_ACQUIRED; return_ACPI_STATUS (Status);}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:22,
示例25: AcpiNsDeleteNamespaceByOwnervoidAcpiNsDeleteNamespaceByOwner ( ACPI_OWNER_ID OwnerId){ ACPI_NAMESPACE_NODE *ChildNode; ACPI_NAMESPACE_NODE *DeletionNode; ACPI_NAMESPACE_NODE *ParentNode; UINT32 Level; ACPI_STATUS Status; ACPI_FUNCTION_TRACE_U32 (NsDeleteNamespaceByOwner, OwnerId); if (OwnerId == 0) { return_VOID; } /* Lock namespace for possible update */ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { return_VOID; } DeletionNode = NULL; ParentNode = AcpiGbl_RootNode; ChildNode = NULL; Level = 1; /* * Traverse the tree of nodes until we bubble back up * to where we started. */ while (Level > 0) { /* * Get the next child of this parent node. When ChildNode is NULL, * the first child of the parent is returned */ ChildNode = AcpiNsGetNextNode (ParentNode, ChildNode); if (DeletionNode) { AcpiNsDeleteChildren (DeletionNode); AcpiNsRemoveNode (DeletionNode); DeletionNode = NULL; } if (ChildNode) { if (ChildNode->OwnerId == OwnerId) { /* Found a matching child node - detach any attached object */ AcpiNsDetachObject (ChildNode); } /* Check if this node has any children */ if (ChildNode->Child) { /* * There is at least one child of this node, * visit the node */ Level++; ParentNode = ChildNode; ChildNode = NULL; } else if (ChildNode->OwnerId == OwnerId) { DeletionNode = ChildNode; } } else { /* * No more children of this parent node. * Move up to the grandparent. */ Level--; if (Level != 0) { if (ParentNode->OwnerId == OwnerId) { DeletionNode = ParentNode; } } /* New "last child" is this parent node */ ChildNode = ParentNode; /* Move up the tree to the grandparent */ ParentNode = ParentNode->Parent; }//.........这里部分代码省略.........
开发者ID:2asoft,项目名称:freebsd,代码行数:101,
示例26: EcSpaceHandlerstatic ACPI_STATUSEcSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 Width, UINT64 *Value, void *Context, void *RegionContext){ struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; ACPI_PHYSICAL_ADDRESS EcAddr; UINT8 *EcData; ACPI_STATUS Status; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, (UINT32)Address); if (Function != ACPI_READ && Function != ACPI_WRITE) return_ACPI_STATUS (AE_BAD_PARAMETER); if (Width % 8 != 0 || Value == NULL || Context == NULL) return_ACPI_STATUS (AE_BAD_PARAMETER); if (Address + Width / 8 > 256) return_ACPI_STATUS (AE_BAD_ADDRESS); /* * If booting, check if we need to run the query handler. If so, we * we call it directly here since our thread taskq is not active yet. */ if (cold || rebooting || sc->ec_suspending) { if ((EC_GET_CSR(sc) & EC_EVENT_SCI)) { EcGpeQueryHandler(sc); } } /* Serialize with EcGpeQueryHandler() at transaction granularity. */ Status = EcLock(sc); if (ACPI_FAILURE(Status)) return_ACPI_STATUS (Status); /* If we can't start burst mode, continue anyway. */ Status = EcCommand(sc, EC_COMMAND_BURST_ENABLE); if (ACPI_SUCCESS(Status)) { if (EC_GET_DATA(sc) == EC_BURST_ACK) { sc->ec_burstactive = TRUE; } } /* Perform the transaction(s), based on Width. */ EcAddr = Address; EcData = (UINT8 *)Value; if (Function == ACPI_READ) *Value = 0; do { switch (Function) { case ACPI_READ: Status = EcRead(sc, EcAddr, EcData); break; case ACPI_WRITE: Status = EcWrite(sc, EcAddr, *EcData); break; } if (ACPI_FAILURE(Status)) break; EcAddr++; EcData++; } while (EcAddr < Address + Width / 8); if (sc->ec_burstactive) { sc->ec_burstactive = FALSE; if (ACPI_SUCCESS(EcCommand(sc, EC_COMMAND_BURST_DISABLE))) { } } EcUnlock(sc); return_ACPI_STATUS (Status);}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:70,
示例27: acpi_ev_initialize_regionacpi_statusacpi_ev_initialize_region(union acpi_operand_object *region_obj, u8 acpi_ns_locked){ union acpi_operand_object *handler_obj; union acpi_operand_object *obj_desc; acpi_adr_space_type space_id; struct acpi_namespace_node *node; acpi_status status; struct acpi_namespace_node *method_node; acpi_name *reg_name_ptr = (acpi_name *) METHOD_NAME__REG; union acpi_operand_object *region_obj2; ACPI_FUNCTION_TRACE_U32(ev_initialize_region, acpi_ns_locked); if (!region_obj) { return_ACPI_STATUS(AE_BAD_PARAMETER); } if (region_obj->common.flags & AOPOBJ_OBJECT_INITIALIZED) { return_ACPI_STATUS(AE_OK); } region_obj2 = acpi_ns_get_secondary_object(region_obj); if (!region_obj2) { return_ACPI_STATUS(AE_NOT_EXIST); } node = acpi_ns_get_parent_node(region_obj->region.node); space_id = region_obj->region.space_id; /* Setup defaults */ region_obj->region.handler = NULL; region_obj2->extra.method_REG = NULL; region_obj->common.flags &= ~(AOPOBJ_SETUP_COMPLETE); region_obj->common.flags |= AOPOBJ_OBJECT_INITIALIZED; /* Find any "_REG" method associated with this region definition */ status = acpi_ns_search_one_scope(*reg_name_ptr, node, ACPI_TYPE_METHOD, &method_node); if (ACPI_SUCCESS(status)) { /* * The _REG method is optional and there can be only one per region * definition. This will be executed when the handler is attached * or removed */ region_obj2->extra.method_REG = method_node; } /* * The following loop depends upon the root Node having no parent * ie: acpi_gbl_root_node->parent_entry being set to NULL */ while (node) { /* Check to see if a handler exists */ handler_obj = NULL; obj_desc = acpi_ns_get_attached_object(node); if (obj_desc) { /* Can only be a handler if the object exists */ switch (node->type) { case ACPI_TYPE_DEVICE: handler_obj = obj_desc->device.handler; break; case ACPI_TYPE_PROCESSOR: handler_obj = obj_desc->processor.handler; break; case ACPI_TYPE_THERMAL: handler_obj = obj_desc->thermal_zone.handler; break; default: /* Ignore other objects */ break; } while (handler_obj) { /* Is this handler of the correct type? */ if (handler_obj->address_space.space_id == space_id) { /* Found correct handler */ ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, "Found handler %p for region %p in obj %p/n", handler_obj, region_obj,//.........这里部分代码省略.........
开发者ID:FatSunHYS,项目名称:OSCourseDesign,代码行数:101,
示例28: AcpiEvInitializeRegionACPI_STATUSAcpiEvInitializeRegion ( ACPI_OPERAND_OBJECT *RegionObj, BOOLEAN AcpiNsLocked){ ACPI_OPERAND_OBJECT *HandlerObj; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_ADR_SPACE_TYPE SpaceId; ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; ACPI_FUNCTION_TRACE_U32 (EvInitializeRegion, AcpiNsLocked); if (!RegionObj) { return_ACPI_STATUS (AE_BAD_PARAMETER); } if (RegionObj->Common.Flags & AOPOBJ_OBJECT_INITIALIZED) { return_ACPI_STATUS (AE_OK); } RegionObj->Common.Flags |= AOPOBJ_OBJECT_INITIALIZED; Node = RegionObj->Region.Node->Parent; SpaceId = RegionObj->Region.SpaceId; /* * The following loop depends upon the root Node having no parent * ie: AcpiGbl_RootNode->Parent being set to NULL */ while (Node) { /* Check to see if a handler exists */ HandlerObj = NULL; ObjDesc = AcpiNsGetAttachedObject (Node); if (ObjDesc) { /* Can only be a handler if the object exists */ switch (Node->Type) { case ACPI_TYPE_DEVICE: case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_THERMAL: HandlerObj = ObjDesc->CommonNotify.Handler; break; case ACPI_TYPE_METHOD: /* * If we are executing module level code, the original * Node's object was replaced by this Method object and we * saved the handler in the method object. * * See AcpiNsExecModuleCode */ if (ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL) { HandlerObj = ObjDesc->Method.Dispatch.Handler; } break; default: /* Ignore other objects */ break; } HandlerObj = AcpiEvFindRegionHandler (SpaceId, HandlerObj); if (HandlerObj) { /* Found correct handler */ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Found handler %p for region %p in obj %p/n", HandlerObj, RegionObj, ObjDesc)); Status = AcpiEvAttachRegion (HandlerObj, RegionObj, AcpiNsLocked); /* * Tell all users that this region is usable by * running the _REG method */ if (AcpiNsLocked) { Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } Status = AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT);//.........这里部分代码省略.........
开发者ID:2asoft,项目名称:freebsd,代码行数:101,
注:本文中的ACPI_FUNCTION_TRACE_U32函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ACPI_GET_1BIT_FLAG函数代码示例 C++ ACPI_FUNCTION_TRACE_STR函数代码示例 |