本文整理匯總了C++中ACPI_FUNCTION_TRACE_U32函數的典型用法代碼示例。如果您正苦於以下問題:C++ ACPI_FUNCTION_TRACE_U32函數的具體用法?C++ ACPI_FUNCTION_TRACE_U32怎麽用?C++ ACPI_FUNCTION_TRACE_U32使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ACPI_FUNCTION_TRACE_U32函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: AcpiUtAllocate
void *
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);
}
示例2: ACPI_FUNCTION_TRACE_U32
void *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);
}
示例3: ACPI_FUNCTION_TRACE_U32
union 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);
}
示例4: AcpiUtReleaseOwnerId
void
AcpiUtReleaseOwnerId (
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;
}
示例5: acpi_ut_delete_mutex
static 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;
}
示例6: acpi_ut_release_owner_id
void 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;
}
示例7: AcpiUtDeleteMutex
static void
AcpiUtDeleteMutex (
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;
}
示例8: acpi_ex_set_buffer_datum
void
acpi_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;
}
示例9: acpi_ut_create_mutex
static 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);
}
示例10: acpi_ut_delete_mutex
static 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);
}
示例11: acpi_lid_notify_handler
static 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;
}
示例12: EcSpaceHandler
static ACPI_STATUS
EcSpaceHandler(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);
}
示例13: AcpiUtCreateBufferObject
ACPI_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);
}
示例14: acpi_ut_delete_mutex
static 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);
}
示例15: AcpiUtCreateMutex
static ACPI_STATUS
AcpiUtCreateMutex (
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);
}