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


C++ DSP_FAILED函数代码示例

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


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

示例1: LIST_Create

/** ============================================================================
 *  @func   LIST_Create
 *
 *  @desc   Allocates and initializes a circular list.
 *
 *  @modif  None
 *  ============================================================================
 */
EXPORT_API
DSP_STATUS
LIST_Create (OUT List ** list)
{
    DSP_STATUS  status  = DSP_SOK ;
    List *      myList = NULL    ;

    TRC_1ENTER ("LIST_Create", list) ;

    DBC_Require (list != NULL) ;

    if (list == NULL) {
        status = DSP_EINVALIDARG ;
        SET_FAILURE_REASON ;
    }
    else {
        status = MEM_Calloc ((Void **) &myList,
                             sizeof(List),
                             MEM_DEFAULT) ;

        if (DSP_FAILED (status)) {
            status = DSP_EMEMORY ;
            SET_FAILURE_REASON ;
        }
        else {
            DBC_Assert (myList != NULL) ;

            myList->head.next = &(myList->head) ;
            myList->head.prev = &(myList->head) ;

            *list = myList ;
        }
    }

    DBC_Ensure (   (DSP_SUCCEEDED (status) && (*list != NULL))
                || (DSP_FAILED (status))) ;

    TRC_1LEAVE ("LIST_Create", status) ;

    return status ;
}
开发者ID:zp8001,项目名称:STUDY_4.0.3,代码行数:49,代码来源:list.c

示例2: NODEWRAP_Allocate

/*
 * ======== NODEWRAP_Allocate ========
 */
u32 NODEWRAP_Allocate(union Trapped_Args *args, void *pr_ctxt)
{
	DSP_STATUS status = DSP_SOK;
	struct DSP_UUID nodeId;
	u32 cbDataSize = 0;
	u32 __user *pSize = (u32 __user *)args->ARGS_NODE_ALLOCATE.pArgs;
	u8 *pArgs = NULL;
	struct DSP_NODEATTRIN attrIn, *pAttrIn = NULL;
	struct NODE_OBJECT *hNode;

	GT_0trace(WCD_debugMask, GT_ENTER, "NODEWRAP_Allocate: entered\n");

	/* Optional argument */
	if (pSize) {
		if (get_user(cbDataSize, pSize))
			status = DSP_EFAIL;

		cbDataSize += sizeof(u32);
		if (DSP_SUCCEEDED(status)) {
			pArgs = MEM_Alloc(cbDataSize, MEM_NONPAGED);
			if (pArgs == NULL)
				status = DSP_EMEMORY;

		}
		cp_fm_usr(pArgs, args->ARGS_NODE_ALLOCATE.pArgs, status,
			 cbDataSize);
	}
	cp_fm_usr(&nodeId, args->ARGS_NODE_ALLOCATE.pNodeID, status, 1);
	if (DSP_FAILED(status))
		goto func_cont;
	/* Optional argument */
	if (args->ARGS_NODE_ALLOCATE.pAttrIn) {
		cp_fm_usr(&attrIn, args->ARGS_NODE_ALLOCATE.pAttrIn, status, 1);
		if (DSP_SUCCEEDED(status))
			pAttrIn = &attrIn;
		else
			status = DSP_EMEMORY;

	}
	if (DSP_SUCCEEDED(status)) {
		mutex_lock(&((struct PROCESS_CONTEXT *)pr_ctxt)->node_lock);
		status = NODE_Allocate(args->ARGS_NODE_ALLOCATE.hProcessor,
				      &nodeId, (struct DSP_CBDATA *)pArgs,
				      pAttrIn, &hNode, pr_ctxt);
		mutex_unlock(&((struct PROCESS_CONTEXT *)pr_ctxt)->node_lock);
	}
	cp_to_usr(args->ARGS_NODE_ALLOCATE.phNode, &hNode, status, 1);
func_cont:
	if (pArgs)
		MEM_Free(pArgs);

	return status;
}
开发者ID:MuMu360121,项目名称:jordan-kernel,代码行数:56,代码来源:wcd.c

示例3: BRIDGE_SUSPEND

static int BRIDGE_SUSPEND(struct platform_device *pdev, pm_message_t state)
{
	u32 status;
	u32 command = PWR_EMERGENCYDEEPSLEEP;

	status = pwr_sleep_dsp(command, time_out);
	if (DSP_FAILED(status))
		return -1;

	bridge_suspend_data.suspended = 1;
	return 0;
}
开发者ID:Loki154,项目名称:Android-kernel-for-kindle-fire,代码行数:12,代码来源:drv_interface.c

