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


C++ DBC_REQUIRE函数代码示例

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


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

示例1: cmm_get_handle

/*
 *  ======== cmm_get_handle ========
 *  Purpose:
 *      Return the communication memory manager object for this device.
 *      This is typically called from the client process.
 */
int cmm_get_handle(void *hprocessor, OUT struct cmm_object ** ph_cmm_mgr)
{
	int status = 0;
	struct dev_object *hdev_obj;

	DBC_REQUIRE(refs > 0);
	DBC_REQUIRE(ph_cmm_mgr != NULL);
	if (hprocessor != NULL)
		status = proc_get_dev_object(hprocessor, &hdev_obj);
	else
		hdev_obj = dev_get_first();	/* default */

	if (DSP_SUCCEEDED(status))
		status = dev_get_cmm_mgr(hdev_obj, ph_cmm_mgr);

	return status;
}
开发者ID:AdiPat,项目名称:i9003_Kernel,代码行数:23,代码来源:cmm.c

示例2: DBC_REQUIRE

/*
 * ======== get_allocator ========
 *  Purpose:
 *      Return the allocator for the given SM Segid.
 *      SegIds:  1,2,3..max.
 */
static struct cmm_allocator *get_allocator(struct cmm_object *cmm_mgr_obj,
					   u32 ul_seg_id)
{
	struct cmm_allocator *allocator = NULL;

	DBC_REQUIRE(cmm_mgr_obj != NULL);
	DBC_REQUIRE((ul_seg_id > 0) && (ul_seg_id <= CMM_MAXGPPSEGS));
	allocator = cmm_mgr_obj->pa_gppsm_seg_tab[ul_seg_id - 1];
	if (allocator != NULL) {
		/* make sure it's for real */
		if (!allocator) {
			allocator = NULL;
			DBC_ASSERT(false);
		}
	}
	return allocator;
}
开发者ID:AdiPat,项目名称:i9003_Kernel,代码行数:23,代码来源:cmm.c

示例3: cod_exit

/*
 *  ======== cod_exit ========
 *  Purpose:
 *      Discontinue usage of the COD module.
 *
 */
