当前位置: 首页>>代码示例>>C++>>正文


C++ ESIF_ASSERT函数代码示例

本文整理汇总了C++中ESIF_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ ESIF_ASSERT函数的具体用法?C++ ESIF_ASSERT怎么用?C++ ESIF_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ESIF_ASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: esif_ccb_timer_obj_create

static enum esif_rc esif_ccb_timer_obj_create(
	const esif_ccb_timer_cb function_ptr,	/* Callback when timer fires */
	void *context_ptr,			/* Callback context if any */
	struct esif_timer_obj **timer_obj_ptr
	)
{
	enum esif_rc rc = ESIF_OK;
	struct esif_timer_obj *new_timer_obj_ptr = NULL;

	ESIF_ASSERT(function_ptr != NULL);
	ESIF_ASSERT(timer_obj_ptr != NULL);

	new_timer_obj_ptr = (struct esif_timer_obj *)esif_ccb_malloc(sizeof(*new_timer_obj_ptr));
	if (NULL == new_timer_obj_ptr) {
		rc = ESIF_E_NO_MEMORY;
		goto exit;
	}

	rc = esif_ccb_timer_obj_create_timer(new_timer_obj_ptr);
	if (rc != ESIF_OK)
		goto exit;

	new_timer_obj_ptr->function_ptr = function_ptr;
	new_timer_obj_ptr->context_ptr = context_ptr;

	*timer_obj_ptr = new_timer_obj_ptr;
exit:
	if (rc != ESIF_OK)
		esif_ccb_timer_obj_destroy(new_timer_obj_ptr);

	return rc;
}
开发者ID:01org,项目名称:dptf,代码行数:32,代码来源:esif_ccb_timer.c

示例2: esif_find_node_in_ht_ll

static struct esif_link_list_node * esif_find_node_in_ht_ll(
    struct esif_link_list *ll_ptr,
    u8 *key_ptr,
    u32 key_length
)
{
    struct esif_link_list_node *cur_ptr = NULL;
    struct esif_ht_node *ht_node = NULL;

    ESIF_ASSERT(ll_ptr != NULL);
    ESIF_ASSERT(key_ptr != NULL);

    cur_ptr = ll_ptr->head_ptr;
    while (cur_ptr) {
        ht_node = (struct esif_ht_node *)cur_ptr->data_ptr;
        if (ht_node != NULL) {
            if (esif_cmp_keys(key_ptr, key_length,
                              ht_node->key_ptr, ht_node->key_length)) {
                break;
            }
        }
        cur_ptr = cur_ptr->next_ptr;
    }
    return cur_ptr;
}
开发者ID:hoangt,项目名称:dptf,代码行数:25,代码来源:esif_hash_table.c

示例3: esif_ht_get_ll

/* Get link list corresponding to the hash index */
struct esif_link_list * esif_ht_get_ll(
    struct esif_ht *self,
    u8 *key_ptr,
    u32 key_length
)
{
    struct esif_link_list *ll_ptr = NULL;
    u32 hash_index;

    ESIF_ASSERT(key_ptr != NULL);
    ESIF_ASSERT(self != NULL);

    hash_index = esif_compute_hash(key_ptr, key_length) % self->size;

    ll_ptr = self->table[hash_index];
    ESIF_TRACE_DYN_VERB(
        "Key %p, key size %d, table %p index %d ll %p\n",
        key_ptr,
        key_length,
        self,
        hash_index,
        ll_ptr);

    return ll_ptr;
}
开发者ID:hoangt,项目名称:dptf,代码行数:26,代码来源:esif_hash_table.c

示例4: ESIF_ASSERT