示例4: bridge_resume

static int bridge_resume(struct platform_device *pdev)
{
	u32 status;

	status = PWR_WakeDSP(timeOut);
	if (DSP_FAILED(status))
		return -1;

	bridge_suspend_data.suspended = 0;
	wake_up(&bridge_suspend_data.suspend_wq);
	return 0;
}
开发者ID:dancing-leaves,项目名称:nst-linux-kernel,代码行数:12,代码来源:drv_interface.c

示例5: cfg_get_object

/*
 *  ======== cfg_get_object ========
 *  Purpose:
 *      Retrieve the Object handle from the Registry
 */
dsp_status cfg_get_object(OUT u32 *pdwValue, u8 dw_type)
{
	dsp_status status = -EINVAL;
	struct drv_data *drv_datap = dev_get_drvdata(bridge);

	DBC_REQUIRE(pdwValue != NULL);

	if (!drv_datap)
		return -EPERM;

	switch (dw_type) {
	case (REG_DRV_OBJECT):
		if (drv_datap->drv_object) {
			*pdwValue = (u32)drv_datap->drv_object;
			status = DSP_SOK;
		} else {
			status = -ENODATA;
		}
		break;
	case (REG_MGR_OBJECT):
		if (drv_datap->mgr_object) {
			*pdwValue = (u32)drv_datap->mgr_object;
			status = DSP_SOK;
		} else {
			status = -ENODATA;
		}
		break;

	default:
		break;
	}
	if (DSP_FAILED(status)) {
		*pdwValue = 0;
		pr_err("%s: Failed, status 0x%x\n", __func__, status);
	}
	DBC_ENSURE((DSP_SUCCEEDED(status) && *pdwValue != 0) ||
		   (DSP_FAILED(status) && *pdwValue == 0));
	return status;
}
开发者ID:macroliu,项目名称:samsung_kernel_nowplus,代码行数:44,代码来源:cfg.c

示例6: dev_start_device

/*
 *  ======== dev_start_device ========
 *  Purpose:
 *      Initializes the new device with the BRIDGE environment.
 */
