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


C++ DSP_SUCCEEDED函数代码示例

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


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

示例1: MEM_Calloc

/** ============================================================================
 *  @func   MEM_Calloc
 *
 *  @desc   Allocates the specified number of bytes and memory is set to zero.
 *
 *  @modif  None
 *  ============================================================================
 */
EXPORT_API
DSP_STATUS
MEM_Calloc (OUT Void ** ptr, IN Uint32 cBytes, IN OUT Pvoid arg)
{
    DSP_STATUS status = DSP_SOK ;
    Uint32       i                ;

    TRC_3ENTER ("MEM_Calloc", ptr, cBytes, arg) ;

    DBC_Require (ptr != NULL) ;
    DBC_Require (MEM_IsInitialized == TRUE) ;
    DBC_Require (cBytes != 0) ;

    status = MEM_Alloc (ptr, cBytes, arg) ;

    if (DSP_SUCCEEDED (status)) {
        for (i = 0 ; i < cBytes ; i++) {
            (*(Uint8 **) ptr)[i] = 0 ;
        }
    }

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

    TRC_1LEAVE ("MEM_Calloc", status) ;

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

示例2: NTFY_Create

/*
 *  ======== NTFY_Create ========
 *  Purpose:
 *      Create an empty list of notifications.
 */
DSP_STATUS NTFY_Create(struct NTFY_OBJECT **phNtfy)
{
	struct NTFY_OBJECT *pNtfy;
	DSP_STATUS status = DSP_SOK;

	DBC_Require(phNtfy != NULL);

	*phNtfy = NULL;
	MEM_AllocObject(pNtfy, struct NTFY_OBJECT, NTFY_SIGNATURE);

	if (pNtfy) {

		status = SYNC_InitializeDPCCS(&pNtfy->hSync);
		if (DSP_SUCCEEDED(status)) {
			pNtfy->notifyList = MEM_Calloc(sizeof(struct LST_LIST),
							MEM_NONPAGED);
			if (pNtfy->notifyList == NULL) {
				(void) SYNC_DeleteCS(pNtfy->hSync);
				MEM_FreeObject(pNtfy);
				status = DSP_EMEMORY;
			} else {
				INIT_LIST_HEAD(&pNtfy->notifyList->head);
				*phNtfy = pNtfy;
			}
		}
	} else {
		status = DSP_EMEMORY;
	}

	DBC_Ensure((DSP_FAILED(status) && *phNtfy == NULL) ||
		  (DSP_SUCCEEDED(status) && MEM_IsValidHandle((*phNtfy),
		  NTFY_SIGNATURE)));

	return status;
}
开发者ID:ka6sox,项目名称:nook_kernel,代码行数:40,代码来源:ntfy.c

示例3: STRM_RegisterNotify

/*
 *  ======== STRM_RegisterNotify ========
 *  Purpose:
 *      Register to be notified on specific events for this stream.
 */
DSP_STATUS STRM_RegisterNotify(struct STRM_OBJECT *hStrm, u32 uEventMask,
			      u32 uNotifyType, struct DSP_NOTIFICATION
			      *hNotification)
{
	struct WMD_DRV_INTERFACE *pIntfFxns;
	DSP_STATUS status = DSP_SOK;

	DBC_Require(cRefs > 0);
	DBC_Require(hNotification != NULL);


	if ((uEventMask & ~((DSP_STREAMIOCOMPLETION) |
		 DSP_STREAMDONE)) != 0) {
		status = DSP_EVALUE;
	} else {
		if (uNotifyType != DSP_SIGNALEVENT)
			status = DSP_ENOTIMPL;

	}
	if (DSP_SUCCEEDED(status)) {
		pIntfFxns = hStrm->hStrmMgr->pIntfFxns;

		status = (*pIntfFxns->pfnChnlRegisterNotify)(hStrm->hChnl,
			 uEventMask, uNotifyType, hNotification);
	}
	/* ensure we return a documented return code */
	DBC_Ensure(DSP_SUCCEEDED(status) || status == DSP_EHANDLE ||
		  status == DSP_ETIMEOUT || status == DSP_ETRANSLATE ||
		  status == DSP_ENOTIMPL || status == DSP_EFAIL);
	return status;
}
开发者ID:dancing-leaves,项目名称:nst-linux-kernel,代码行数:36,代码来源:strm.c

示例4: DataStructuresTest

void DataStructuresTest (void)
{
	printf("\n****************************\n");
	printf("*** QOS Test version 1.0 ***\n");
	printf("****************************\n");

	printf
	    ("\n*** TEST CASE 1: Creating and Deleting data structures ***\n");
	printf("Calling data create...");
	data = DSPData_Create(QOSDataType_Memory_DynAlloc);
	if (data) {
		printf("SUCCESS\n");
		printf("Calling data delete...");
		status = DSPData_Delete(data);
		if (DSP_SUCCEEDED(status))
			printf("SUCCESS\n");
		else
			printf("FAILED\n");
	} else
		printf("FAILED\n");

	if (data && DSP_SUCCEEDED(status)) {
		printf("\nPASSED: data structures can be created and deleted\n");
		NumTestsPassed++;
		NumRegistryTestsPassed++;
	} else
		printf("\nFAILED: failed to create and delete data structures\n");
}
开发者ID:OpenUAS,项目名称:userspace-dspbridge,代码行数:28,代码来源:qostest.c

示例5: MGRWRAP_WaitForBridgeEvents

/*
 * ======== MGRWRAP_WaitForBridgeEvents ========
 */
u32 MGRWRAP_WaitForBridgeEvents(union Trapped_Args *args, void *pr_ctxt)
{
	DSP_STATUS status = DSP_SOK;
	struct DSP_NOTIFICATION *aNotifications[MAX_EVENTS];
	struct DSP_NOTIFICATION notifications[MAX_EVENTS];
	u32 uIndex, i;
	u32 uCount = args->ARGS_MGR_WAIT.uCount;

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

	if (uCount > MAX_EVENTS)
		status = DSP_EINVALIDARG;

	/* get the array of pointers to user structures */
	cp_fm_usr(aNotifications, args->ARGS_MGR_WAIT.aNotifications,
	 status, uCount);
	/* get the events */
	for (i = 0; i < uCount; i++) {
		cp_fm_usr(&notifications[i], aNotifications[i], status, 1);
		if (DSP_SUCCEEDED(status)) {
			/* set the array of pointers to kernel structures*/
			aNotifications[i] = &notifications[i];
		}
	}
	if (DSP_SUCCEEDED(status)) {
		status = MGR_WaitForBridgeEvents(aNotifications, uCount,
			 &uIndex, args->ARGS_MGR_WAIT.uTimeout);
	}
	cp_to_usr(args->ARGS_MGR_WAIT.puIndex, &uIndex, status, 1);
	return status;
}
开发者ID:MuMu360121,项目名称:jordan-kernel,代码行数:35,代码来源:wcd.c

示例6: DSP_Delete

/** ============================================================================
 *  @func   DSP_Delete
 *
 *  @desc   This function releases resources allocated earlier by call to
 *          DSP_Create ().
 *          During cleanup, the allocated resources are being freed
 *          unconditionally. Actual applications may require stricter check
 *          against return values for robustness.
 *
 *  @modif  LOOP_Buffers
 *  ============================================================================
 */
NORMAL_API
Void
DSP_Delete (Uint8 processorId)
{
    DSP_STATUS status    = DSP_SOK ;
    DSP_STATUS tmpStatus = DSP_SOK ;

    LOOP_0Print ("Entered DSP_Delete ()\n") ;

    status = PROC_stop (processorId) ;

    tmpStatus = POOL_close (POOL_makePoolId(processorId, 0)) ;
    if (DSP_SUCCEEDED (status) && DSP_FAILED (tmpStatus)) {
        LOOP_1Print ("POOL_close () failed. Status = [0x%x]\n",
                        tmpStatus) ;
    }

    tmpStatus = PROC_detach  (processorId) ;
    if (DSP_SUCCEEDED (status) && DSP_FAILED (tmpStatus)) {
        LOOP_1Print ("PROC_detach () failed. Status = [0x%x]\n", tmpStatus) ;
    }

    tmpStatus = PROC_destroy () ;
    if (DSP_SUCCEEDED (status) && DSP_FAILED (tmpStatus)) {
        LOOP_1Print ("PROC_destroy () failed. Status = [0x%x]\n", tmpStatus) ;
    }

    LOOP_0Print ("Leaving DSP_Delete ()\n") ;
}
开发者ID:b7500af1,项目名称:e1xx_DSP,代码行数:41,代码来源:loop.c

示例7: LDRV_init

/** ============================================================================
 *  @func   LDRV_init
 *
 *  @desc   Allocates resources and initializes the LDRV component for a DSP.
 *
 *  @modif  None
 *  ============================================================================
 */
EXPORT_API
DSP_STATUS
LDRV_init (IN ProcessorId procId, IN LINKCFG_DspConfig * dspCfg)
{
    DSP_STATUS  status  = DSP_SOK ;
    Char8 *     dspName = NULL    ;

    TRC_2ENTER ("LDRV_init", procId, dspCfg) ;

    DBC_Require (LDRV_LinkCfgPtr != NULL) ;
    DBC_Require (IS_VALID_PROCID (procId)) ;

    /*  ------------------------------------------------------------------------
     *  Get the pointer to kernel-side APUDRV configuration structure.
     *  ------------------------------------------------------------------------
     */
    if (dspCfg != NULL) {
        if (LDRV_LinkCfgPtr->dspConfigs [procId] != NULL) {
            /* First free the previously read config values */
            status = LDRV_freeLinkDspCfg (procId, LDRV_LinkCfgPtr) ;
            if (DSP_FAILED (status)) {
                SET_FAILURE_REASON ;
            }
        }

        if (DSP_SUCCEEDED (status)) {
            status = LDRV_getLinkDspCfg (procId, dspCfg, LDRV_LinkCfgPtr) ;
            if (DSP_FAILED (status)) {
                SET_FAILURE_REASON ;
                LDRV_exit (procId) ;
            }
        }
    }
    else {
        if (LDRV_LinkCfgPtr->dspConfigs [procId] == NULL) {
            PRINT_Printf ("For multi-app support, Please pass valid DSP") ;
            PRINT_Printf ("Config values through PROC_attach.\n") ;
            status = DSP_ECONFIG ;
            SET_FAILURE_REASON ;
        }
    }

    /*  ------------------------------------------------------------------------
     *  Plug the correct configuration mapping information for APU DRIVER.
     *  ------------------------------------------------------------------------
     */
    if (DSP_SUCCEEDED (status)) {
        dspName = LDRV_LinkCfgPtr->dspConfigs [procId]->dspObject->name ;
        status = CFGMAP_attachObject (procId, dspName) ;
        if (DSP_FAILED (status)) {
            SET_FAILURE_REASON ;
            LDRV_exit (procId) ;
        }
    }

    TRC_1LEAVE ("LDRV_init", status) ;

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

示例8: cmm_create

/*
 *  ======== cmm_create ========
 *  Purpose:
 *      Create a communication memory manager object.
 */
int cmm_create(OUT struct cmm_object **ph_cmm_mgr,
		      struct dev_object *hdev_obj,
		      IN CONST struct cmm_mgrattrs *pMgrAttrs)
{
	struct cmm_object *cmm_obj = NULL;
	int status = 0;
	struct util_sysinfo sys_info;

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

	*ph_cmm_mgr = NULL;
	/* create, zero, and tag a cmm mgr object */
	cmm_obj = kzalloc(sizeof(struct cmm_object), GFP_KERNEL);
	if (cmm_obj != NULL) {
		if (pMgrAttrs == NULL)
			pMgrAttrs = &cmm_dfltmgrattrs;	/* set defaults */

		/* 4 bytes minimum */
		DBC_ASSERT(pMgrAttrs->ul_min_block_size >= 4);
		/* save away smallest block allocation for this cmm mgr */
		cmm_obj->ul_min_block_size = pMgrAttrs->ul_min_block_size;
		/* save away the systems memory page size */
		sys_info.dw_page_size = PAGE_SIZE;
		sys_info.dw_allocation_granularity = PAGE_SIZE;
		sys_info.dw_number_of_processors = 1;
		if (DSP_SUCCEEDED(status)) {
			cmm_obj->dw_page_size = sys_info.dw_page_size;
		} else {
			cmm_obj->dw_page_size = 0;
			status = -EPERM;
		}
		/* Note: DSP SM seg table(aDSPSMSegTab[]) zero'd by
		 * MEM_ALLOC_OBJECT */
		if (DSP_SUCCEEDED(status)) {
			/* create node free list */
			cmm_obj->node_free_list_head =
					kzalloc(sizeof(struct lst_list),
							GFP_KERNEL);
			if (cmm_obj->node_free_list_head == NULL)
				status = -ENOMEM;
			else
				INIT_LIST_HEAD(&cmm_obj->
					       node_free_list_head->head);
		}
		if (DSP_SUCCEEDED(status))
			mutex_init(&cmm_obj->cmm_lock);

		if (DSP_SUCCEEDED(status))
			*ph_cmm_mgr = cmm_obj;
		else
			cmm_destroy(cmm_obj, true);

	} else {
		status = -ENOMEM;
	}
	return status;
}
开发者ID:AdiPat,项目名称:i9003_Kernel,代码行数:63,代码来源:cmm.c

示例9: LIST_SearchElement

/** ============================================================================
 *  @func   LIST_SearchElement
 *
 *  @desc   This function searchs for a element in the List.
 *
 *  @modif  None.
 *  ============================================================================
 */
EXPORT_API
DSP_STATUS
LIST_SearchElement (IN  List *         list,
                    IN  Pvoid          data,
                    OUT ListElement ** elem,
                    IN  ListMatchFunc  matchFunc)
{
    DSP_STATUS          status = DSP_SOK ;
    ListElement *       temp   = NULL    ;
    ListElement *       temp1  = NULL    ;
    Bool                found  = FALSE   ;

    DBC_Require (list != NULL) ;
    DBC_Require (elem != NULL) ;
    DBC_Require (matchFunc != NULL) ;

    if ((list == NULL) || (elem == NULL)) {
        status = DSP_EINVALIDARG ;
        SET_FAILURE_REASON ;
    }
    else {
        if (LIST_IsEmpty (list)) {
            status = DSP_EINVALIDARG ;
            SET_FAILURE_REASON ;
        }

        if (DSP_SUCCEEDED (status)) {
            status = LIST_First (list, &temp) ;
            if (DSP_SUCCEEDED (status)) {
                while ((found == FALSE) && (temp != NULL)) {
                    if ((*matchFunc) (temp, data) == TRUE) {
                        found = TRUE ;
                    }
                    else {
                        temp1 = temp ;
                        LIST_Next (list, temp1, &temp) ;
                    }
                }

                if (found == TRUE) {
                    *elem = temp ;
                }
                else {
                    *elem = NULL ;
                    status = DSP_ENOTFOUND ;
                    SET_FAILURE_REASON ;
                }
            }
            else {
                SET_FAILURE_REASON ;
            }
        }
    }

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

示例10: STRM_FreeBuffer

/*
 *  ======== STRM_FreeBuffer ========
 *  Purpose:
 *      Frees the buffers allocated for a stream.
 */
DSP_STATUS STRM_FreeBuffer(struct STRM_OBJECT *hStrm, u8 **apBuffer,
			  u32 uNumBufs)
{
	DSP_STATUS status = DSP_SOK;
	u32 i = 0;

	#ifndef RES_CLEANUP_DISABLE
	DSP_STATUS res_status = DSP_SOK;
       u32                  hProcess;
	HANDLE	     pCtxt = NULL;
	HANDLE	     hDrvObject;
	HANDLE 		    hSTRMRes = NULL;
	#endif
	DBC_Require(cRefs > 0);
	DBC_Require(apBuffer != NULL);

	GT_3trace(STRM_debugMask, GT_ENTER, "STRM_FreeBuffer: hStrm: 0x%x\t"
		 "apBuffer: 0x%x\tuNumBufs: 0x%x\n", hStrm, apBuffer, uNumBufs);

	if (!MEM_IsValidHandle(hStrm, STRM_SIGNATURE))
		status = DSP_EHANDLE;

	if (DSP_SUCCEEDED(status)) {
		for (i = 0; i < uNumBufs; i++) {
			DBC_Assert(hStrm->hXlator != NULL);
			status = CMM_XlatorFreeBuf(hStrm->hXlator, apBuffer[i]);
			if (DSP_FAILED(status)) {
				GT_0trace(STRM_debugMask, GT_7CLASS,
					 "STRM_FreeBuffer: DSP_FAILED"
					 " to free shared memory.\n");
				break;
			}
			apBuffer[i] = NULL;
		}
	}
#ifndef RES_CLEANUP_DISABLE
	/* Update the node and stream resource status */
       /* Return PID instead of process handle */
       hProcess = current->pid;

	res_status = CFG_GetObject((u32 *)&hDrvObject, REG_DRV_OBJECT);
	if (DSP_SUCCEEDED(res_status)) {
               DRV_GetProcContext(hProcess,
				 (struct DRV_OBJECT *)hDrvObject, &pCtxt,
				 NULL, 0);
		if (pCtxt != NULL) {
			if (DRV_GetSTRMResElement(hStrm, hSTRMRes, pCtxt) !=
			   DSP_ENOTFOUND) {
				DRV_ProcUpdateSTRMRes(uNumBufs-i, hSTRMRes,
						     pCtxt);
			}
		}
	}
#endif
	return status;
}
开发者ID:Racing1,项目名称:zeppelin_kernel,代码行数:61,代码来源:strm.c

示例11: dbll_get_sect

/*
 *  ======== dbll_get_sect ========
 *  Get the base address and size (in bytes) of a COFF section.
 */
int dbll_get_sect(struct dbll_library_obj *lib, char *name, u32 *paddr,
			 u32 *psize)
{
	u32 byte_size;
	bool opened_doff = false;
	const struct ldr_section_info *sect = NULL;
	struct dbll_library_obj *zl_lib = (struct dbll_library_obj *)lib;
	int status = 0;

	DBC_REQUIRE(refs > 0);
	DBC_REQUIRE(name != NULL);
	DBC_REQUIRE(paddr != NULL);
	DBC_REQUIRE(psize != NULL);
	DBC_REQUIRE(zl_lib);

	/* If DOFF file is not open, we open it. */
	if (zl_lib != NULL) {
		if (zl_lib->fp == NULL) {
			status = dof_open(zl_lib);
			if (DSP_SUCCEEDED(status))
				opened_doff = true;

		} else {
			(*(zl_lib->target_obj->attrs.fseek)) (zl_lib->fp,
							      zl_lib->ul_pos,
							      SEEK_SET);
		}
	} else {
		status = -EFAULT;
	}
	if (DSP_SUCCEEDED(status)) {
		byte_size = 1;
		if (dload_get_section_info(zl_lib->desc, name, &sect)) {
			*paddr = sect->load_addr;
			*psize = sect->size * byte_size;
			/* Make sure size is even for good swap */
			if (*psize % 2)
				(*psize)++;

			/* Align size */
			*psize = DOFF_ALIGN(*psize);
		} else {
			status = -ENXIO;
		}
	}
	if (opened_doff) {
		dof_close(zl_lib);
		opened_doff = false;
	}

	dev_dbg(bridge, "%s: lib: %p name: %s paddr: %p psize: %p, "
		"status %i\n", __func__, lib, name, paddr, psize, status);

	return status;
}
开发者ID:kpykc,项目名称:ARDrone2.0,代码行数:59,代码来源:dbll.c

示例12: chnl_create

/*
 *  ======== chnl_create ========
 *  Purpose:
 *      Create a channel manager object, responsible for opening new channels
 *      and closing old ones for a given 'Bridge board.
 */
int chnl_create(OUT struct chnl_mgr **phChnlMgr,
		       struct dev_object *hdev_obj,
		       IN CONST struct chnl_mgrattrs *pMgrAttrs)
{
	int status;
	struct chnl_mgr *hchnl_mgr;
	struct chnl_mgr_ *chnl_mgr_obj = NULL;

	DBC_REQUIRE(refs > 0);
	DBC_REQUIRE(phChnlMgr != NULL);
	DBC_REQUIRE(pMgrAttrs != NULL);

	*phChnlMgr = NULL;

	/* Validate args: */
	if ((0 < pMgrAttrs->max_channels) &&
	    (pMgrAttrs->max_channels <= CHNL_MAXCHANNELS))
		status = 0;
	else if (pMgrAttrs->max_channels == 0)
		status = -EINVAL;
	else
		status = -ECHRNG;

	if (pMgrAttrs->word_size == 0)
		status = -EINVAL;

	if (DSP_SUCCEEDED(status)) {
		status = dev_get_chnl_mgr(hdev_obj, &hchnl_mgr);
		if (DSP_SUCCEEDED(status) && hchnl_mgr != NULL)
			status = -EEXIST;

	}

	if (DSP_SUCCEEDED(status)) {
		struct bridge_drv_interface *intf_fxns;
		dev_get_intf_fxns(hdev_obj, &intf_fxns);
		if (intf_fxns) {
			/* Let WMD channel module finish the create */
			status = (*intf_fxns->pfn_chnl_create)(&hchnl_mgr,
						hdev_obj, pMgrAttrs);
		}
		if (DSP_SUCCEEDED(status)) {
			/* Fill in WCD channel module's fields of the
			 * chnl_mgr structure */
			chnl_mgr_obj = (struct chnl_mgr_ *)hchnl_mgr;
			chnl_mgr_obj->intf_fxns = intf_fxns;
			/* Finally, return the new channel manager handle: */
			*phChnlMgr = hchnl_mgr;
		}
	}

	DBC_ENSURE(DSP_FAILED(status) || chnl_mgr_obj);

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

示例13: DBLL_getSect

/*
 *  ======== DBLL_getSect ========
 *  Get the base address and size (in bytes) of a COFF section.
 */
DSP_STATUS DBLL_getSect(struct DBLL_LibraryObj *lib, char *name, u32 *pAddr,
			u32 *pSize)
{
	u32 uByteSize;
	bool fOpenedDoff = false;
	const struct LDR_SECTION_INFO *sect = NULL;
	struct DBLL_LibraryObj *zlLib = (struct DBLL_LibraryObj *)lib;
	DSP_STATUS status = DSP_SOK;

	DBC_Require(cRefs > 0);
	DBC_Require(name != NULL);
	DBC_Require(pAddr != NULL);
	DBC_Require(pSize != NULL);
	DBC_Require(MEM_IsValidHandle(zlLib, DBLL_LIBSIGNATURE));

	GT_4trace(DBLL_debugMask, GT_ENTER,
		 "DBLL_getSect: lib: 0x%x name: %s pAddr:"
		 " 0x%x pSize: 0x%x\n", lib, name, pAddr, pSize);
	/* If DOFF file is not open, we open it. */
	if (zlLib != NULL) {
		if (zlLib->fp == NULL) {
			status = dofOpen(zlLib);
			if (DSP_SUCCEEDED(status))
				fOpenedDoff = true;

		} else {
			(*(zlLib->pTarget->attrs.fseek))(zlLib->fp,
			 zlLib->ulPos, SEEK_SET);
		}
	} else {
		status = DSP_EHANDLE;
	}
	if (DSP_SUCCEEDED(status)) {
		uByteSize = 1;
		if (DLOAD_GetSectionInfo(zlLib->desc, name, &sect)) {
			*pAddr = sect->load_addr;
			*pSize = sect->size * uByteSize;
			/* Make sure size is even for good swap */
			if (*pSize % 2)
				(*pSize)++;

			/* Align size */
			*pSize = DOFF_ALIGN(*pSize);
		} else {
			status = DSP_ENOSECT;
		}
	}
	if (fOpenedDoff) {
		dofClose(zlLib);
		fOpenedDoff = false;
	}

	return status;
}
开发者ID:StarKissed,项目名称:android_kernel_omap,代码行数:58,代码来源:dbll.c

示例14: cmm_destroy

/*
 *  ======== cmm_destroy ========
 *  Purpose:
 *      Release the communication memory manager resources.
 */
int cmm_destroy(struct cmm_object *hcmm_mgr, bool bForce)
{
	struct cmm_object *cmm_mgr_obj = (struct cmm_object *)hcmm_mgr;
	struct cmm_info temp_info;
	int status = 0;
	s32 slot_seg;
	struct cmm_mnode *pnode;

	DBC_REQUIRE(refs > 0);
	if (!hcmm_mgr) {
		status = -EFAULT;
		return status;
	}
	mutex_lock(&cmm_mgr_obj->cmm_lock);
	/* If not force then fail if outstanding allocations exist */
	if (!bForce) {
		/* Check for outstanding memory allocations */
		status = cmm_get_info(hcmm_mgr, &temp_info);
		if (DSP_SUCCEEDED(status)) {
			if (temp_info.ul_total_in_use_cnt > 0) {
				/* outstanding allocations */
				status = -EPERM;
			}
		}
	}
	if (DSP_SUCCEEDED(status)) {
		/* UnRegister SM allocator */
		for (slot_seg = 0; slot_seg < CMM_MAXGPPSEGS; slot_seg++) {
			if (cmm_mgr_obj->pa_gppsm_seg_tab[slot_seg] != NULL) {
				un_register_gppsm_seg
				    (cmm_mgr_obj->pa_gppsm_seg_tab[slot_seg]);
				/* Set slot to NULL for future reuse */
				cmm_mgr_obj->pa_gppsm_seg_tab[slot_seg] = NULL;
			}
		}
	}
	if (cmm_mgr_obj->node_free_list_head != NULL) {
		/* Free the free nodes */
		while (!LST_IS_EMPTY(cmm_mgr_obj->node_free_list_head)) {
			pnode = (struct cmm_mnode *)
			    lst_get_head(cmm_mgr_obj->node_free_list_head);
			kfree(pnode);
		}
		/* delete NodeFreeList list */
		kfree(cmm_mgr_obj->node_free_list_head);
	}
	mutex_unlock(&cmm_mgr_obj->cmm_lock);
	if (DSP_SUCCEEDED(status)) {
		/* delete CS & cmm mgr object */
		mutex_destroy(&cmm_mgr_obj->cmm_lock);
		kfree(cmm_mgr_obj);
	}
	return status;
}
开发者ID:AdiPat,项目名称:i9003_Kernel,代码行数:59,代码来源:cmm.c

示例15: 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


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