static struct esif_ht_node *esif_ht_get_ht_node(
    struct esif_ht *self,
    u8 *key_ptr,
    u32 key_length
)
{
    struct esif_link_list *ll_ptr = NULL;
    struct esif_link_list_node *ll_node = NULL;
    struct esif_ht_node *ht_node = NULL;

    ESIF_ASSERT(key_ptr != NULL);
    ESIF_ASSERT(self != NULL);

    ll_ptr = esif_ht_get_ll(self, key_ptr, key_length);
    if (ll_ptr == NULL) {
        ESIF_ASSERT(ESIF_FALSE); /* Should never happen */
        ESIF_TRACE_DYN_VERB("LL NULL for passed in key\n");
        goto exit;
    }

    ll_node = esif_find_node_in_ht_ll(ll_ptr, key_ptr, key_length);
    if (ll_node == NULL) {
        ESIF_TRACE_DYN_VERB("LL node not found for passed in key\n");
        goto exit;
    }

    ht_node = (struct esif_ht_node *)ll_node->data_ptr;
exit:
    return ht_node;
}
开发者ID:hoangt,项目名称:dptf,代码行数:30,代码来源:esif_hash_table.c

示例5: UpInitializeOriginUF

/*
   Map upper participant metadata to upper particpant instance.  A participant
   that is created from the upperframework will never have a lower framework
   component.  These participants are to cover the case were we either have no
   Kernel corresponding participant or in some cases we may not even have a
   lower frame work present.
 */
static void UpInitializeOriginUF(
	const EsifUpPtr upPtr,
	const void *upMetadataPtr
	)
{
	/* Upper Participant Metadata Format */
	EsifParticipantIfacePtr metadata_ptr =
		(EsifParticipantIfacePtr)upMetadataPtr;

	ESIF_ASSERT(upPtr != NULL);
	ESIF_ASSERT(metadata_ptr != NULL);

	/* Store Lower Framework Instance */
	upPtr->fLpInstance = 255;	/* Not Used */

	/* Common */
	upPtr->fMetadata.fVersion    = metadata_ptr->version;
	upPtr->fMetadata.fEnumerator = (enum esif_participant_enum)metadata_ptr->enumerator;
	upPtr->fMetadata.fFlags = metadata_ptr->flags;

	esif_ccb_memcpy(&upPtr->fMetadata.fDriverType, &metadata_ptr->class_guid, ESIF_GUID_LEN);

	esif_ccb_strcpy(upPtr->fMetadata.fName, metadata_ptr->name, ESIF_NAME_LEN);
	esif_ccb_strcpy(upPtr->fMetadata.fDesc, metadata_ptr->desc, ESIF_DESC_LEN);
	esif_ccb_strcpy(upPtr->fMetadata.fDriverName, metadata_ptr->driver_name, ESIF_NAME_LEN);
	esif_ccb_strcpy(upPtr->fMetadata.fDeviceName, metadata_ptr->device_name, ESIF_NAME_LEN);
	esif_ccb_strcpy(upPtr->fMetadata.fDevicePath, metadata_ptr->device_path, ESIF_PATH_LEN);
	esif_ccb_strcpy(upPtr->fMetadata.fAcpiScope, metadata_ptr->object_id, ESIF_SCOPE_LEN);
}
开发者ID:naitaku,项目名称:dptf,代码行数:36,代码来源:esif_uf_pm.c

示例6: esif_ccb_tmrm_add_destroy_event

static void esif_ccb_tmrm_add_destroy_event(
	struct esif_tmrm_item *self,
	esif_ccb_event_t *event_ptr
	)
{
	ESIF_ASSERT(self != NULL);
	ESIF_ASSERT(self->destroy_list_ptr != NULL);

	if (event_ptr != NULL) {
		esif_link_list_add_at_back(self->destroy_list_ptr, event_ptr);
	}
}
开发者ID:01org,项目名称:dptf,代码行数:12,代码来源:esif_ccb_timer.c

示例7: EsifActMgr_GetTypeFromPossAct_Locked

