當前位置: 首頁>>代碼示例>>C++>>正文


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函數的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);
}
開發者ID:NoSuchProcess,項目名稱:phantomuserland,代碼行數:35,代碼來源:utalloc.c

示例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);
}
開發者ID:08opt,項目名稱:linux,代碼行數:28,代碼來源:utalloc.c

示例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);
}
開發者ID:420GrayFox,項目名稱:dsl-n55u-bender,代碼行數:35,代碼來源:utobject.c

示例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;
}
開發者ID:eyberg,項目名稱:rumpkernel-netbsd-src,代碼行數:57,代碼來源:utownerid.c

示例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;
}
開發者ID:Medvedroid,項目名稱:OT_903D-kernel-2.6.35.7,代碼行數:10,代碼來源:utmutex.c

示例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;
}
開發者ID:020gzh,項目名稱:linux,代碼行數:49,代碼來源:utownerid.c

示例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;
}
開發者ID:apprisi,項目名稱:illumos-gate,代碼行數:13,代碼來源:utmutex.c

示例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;
}
開發者ID:iPodLinux,項目名稱:linux-2.4.24-ipod,代碼行數:48,代碼來源:exfldio.c

示例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);
}
開發者ID:bionicOnion,項目名稱:RPi-Linux-4.1.13,代碼行數:16,代碼來源:utmutex.c

示例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);
}
開發者ID:mrtos,項目名稱:Logitech-Revue,代碼行數:16,代碼來源:utmutex.c

示例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;
}
開發者ID:UnitedMarsupials,項目名稱:kame,代碼行數:16,代碼來源:acpi_lid.c

示例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);
}
開發者ID:UnitedMarsupials,項目名稱:kame,代碼行數:47,代碼來源:acpi_ec.c

示例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);
}
開發者ID:FreeBSDFoundation,項目名稱:freebsd,代碼行數:46,代碼來源:utobject.c

示例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);
}
開發者ID:BackupTheBerlios,項目名稱:tew632-brp-svn,代碼行數:17,代碼來源:utmutex.c

示例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);
}
開發者ID:apprisi,項目名稱:illumos-gate,代碼行數:19,代碼來源:utmutex.c


注:本文中的ACPI_FUNCTION_TRACE_U32函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。