void cod_exit(void)
{
	DBC_REQUIRE(refs > 0);

	refs--;

	DBC_ENSURE(refs >= 0);
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:14,代码来源:cod.c

示例4: rmm_init

/*
 *  ======== rmm_init ========
 */
bool rmm_init(void)
{
	DBC_REQUIRE(refs >= 0);

	refs++;

	return true;
}
开发者ID:macroliu,项目名称:samsung_kernel_nowplus,代码行数:11,代码来源:rmm.c

示例5: cmm_free_buf

/*
 *  ======== cmm_free_buf ========
 *  Purpose:
 *      Free the given buffer.
 */
int cmm_free_buf(struct cmm_object *hcmm_mgr, void *buf_pa,
			u32 ul_seg_id)
{
	struct cmm_object *cmm_mgr_obj = (struct cmm_object *)hcmm_mgr;
	int status = -EFAULT;
	struct cmm_mnode *mnode_obj = NULL;
	struct cmm_allocator *allocator = NULL;
	struct cmm_attrs *pattrs;

	DBC_REQUIRE(refs > 0);
	DBC_REQUIRE(buf_pa != NULL);

	if (ul_seg_id == 0) {
		pattrs = &cmm_dfltalctattrs;
		ul_seg_id = pattrs->ul_seg_id;
	}
	if (!hcmm_mgr || !(ul_seg_id > 0)) {
		status = -EFAULT;
		return status;
	}
	/* get the allocator for this segment id */
	allocator = get_allocator(cmm_mgr_obj, ul_seg_id);
	if (allocator != NULL) {
		mutex_lock(&cmm_mgr_obj->cmm_lock);
		mnode_obj =
		    (struct cmm_mnode *)lst_first(allocator->in_use_list_head);
		while (mnode_obj) {
			if ((u32) buf_pa == mnode_obj->dw_pa) {
				/* Found it */
				lst_remove_elem(allocator->in_use_list_head,
						(struct list_head *)mnode_obj);
				/* back to freelist */
				add_to_free_list(allocator, mnode_obj);
				status = 0;	/* all right! */
				break;
			}
			/* next node. */
			mnode_obj = (struct cmm_mnode *)
			    lst_next(allocator->in_use_list_head,
				     (struct list_head *)mnode_obj);
		}
		mutex_unlock(&cmm_mgr_obj->cmm_lock);
	}
	return status;
}
开发者ID:AdiPat,项目名称:i9003_Kernel,代码行数:50,代码来源:cmm.c

示例6: rmm_free

/*
 *  ======== rmm_free ========
 */
bool rmm_free(struct rmm_target_obj *target, u32 segid, u32 addr, u32 size,
	      bool reserved)
{
	struct rmm_ovly_sect *sect;
	bool ret = true;

	DBC_REQUIRE(target);

	DBC_REQUIRE(reserved || segid < target->num_segs);
	DBC_REQUIRE(reserved || (addr >= target->seg_tab[segid].base &&
				 (addr + size) <= (target->seg_tab[segid].base +
						   target->seg_tab[segid].
						   length)));

	/*
	 *  Free or unreserve memory.
	 */
	if (!reserved) {
		ret = free_block(target, segid, addr, size);
		if (ret)
			target->seg_tab[segid].number--;

	} else {
		/* Unreserve memory */
		sect = (struct rmm_ovly_sect *)lst_first(target->ovly_list);
		while (sect != NULL) {
			if (addr == sect->addr) {
				DBC_ASSERT(size == sect->size);
				/* Remove from list */
				lst_remove_elem(target->ovly_list,
						(struct list_head *)sect);
				kfree(sect);
				break;
			}
			sect =
			    (struct rmm_ovly_sect *)lst_next(target->ovly_list,
							     (struct list_head
							      *)sect);
		}
		if (sect == NULL)
			ret = false;

	}
	return ret;
}
开发者ID:macroliu,项目名称:samsung_kernel_nowplus,代码行数:48,代码来源:rmm.c

示例7: dev_get_io_mgr

/*
 *  ========= dev_get_io_mgr ========
 */
int dev_get_io_mgr(struct dev_object *hdev_obj,
			  struct io_mgr **io_man)
{
	int status = 0;

	DBC_REQUIRE(refs > 0);
	DBC_REQUIRE(io_man != NULL);
	DBC_REQUIRE(hdev_obj);

	if (hdev_obj) {
		*io_man = hdev_obj->hio_mgr;
	} else {
		*io_man = NULL;
		status = -EFAULT;
	}

	return status;
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:21,代码来源:dev.c

示例8: dev_create2

/*
 *  ======== dev_create2 ========
 *  Purpose:
 *      After successful loading of the image from api_init_complete2
 *      (PROC Auto_Start) or proc_load this fxn is called. This creates
 *      the Node Manager and updates the DEV Object.
 */
int dev_create2(struct dev_object *hdev_obj)
{
	int status = 0;
	struct dev_object *dev_obj = hdev_obj;

	DBC_REQUIRE(refs > 0);
	DBC_REQUIRE(hdev_obj);

	/* There can be only one Node Manager per DEV object */
	DBC_ASSERT(!dev_obj->hnode_mgr);
	status = node_create_mgr(&dev_obj->hnode_mgr, hdev_obj);
	if (status)
		dev_obj->hnode_mgr = NULL;

	DBC_ENSURE((!status && dev_obj->hnode_mgr != NULL)
		   || (status && dev_obj->hnode_mgr == NULL));
	return status;
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:25,代码来源:dev.c

示例9: mgr_exit

/*
 *  ======== mgr_exit ========
 *      Decrement reference count, and free resources when reference count is
 *      0.
 */
void mgr_exit(void)
{
	DBC_REQUIRE(refs > 0);
	refs--;
	if (refs == 0)
		dcd_exit();

	DBC_ENSURE(refs >= 0);
}
开发者ID:119-org,项目名称:hi3518-osdrv,代码行数:14,代码来源:mgr.c

示例10: cod_delete

/*
 *  ======== cod_delete ========
 *  Purpose:
 *      Delete a code manager object.
 */
void cod_delete(struct cod_manager *cod_mgr_obj)
{
	DBC_REQUIRE(refs > 0);
	DBC_REQUIRE(cod_mgr_obj);

	if (cod_mgr_obj->base_lib) {
		if (cod_mgr_obj->loaded)
			cod_mgr_obj->fxns.unload_fxn(cod_mgr_obj->base_lib,
							&cod_mgr_obj->attrs);

		cod_mgr_obj->fxns.close_fxn(cod_mgr_obj->base_lib);
	}
	if (cod_mgr_obj->target) {
		cod_mgr_obj->fxns.delete_fxn(cod_mgr_obj->target);
		cod_mgr_obj->fxns.exit_fxn();
	}
	kfree(cod_mgr_obj);
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:23,代码来源:cod.c

示例11: dev_get_io_mgr

/*
 *  ========= dev_get_io_mgr ========
 */
int dev_get_io_mgr(struct dev_object *hdev_obj,
			  OUT struct io_mgr **phIOMgr)
{
	int status = 0;

	DBC_REQUIRE(refs > 0);
	DBC_REQUIRE(phIOMgr != NULL);
	DBC_REQUIRE(hdev_obj);

	if (hdev_obj) {
		*phIOMgr = hdev_obj->hio_mgr;
	} else {
		*phIOMgr = NULL;
		status = -EFAULT;
	}

	return status;
}
开发者ID:AdiPat,项目名称:i9003_Kernel,代码行数:21,代码来源:dev.c

示例12: free_chirp_list

/*
 *  ======== free_chirp_list ========
 *  Purpose:
 *      Free the queue of Chirps.
 */
static void free_chirp_list(struct lst_list *chirp_list)
{
	DBC_REQUIRE(chirp_list != NULL);

	while (!LST_IS_EMPTY(chirp_list))
		kfree(lst_get_head(chirp_list));

	kfree(chirp_list);
}
开发者ID:AdiPat,项目名称:i9003_Kernel,代码行数:14,代码来源:chnl_sm.c

示例13: dev_get_cod_mgr

/*
 *  ======== dev_get_cod_mgr ========
 *  Purpose:
 *      Retrieve the COD manager create for this device.
 */
int dev_get_cod_mgr(struct dev_object *hdev_obj,
			   struct cod_manager **cod_mgr)
{
	int status = 0;
	struct dev_object *dev_obj = hdev_obj;

	DBC_REQUIRE(refs > 0);
	DBC_REQUIRE(cod_mgr != NULL);

	if (hdev_obj) {
		*cod_mgr = dev_obj->cod_mgr;
	} else {
		*cod_mgr = NULL;
		status = -EFAULT;
	}

	DBC_ENSURE(!status || (cod_mgr != NULL && *cod_mgr == NULL));
	return status;
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:24,代码来源:dev.c

示例14: dev_get_dmm_mgr

/*
 *  ======== dev_get_dmm_mgr ========
 *  Purpose:
 *      Retrieve the handle to the dynamic memory manager created for this
 *      device.
 */
int dev_get_dmm_mgr(struct dev_object *hdev_obj,
			   struct dmm_object **mgr)
{
	int status = 0;
	struct dev_object *dev_obj = hdev_obj;

	DBC_REQUIRE(refs > 0);
	DBC_REQUIRE(mgr != NULL);

	if (hdev_obj) {
		*mgr = dev_obj->dmm_mgr;
	} else {
		*mgr = NULL;
		status = -EFAULT;
	}

	DBC_ENSURE(!status || (mgr != NULL && *mgr == NULL));
	return status;
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:25,代码来源:dev.c

示例15: dev_destroy2

/*
 *  ======== dev_destroy2 ========
 *  Purpose:
 *      Destroys the Node manager for this device.
 */
int dev_destroy2(struct dev_object *hdev_obj)
{
	int status = 0;
	struct dev_object *dev_obj = hdev_obj;

	DBC_REQUIRE(refs > 0);
	DBC_REQUIRE(hdev_obj);

	if (dev_obj->hnode_mgr) {
		if (node_delete_mgr(dev_obj->hnode_mgr))
			status = -EPERM;
		else
			dev_obj->hnode_mgr = NULL;

	}

	DBC_ENSURE((!status && dev_obj->hnode_mgr == NULL) || status);
	return status;
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:24,代码来源:dev.c


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