static eEsifError EsifActMgr_GetTypeFromPossAct_Locked(
	EsifActMgrEntryPtr entryPtr,
	enum esif_action_type *typePtr
	)
{
	eEsifError rc = ESIF_OK;
	GetIfaceFuncPtr getIfacePtr = NULL;
	EsifActIface iface = {0};

	ESIF_ASSERT(entryPtr != NULL);
	ESIF_ASSERT(typePtr != NULL);

	/* If we already have the type from a previous search, return it */
	if (entryPtr->type != 0) {
		*typePtr = entryPtr->type;
	}

	/* If we don't already have the type; load the library and get the type */
	rc = EsifActMgr_LoadAction(entryPtr, &getIfacePtr);
	if (rc != ESIF_OK) {
		goto exit;
	}

	iface.hdr.fIfaceType = eIfaceTypeAction;
	iface.hdr.fIfaceVersion = ESIF_INTERFACE_VERSION;
	iface.hdr.fIfaceSize = sizeof(iface);

	rc = getIfacePtr(&iface);
	if (ESIF_OK != rc) {
		goto exit;
	}

	/* Check EsifActIface */
	if (iface.hdr.fIfaceType != eIfaceTypeAction ||
		iface.hdr.fIfaceVersion > ESIF_ACT_FACE_VER_MAX ||
		iface.hdr.fIfaceSize != EsifActIface_Sizeof(iface.hdr.fIfaceVersion)) {
		ESIF_TRACE_ERROR("The action interface does not meet requirements\n");
		goto exit;
	}

	/* Check if this type is already available; we only allow one instance */
	rc = EsifActIface_GetType(&iface, &entryPtr->type);
	if (rc != ESIF_OK) {
		goto exit;
	}

	*typePtr = entryPtr->type;
exit:
	if (rc != ESIF_OK) {
		EsifActMgr_UnloadAction(entryPtr);
	}
	return rc;
}
开发者ID:LjdCN,项目名称:dptf,代码行数:53,代码来源:esif_uf_actmgr.c

示例8: esif_ccb_timer_obj_call_cb

static void esif_ccb_timer_obj_call_cb(
	struct esif_timer_obj *self
	)
{
	ESIF_ASSERT(self != NULL);
	self->function_ptr(self->context_ptr);
}
开发者ID:01org,项目名称:dptf,代码行数:7,代码来源:esif_ccb_timer.c

示例9: EsifCopyIntToBufBySize

eEsifError EsifCopyIntToBufBySize(
	size_t typeSize,
	void *dstPtr,
	u64 val
	)
{
	eEsifError rc = ESIF_OK;

	ESIF_ASSERT(dstPtr != NULL);

	switch(typeSize) {
	case sizeof(u8):
		*((u8 *)dstPtr) = (u8)val;
		break;
	case sizeof(u16):
		*((u16 *)dstPtr) = (u16)val;
		break;
	case sizeof(u32):
		*((u32 *)dstPtr) = (u32)val;
		break;
	case sizeof(u64):
		*((u64 *)dstPtr) = (u64)val;
		break;
	default:
		rc =  ESIF_E_UNSUPPORTED_RESULT_DATA_TYPE;
		break;
	}
	return rc;
}
开发者ID:01org,项目名称:dptf,代码行数:29,代码来源:esif_uf_action.c

示例10: EsifActIface_SendIfaceEvent

static eEsifError EsifActIface_SendIfaceEvent(
	EsifActIfacePtr self,
	esif_context_t actCtx,
	enum esif_event_type eventType,
	UInt8 upInstance,
	UInt16 domainId,
	EsifDataPtr eventDataPtr
	)
{
	eEsifError rc = ESIF_OK;

	ESIF_ASSERT(self != NULL);

	switch (self->hdr.fIfaceVersion) {
	case ESIF_ACT_IFACE_VER_V1:
		if (NULL == self->actIfaceV1.rcvEventFuncPtr) {
			rc = ESIF_E_NOT_SUPPORTED;
			goto exit;
		}
		self->actIfaceV1.rcvEventFuncPtr(actCtx,
			(esif_handle_t)(size_t)upInstance,
			eventType,
			domainId,
			eventDataPtr
			);
		break;
	case ESIF_ACT_IFACE_VER_STATIC:
	default:
		break;
	}
exit:
	return rc;
}
开发者ID:01org,项目名称:dptf,代码行数:33,代码来源:esif_uf_action.c

示例11: EsifApp_RegisterParticipantsWithApp