int dev_start_device(struct cfg_devnode *dev_node_obj)
{
	struct dev_object *hdev_obj = NULL;	/* handle to 'Bridge Device */
	/* wmd filename */
	char sz_wmd_file_name[CFG_MAXSEARCHPATHLEN] = "UMA";
	int status;
	struct mgr_object *hmgr_obj = NULL;

	DBC_REQUIRE(refs > 0);

		/* Given all resources, create a device object. */
		status =
	    dev_create_device(&hdev_obj, sz_wmd_file_name,
				      dev_node_obj);
		if (DSP_SUCCEEDED(status)) {
			/* Store away the hdev_obj with the DEVNODE */
			status =
			    cfg_set_dev_object(dev_node_obj, (u32) hdev_obj);
			if (DSP_FAILED(status)) {
				/* Clean up */
				dev_destroy_device(hdev_obj);
				hdev_obj = NULL;
			}
		}
	if (DSP_SUCCEEDED(status)) {
		/* Create the Manager Object */
		status = mgr_create(&hmgr_obj, dev_node_obj);
	}
	if (DSP_FAILED(status)) {
		if (hdev_obj)
			dev_destroy_device(hdev_obj);

		/* Ensure the device extension is NULL */
		cfg_set_dev_object(dev_node_obj, 0L);
	}

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

示例7: bridge_suspend

static int bridge_suspend(struct platform_device *pdev, pm_message_t state)
{
	u32 status;
	u32 command = PWR_EMERGENCYDEEPSLEEP;

	bridge_suspend_data.suspended = 1;
	status = PWR_SleepDSP(command, timeOut);
	if (DSP_FAILED(status)) {
		bridge_suspend_data.suspended = 0;
		return -1;
	}

	return 0;
}
开发者ID:dancing-leaves,项目名称:nst-linux-kernel,代码行数:14,代码来源:drv_interface.c

示例8: LDRV_freeLinkGppCfg

/** ============================================================================
 *  @func   LDRV_freeLinkCfg
 *
 *  @desc   Frees any memory allocated for the kernel-side APUDRV configuration
 *          structure.
 *
 *  @modif  None
 *  ============================================================================
 */
NORMAL_API
DSP_STATUS
LDRV_freeLinkGppCfg (IN  LINKCFG_Object *  knlLinkCfg)
{
    DSP_STATUS status    = DSP_SOK ;
    DSP_STATUS tmpStatus = DSP_SOK ;

    TRC_1ENTER ("LDRV_freeLinkGppCfg", knlLinkCfg) ;

    if (knlLinkCfg != NULL) {
        /*  --------------------------------------------------------------------
         *  Free memory allocated for the GPP object
         *  --------------------------------------------------------------------
         */
        if (knlLinkCfg->gppObject != NULL) {
            tmpStatus = FREE_PTR (knlLinkCfg->gppObject) ;
            if (DSP_FAILED (tmpStatus) && DSP_SUCCEEDED (status)) {
                status = tmpStatus ;
                SET_FAILURE_REASON ;
            }
        }

        /*  --------------------------------------------------------------------
         *  Free memory allocated for the global LINKCFG object.
         *  --------------------------------------------------------------------
         */
        tmpStatus = FREE_PTR (knlLinkCfg) ;
        if (DSP_FAILED (tmpStatus) && DSP_SUCCEEDED (status)) {
            status = tmpStatus ;
            SET_FAILURE_REASON ;
        }
    }

    TRC_1LEAVE ("LDRV_freeLinkGppCfg", status) ;

    return status ;
}
开发者ID:zp8001,项目名称:STUDY_4.0.3,代码行数:46,代码来源:ldrv_os.c

示例9: NODEWRAP_Connect

/*
 * ======== NODEWRAP_Connect ========
 */
u32 NODEWRAP_Connect(union Trapped_Args *args, void *pr_ctxt)
{
	DSP_STATUS status = DSP_SOK;
	struct DSP_STRMATTR attrs;
	struct DSP_STRMATTR *pAttrs = NULL;
	u32 cbDataSize;
	u32 __user *pSize = (u32 __user *)args->ARGS_NODE_CONNECT.pConnParam;
	u8 *pArgs = NULL;

	GT_0trace(WCD_debugMask, GT_ENTER, "NODEWRAP_Connect: entered\n");

	/* Optional argument */
	if (pSize) {
		if (get_user(cbDataSize, pSize))
			status = DSP_EFAIL;

		cbDataSize += sizeof(u32);
		if (DSP_SUCCEEDED(status)) {
			pArgs = MEM_Alloc(cbDataSize, MEM_NONPAGED);
			if (pArgs == NULL) {
				status = DSP_EMEMORY;
				goto func_cont;
			}

		}
		cp_fm_usr(pArgs, args->ARGS_NODE_CONNECT.pConnParam, status,
			 cbDataSize);
		if (DSP_FAILED(status))
			goto func_cont;
	}
	if (args->ARGS_NODE_CONNECT.pAttrs) {	/* Optional argument */
		cp_fm_usr(&attrs, args->ARGS_NODE_CONNECT.pAttrs, status, 1);
		if (DSP_SUCCEEDED(status))
			pAttrs = &attrs;

	}
	if (DSP_SUCCEEDED(status)) {
		status = NODE_Connect(args->ARGS_NODE_CONNECT.hNode,
				     args->ARGS_NODE_CONNECT.uStream,
				     args->ARGS_NODE_CONNECT.hOtherNode,
				     args->ARGS_NODE_CONNECT.uOtherStream,
				     pAttrs, (struct DSP_CBDATA *)pArgs);
	}
func_cont:
	if (pArgs)
		MEM_Free(pArgs);

	return status;
}
开发者ID:MuMu360121,项目名称:jordan-kernel,代码行数:52,代码来源:wcd.c

示例10: WCD_InitComplete2

/*
 *  ======== WCD_InitComplete2 ========
 *  Purpose:
 *      Perform any required WCD, and WMD initialization which
 *      cannot not be performed in WCD_Init() or DEV_StartDevice() due
 *      to the fact that some services are not yet
 *      completely initialized.
 *  Parameters:
 *  Returns:
 *      DSP_SOK:	Allow this device to load
 *      DSP_EFAIL:      Failure.
 *  Requires:
 *      WCD initialized.
 *  Ensures:
 */
DSP_STATUS WCD_InitComplete2(void)
{
	DSP_STATUS status = DSP_SOK;
	struct CFG_DEVNODE *DevNode;
	struct DEV_OBJECT *hDevObject;
	u32 devType;

	DBC_Require(WCD_cRefs > 0);
	GT_0trace(WCD_debugMask, GT_ENTER, "Entered WCD_InitComplete\n");
	 /*  Walk the list of DevObjects, get each devnode, and attempting to
	 *  autostart the board. Note that this requires COF loading, which
	 *  requires KFILE.  */
	for (hDevObject = DEV_GetFirst(); hDevObject != NULL;
	     hDevObject = DEV_GetNext(hDevObject)) {
		if (DSP_FAILED(DEV_GetDevNode(hDevObject, &DevNode)))
			continue;

		if (DSP_FAILED(DEV_GetDevType(hDevObject, &devType)))
			continue;

		if ((devType == DSP_UNIT) || (devType == IVA_UNIT)) {
			if (DSP_FAILED(PROC_AutoStart(DevNode, hDevObject))) {
				GT_0trace(WCD_debugMask, GT_1CLASS,
					 "WCD_InitComplete2 Failed\n");
				status = DSP_EFAIL;
				/* break; */
			}
		} else
			GT_1trace(WCD_debugMask, GT_ENTER,
				 "Ignoring PROC_AutoStart "
				 "for Device Type = 0x%x \n", devType);
	}			/* End For Loop */
	GT_1trace(WCD_debugMask, GT_ENTER,
		 "Exiting WCD_InitComplete status 0x%x\n", status);
	return status;
}
开发者ID:MuMu360121,项目名称:jordan-kernel,代码行数:51,代码来源:wcd.c

示例11: MGR_Create

/*
 *  ========= MGR_Create =========
 *  Purpose:
 *      MGR Object gets created only once during driver Loading.
 */
DSP_STATUS MGR_Create(OUT struct MGR_OBJECT **phMgrObject,
		     struct CFG_DEVNODE *hDevNode)
{
	DSP_STATUS status = DSP_SOK;
	struct MGR_OBJECT *pMgrObject = NULL;

	DBC_Require(phMgrObject != NULL);
	DBC_Require(cRefs > 0);
	GT_1trace(MGR_DebugMask, GT_ENTER,
		 "Entering MGR_Create phMgrObject 0x%x\n ",
		 phMgrObject);
	MEM_AllocObject(pMgrObject, struct MGR_OBJECT, SIGNATURE);
	if (pMgrObject) {
		if (DSP_SUCCEEDED(DCD_CreateManager(ZLDLLNAME,
		   &pMgrObject->hDcdMgr))) {
			/* If succeeded store the handle in the MGR Object */
			if (DSP_SUCCEEDED(CFG_SetObject((u32)pMgrObject,
			   REG_MGR_OBJECT))) {
				*phMgrObject = pMgrObject;
				GT_0trace(MGR_DebugMask, GT_1CLASS,
					 "MGR_Create:MGR Created\r\n");
			} else {
				status = DSP_EFAIL;
				GT_0trace(MGR_DebugMask, GT_7CLASS,
					 "MGR_Create:CFG_SetObject "
					 "Failed\r\n");
				DCD_DestroyManager(pMgrObject->hDcdMgr);
				MEM_FreeObject(pMgrObject);
			}
		} else {
			/* failed to Create DCD Manager */
			status = DSP_EFAIL;
			GT_0trace(MGR_DebugMask, GT_7CLASS,
				 "MGR_Create:DCD_ManagerCreate Failed\r\n");
			MEM_FreeObject(pMgrObject);
		}
	} else {
		status = DSP_EMEMORY;
		GT_0trace(MGR_DebugMask, GT_7CLASS,
			 "MGR_Create DSP_FAILED to allocate memory \n");
	}
	GT_2trace(MGR_DebugMask, GT_ENTER,
		 "Exiting MGR_Create: phMgrObject: 0x%x\t"
		 "status: 0x%x\n", phMgrObject, status);
	DBC_Ensure(DSP_FAILED(status) ||
		  MEM_IsValidHandle(pMgrObject, SIGNATURE));
	return status;
}
开发者ID:MuMu360121,项目名称:jordan-kernel,代码行数:53,代码来源:mgr.c

示例12: dev_set_chnl_mgr

/*
 *  ======== dev_set_chnl_mgr ========
 *  Purpose:
 *      Set the channel manager for this device.
 */
int dev_set_chnl_mgr(struct dev_object *hdev_obj,
			    struct chnl_mgr *hmgr)
{
	int status = 0;
	struct dev_object *dev_obj = hdev_obj;

	DBC_REQUIRE(refs > 0);

	if (hdev_obj)
		dev_obj->hchnl_mgr = hmgr;
	else
		status = -EFAULT;

	DBC_ENSURE(DSP_FAILED(status) || (dev_obj->hchnl_mgr == hmgr));
	return status;
}
开发者ID:AdiPat,项目名称:i9003_Kernel,代码行数:21,代码来源:dev.c

示例13: omap34_xx_bridge_remove

static int __devexit omap34_xx_bridge_remove(struct platform_device *pdev)
{
	dev_t devno;
	bool ret;
	int status = 0;
	bhandle hdrv_obj = NULL;

	status = cfg_get_object((u32 *) &hdrv_obj, REG_DRV_OBJECT);
	if (DSP_FAILED(status))
		goto func_cont;

#ifdef CONFIG_BRIDGE_DVFS
	if (cpufreq_unregister_notifier(&iva_clk_notifier,
					CPUFREQ_TRANSITION_NOTIFIER))
		pr_err("%s: clk_notifier_unregister failed for iva2_ck\n",
		       __func__);
#endif /* #ifdef CONFIG_BRIDGE_DVFS */

	if (driver_context) {
		/* Put the DSP in reset state */
		ret = dsp_deinit(driver_context);
		driver_context = 0;
		DBC_ASSERT(ret == true);
	}
#ifdef CONFIG_BRIDGE_DVFS
	clk_put(clk_handle);
	clk_handle = NULL;
#endif /* #ifdef CONFIG_BRIDGE_DVFS */

func_cont:
	mem_ext_phys_pool_release();

	services_exit();

	bridge_destroy_sysfs();

	devno = MKDEV(driver_major, 0);
	cdev_del(&bridge_cdev);
	unregister_chrdev_region(devno, 1);
	if (bridge_class) {
		/* remove the device from sysfs */
		device_destroy(bridge_class, MKDEV(driver_major, 0));
		class_destroy(bridge_class);

	}
	return 0;
}
开发者ID:Loki154,项目名称:Android-kernel-for-kindle-fire,代码行数:47,代码来源:drv_interface.c

示例14: STRM_Create

/*
 *  ======== STRM_Create ========
 *  Purpose:
 *      Create a STRM manager object.
 */
DSP_STATUS STRM_Create(OUT struct STRM_MGR **phStrmMgr, struct DEV_OBJECT *hDev)
{
	struct STRM_MGR *pStrmMgr;
	DSP_STATUS status = DSP_SOK;

	DBC_Require(cRefs > 0);
	DBC_Require(phStrmMgr != NULL);
	DBC_Require(hDev != NULL);

	GT_2trace(STRM_debugMask, GT_ENTER, "STRM_Create: phStrmMgr: "
		 "0x%x\thDev: 0x%x\n", phStrmMgr, hDev);
	*phStrmMgr = NULL;
	/* Allocate STRM manager object */
	MEM_AllocObject(pStrmMgr, struct STRM_MGR, STRMMGR_SIGNATURE);
	if (pStrmMgr == NULL) {
		status = DSP_EMEMORY;
		GT_0trace(STRM_debugMask, GT_6CLASS, "STRM_Create: "
			 "MEM_AllocObject() failed!\n ");
	} else {
		pStrmMgr->hDev = hDev;
	}
	/* Get Channel manager and WMD function interface */
	if (DSP_SUCCEEDED(status)) {
		status = DEV_GetChnlMgr(hDev, &(pStrmMgr->hChnlMgr));
		if (DSP_SUCCEEDED(status)) {
			(void) DEV_GetIntfFxns(hDev, &(pStrmMgr->pIntfFxns));
			DBC_Assert(pStrmMgr->pIntfFxns != NULL);
		} else {
			GT_1trace(STRM_debugMask, GT_6CLASS, "STRM_Create: "
				 "Failed to get channel manager! status = "
				 "0x%x\n", status);
		}
	}
	if (DSP_SUCCEEDED(status))
		status = SYNC_InitializeCS(&pStrmMgr->hSync);

	if (DSP_SUCCEEDED(status))
		*phStrmMgr = pStrmMgr;
	else
		DeleteStrmMgr(pStrmMgr);

	DBC_Ensure(DSP_SUCCEEDED(status) &&
		  (MEM_IsValidHandle((*phStrmMgr), STRMMGR_SIGNATURE) ||
		  (DSP_FAILED(status) && *phStrmMgr == NULL)));

	return status;
}
开发者ID:Racing1,项目名称:zeppelin_kernel,代码行数:52,代码来源:strm.c

示例15: __cp_to_usr

static inline void __cp_to_usr(void __user *to, const void *from,
			       DSP_STATUS *err, unsigned long bytes)
{
	if (DSP_FAILED(*err))
		return;

	if (unlikely(!to)) {
		*err = DSP_EPOINTER;
		return;
	}

	if (unlikely(copy_to_user(to, from, bytes))) {
		GT_2trace(WCD_debugMask, GT_7CLASS,
			  "%s failed, to=0x%08x\n", __func__, to);
		*err = DSP_EPOINTER;
	}
}
开发者ID:MuMu360121,项目名称:jordan-kernel,代码行数:17,代码来源:wcd.c


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