static eEsifError EsifApp_RegisterParticipantsWithApp(
	EsifAppPtr self
	)
{
	eEsifError rc = ESIF_OK;
	EsifUpPtr upPtr = NULL;
	UInt8 i = 0;

	ESIF_ASSERT(self != NULL);

	/* Skip 0 ESIF treats this as a participant no one else does :) */
	/* TODO:  Use iterator here.  This function shouldn't know the number of participants */
	for (i = 1; i < MAX_PARTICIPANT_ENTRY; i++) {
		upPtr = EsifUpPm_GetAvailableParticipantByInstance(i);
		if (NULL == upPtr) {
			continue;
		}
		rc = EsifAppCreateParticipant(self, upPtr);
		EsifUp_PutRef(upPtr);
		if (ESIF_OK != rc) {
			break;
		}
	}
	ESIF_TRACE_INFO("Register participants with App, status = %s\n", esif_rc_str(rc));
	return rc;
}
开发者ID:hoangt,项目名称:dptf,代码行数:26,代码来源:esif_uf_app.c

示例12: ESIF_ASSERT

/* Allocate Event IPC */
struct esif_ipc *esif_ipc_alloc_event(
	struct esif_ipc_event **event_ptr_ptr,
	u32 data_len
	)
{
	struct esif_ipc *ipc_ptr = NULL;

	ESIF_ASSERT(event_ptr_ptr != NULL);

	ipc_ptr = esif_ipc_alloc(ESIF_IPC_TYPE_EVENT,
		data_len + sizeof(**event_ptr_ptr));

	if (NULL == ipc_ptr) {
		*event_ptr_ptr = NULL;
	} else {
		esif_ccb_time_t timestamp = {0};
		struct esif_ipc_event *event_ptr = NULL;
		event_ptr = (struct esif_ipc_event *)(ipc_ptr + 1);

		event_ptr->version  = ESIF_EVENT_VERSION;
		event_ptr->priority = ESIF_EVENT_PRIORITY_NORMAL;
		event_ptr->data_len = data_len;

		esif_ccb_system_time(&timestamp);
		event_ptr->timestamp = (u64)timestamp;

		*event_ptr_ptr          = event_ptr;
	}
	return ipc_ptr;
}
开发者ID:hoangt,项目名称:dptf,代码行数:31,代码来源:esif_ipc.c

示例13: IString_Resize

// Resize an IString buffer (if dynamically allocated)
ZString IString_Resize (
	IStringPtr self,
	u32 buf_len
	)
{
	ESIF_ASSERT(self);
	// Allocate initial buffer if it has never been allocated
	if (self->buf_ptr == 0) {
		self->buf_ptr = esif_ccb_malloc(buf_len);
		if (self->buf_ptr) {
			self->buf_len  = buf_len;
			self->data_len = 1;
			return (ZString)self->buf_ptr;
		}
	}
	// Resize buffer if it is not a static string
	if (self->buf_len > 0) {
		ZString buf_ptr = (ZString)esif_ccb_realloc(self->buf_ptr, buf_len);
		if (buf_ptr) {
			if (buf_len > self->buf_len) {
				esif_ccb_memset(buf_ptr + self->buf_len, 0, buf_len - self->buf_len);
			}
			self->buf_ptr = buf_ptr;
			self->buf_len = buf_len;
			return (ZString)self->buf_ptr;
		}
	}
	return 0;
}
开发者ID:LjdCN,项目名称:dptf,代码行数:30,代码来源:esif_lib_istring.c

示例14: EsifUpManagerGetAvailableParticipantByInstance

/* Get By Instance From ID */
EsifUpPtr EsifUpManagerGetAvailableParticipantByInstance (
	const UInt8 id
	)
{
	EsifUpPtr up_ptr = NULL;
	ESIF_TRACE_DEBUG("%s: instance %d\n", ESIF_FUNC, id);

	if (id >= MAX_PARTICIPANT_ENTRY) {
		ESIF_TRACE_ERROR("Instance id %d is out of range\n", id);
		ESIF_ASSERT(0);
		goto exit;
	}

	/* Lock manager */
	esif_ccb_read_lock(&g_uppMgr.fLock);

	if (g_uppMgr.fEntries[id].fState > ESIF_PM_PARTICIPANT_REMOVED) {
		up_ptr = g_uppMgr.fEntries[id].fUpPtr;
	}

	/* Unlock Manager */
	esif_ccb_read_unlock(&g_uppMgr.fLock);

exit:

	if (NULL == up_ptr) {
		ESIF_TRACE_DEBUG("%s: instance %d NOT found or OUT OF BOUNDS\n",
						 ESIF_FUNC, id);
	}
	return up_ptr;
}
开发者ID:naitaku,项目名称:dptf,代码行数:32,代码来源:esif_uf_pm.c

示例15: UpInitializeOriginLF

/*
**  Map lower participant metadata to upper participant instance.  Every
**  lower participant must have a corresponding upper particpant.  Here we
**  intialize the data from the upper participant from the lower participant
**  registration data.
*/
static void UpInitializeOriginLF(
	const EsifUpPtr upPtr,
	const UInt8 lpInstance,
	const void *lpMetadataPtr
	)
{
	/* Lower Framework Participant Metadata Format */
	struct esif_ipc_event_data_create_participant *metadata_ptr =
		(struct esif_ipc_event_data_create_participant *)lpMetadataPtr;

	ESIF_ASSERT(upPtr != NULL);
	ESIF_ASSERT(metadata_ptr != NULL);

	/* Store Lower Framework Instance. */
	upPtr->fLpInstance = lpInstance;

	/* Common */
	upPtr->fMetadata.fVersion    = metadata_ptr->version;
	upPtr->fMetadata.fEnumerator = (enum esif_participant_enum)metadata_ptr->enumerator;
	upPtr->fMetadata.fFlags = metadata_ptr->flags;

	esif_ccb_memcpy(&upPtr->fMetadata.fDriverType, &metadata_ptr->class_guid, ESIF_GUID_LEN);

	esif_ccb_strcpy(upPtr->fMetadata.fName, metadata_ptr->name, ESIF_NAME_LEN);
	esif_ccb_strcpy(upPtr->fMetadata.fDesc, metadata_ptr->desc, ESIF_DESC_LEN);
	esif_ccb_strcpy(upPtr->fMetadata.fDriverName, metadata_ptr->driver_name, ESIF_NAME_LEN);
	esif_ccb_strcpy(upPtr->fMetadata.fDeviceName, metadata_ptr->device_name, ESIF_NAME_LEN);
	esif_ccb_strcpy(upPtr->fMetadata.fDevicePath, metadata_ptr->device_path, ESIF_PATH_LEN);

	/* ACPI */
	esif_ccb_strcpy(upPtr->fMetadata.fAcpiUID, metadata_ptr->acpi_uid, sizeof(upPtr->fMetadata.fAcpiUID));
	upPtr->fMetadata.fAcpiType = metadata_ptr->acpi_type;
	esif_ccb_strcpy(upPtr->fMetadata.fAcpiDevice, metadata_ptr->acpi_device, ESIF_NAME_LEN);
	esif_ccb_strcpy(upPtr->fMetadata.fAcpiScope, metadata_ptr->acpi_scope, ESIF_SCOPE_LEN);

	/* PCI */
	upPtr->fMetadata.fPciVendor    = (u16)metadata_ptr->pci_vendor;
	upPtr->fMetadata.fPciDevice    = (u16)metadata_ptr->pci_device;
	upPtr->fMetadata.fPciBus       = metadata_ptr->pci_bus;
	upPtr->fMetadata.fPciBusDevice = metadata_ptr->pci_bus_device;
	upPtr->fMetadata.fPciFunction  = metadata_ptr->pci_function;
	upPtr->fMetadata.fPciRevision  = metadata_ptr->pci_revision;
	upPtr->fMetadata.fPciClass     = metadata_ptr->pci_class;
	upPtr->fMetadata.fPciSubClass  = metadata_ptr->pci_sub_class;
	upPtr->fMetadata.fPciProgIf    = metadata_ptr->pci_prog_if;
}
开发者ID:naitaku,项目名称:dptf,代码行数:52,代码来源:esif_uf_pm.c


注:本文中的ESIF_ASSERT函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。