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


C++ DBC_Require函数代码示例

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


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

示例1: MGR_Destroy

/*
 *  ========= MGR_Destroy =========
 *     This function is invoked during bridge driver unloading.Frees MGR object.
 */
DSP_STATUS MGR_Destroy(struct MGR_OBJECT *hMgrObject)
{
	DSP_STATUS status = DSP_SOK;
	struct MGR_OBJECT *pMgrObject = (struct MGR_OBJECT *)hMgrObject;

	DBC_Require(cRefs > 0);
	DBC_Require(MEM_IsValidHandle(hMgrObject, SIGNATURE));

	GT_1trace(MGR_DebugMask, GT_ENTER,
		 "Entering MGR_Destroy hMgrObject 0x%x\n", hMgrObject);
	/* Free resources */
	if (hMgrObject->hDcdMgr)
		DCD_DestroyManager(hMgrObject->hDcdMgr);

	MEM_FreeObject(pMgrObject);
	/* Update the Registry with NULL for MGR Object */
	(void)CFG_SetObject(0, REG_MGR_OBJECT);

	GT_2trace(MGR_DebugMask, GT_ENTER,
		 "Exiting MGR_Destroy: hMgrObject: 0x%x\t"
		 "status: 0x%x\n", hMgrObject, status);

	DBC_Ensure(DSP_FAILED(status) ||
		 !MEM_IsValidHandle(hMgrObject, SIGNATURE));

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

示例2: STRM_Issue

/*
 *  ======== STRM_Issue ========
 *  Purpose:
 *      Issues a buffer on a stream
 */
DSP_STATUS STRM_Issue(struct STRM_OBJECT *hStrm, IN u8 *pBuf, u32 ulBytes,
		     u32 ulBufSize, u32 dwArg)
{
	struct WMD_DRV_INTERFACE *pIntfFxns;
	DSP_STATUS status = DSP_SOK;
	void *pTmpBuf = NULL;

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

	GT_4trace(STRM_debugMask, GT_ENTER, "STRM_Issue: hStrm: 0x%x\tpBuf: "
		 "0x%x\tulBytes: 0x%x\tdwArg: 0x%x\n", hStrm, pBuf, ulBytes,
		 dwArg);

	pIntfFxns = hStrm->hStrmMgr->pIntfFxns;

	if (hStrm->uSegment != 0) {
		pTmpBuf = CMM_XlatorTranslate(hStrm->hXlator,
				(void *)pBuf, CMM_VA2DSPPA);
		if (pTmpBuf == NULL)
			status = DSP_ETRANSLATE;

	}
	if (DSP_SUCCEEDED(status)) {
		status = (*pIntfFxns->pfnChnlAddIOReq)
			 (hStrm->hChnl, pBuf, ulBytes, ulBufSize,
			 (u32) pTmpBuf, dwArg);
	}
	if (status == CHNL_E_NOIORPS)
		status = DSP_ESTREAMFULL;

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

示例3: LDRV_MPLIST_isEmpty

/** ============================================================================
 *  @func   LDRV_MPLIST_isEmpty
 *
 *  @desc   check for an empty list.
 *
 *  @modif  None.
 *  ============================================================================
 */
EXPORT_API
Bool
LDRV_MPLIST_isEmpty (IN     ProcessorId dspId,
                     IN     List *      list )
{
    Bool                 retVal = FALSE ;
    LDRV_MPLIST_Object * mplistState ;
    Uint32               temp   ;

    TRC_2ENTER ("LDRV_MPLIST_isEmpty", dspId, list) ;

    DBC_Require (IS_VALID_PROCID(dspId)) ;
    DBC_Require (list != NULL) ;
    DBC_Assert  (LDRV_MPLIST_IsInitialized [dspId] == TRUE) ;

    mplistState = &(LDRV_MPLIST_State [dspId]) ;

    temp = SWAP_LONG (DSP_addrConvert (dspId,
                                       (Uint32) &((list)->head),
                                       GppToDsp),
                      mplistState->wordSwap) ;

    if ( ((Uint32) (list)->head.next) == temp) {
        retVal = TRUE ;
    }

    TRC_1LEAVE ("LDRV_MPLIST_isEmpty", retVal) ;

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

示例4: STRM_FreeBuffer

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

	HANDLE hSTRMRes = NULL;

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

	for (i = 0; i < uNumBufs; i++) {
		DBC_Assert(hStrm->hXlator != NULL);
		status = CMM_XlatorFreeBuf(hStrm->hXlator, apBuffer[i]);
		if (DSP_FAILED(status))
			break;
		apBuffer[i] = NULL;
	}

	if (DSP_SUCCEEDED(status)) {
		if (DRV_GetSTRMResElement(hStrm, hSTRMRes, pr_ctxt) !=
				DSP_ENOTFOUND)
			DRV_ProcUpdateSTRMRes(uNumBufs-i, hSTRMRes);
	}
	return status;
}
开发者ID:dancing-leaves,项目名称:nst-linux-kernel,代码行数:31,代码来源:strm.c

示例5: LIST_GetHead

/** ============================================================================
 *  @func   LIST_GetHead
 *
 *  @desc   Pops the head off the list and returns a pointer to it.
 *
 *  @modif  None
 *  ============================================================================
 */
EXPORT_API
DSP_STATUS
LIST_GetHead (IN List * list, OUT ListElement ** headElement)
{
    DSP_STATUS status = DSP_SOK ;

    TRC_2ENTER ("LIST_GetHead", list, headElement) ;

    DBC_Require (list != NULL) ;
    DBC_Require (headElement != NULL) ;

    if ((list == NULL) || (headElement == NULL)) {
        status = DSP_EINVALIDARG ;
        SET_FAILURE_REASON ;
    }
    else {
        if (LIST_IsEmpty (list)) {
            *headElement = NULL ;
        }
        else {
            *headElement = list->head.next ;
            list->head.next = (*headElement)->next ;
            (*headElement)->next->prev = &list->head ;
        }
    }

    TRC_1LEAVE ("LIST_GetHead", status) ;

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

示例6: LDRV_MPCS_create

/** ============================================================================
 *  @func   LDRV_MPCS_create
 *
 *  @desc   This function creates and initializes an instance of the MPCS
 *          object.
 *          The memory for the object may or may not be provided by the user.
 *          If provided by the user, the memory for the object must be shared
 *          across the processors using the MPCS. It must also already be mapped
 *          into user space for OSes supporting user/kernel separation.
 *
 *  @modif  None.
 *  ============================================================================
 */
EXPORT_API
DSP_STATUS
LDRV_MPCS_create (IN     ProcessorId    dspId,
                  IN     MPCS_ShObj *   mpcsObj)
{
    DSP_STATUS status = DSP_SOK ;

    TRC_2ENTER ("LDRV_MPCS_create", dspId, mpcsObj) ;

    DBC_Require (IS_VALID_PROCID (dspId)) ;
    DBC_Require (mpcsObj != NULL) ;

    mpcsObj->turn                     = SELF  ;
#if defined (DDSP_PROFILE)
    mpcsObj->gppMpcsObj.conflicts     = 0 ;
    mpcsObj->gppMpcsObj.numCalls      = 0 ;
    mpcsObj->dspMpcsObj.conflicts     = 0 ;
    mpcsObj->dspMpcsObj.numCalls      = 0 ;
#endif

    status = LDRV_MPCS_OS_create (dspId, mpcsObj) ;

    mpcsObj->dspMpcsObj.localLock     = 0 ;
    mpcsObj->gppMpcsObj.flag          = (Uint16) MPCS_FREE  ;
    mpcsObj->dspMpcsObj.flag          = (Uint16) MPCS_FREE  ;
    mpcsObj->gppMpcsObj.freeObject    = (Uint16) FALSE  ;
    mpcsObj->dspMpcsObj.freeObject    = (Uint16) FALSE  ;
    mpcsObj->dspMpcsObj.mpcsEntryAddr = 0 ;
    mpcsObj->gppMpcsObj.mpcsEntryAddr = 0 ;

    TRC_1LEAVE ("LDRV_MPCS_create", status) ;

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

示例7: DBLL_unload

/*
 *  ======== DBLL_unload ========
 */
void DBLL_unload(struct DBLL_LibraryObj *lib, struct DBLL_Attrs *attrs)
{
	struct DBLL_LibraryObj *zlLib = (struct DBLL_LibraryObj *)lib;
	s32 err = 0;

	DBC_Require(cRefs > 0);
	DBC_Require(MEM_IsValidHandle(zlLib, DBLL_LIBSIGNATURE));
	DBC_Require(zlLib->loadRef > 0);
	GT_1trace(DBLL_debugMask, GT_ENTER, "DBLL_unload: lib: 0x%x\n", lib);
	zlLib->loadRef--;
	/* Unload only if reference count is 0 */
	if (zlLib->loadRef != 0)
		goto func_end;

	zlLib->pTarget->attrs = *attrs;
	if (zlLib->mHandle) {
		err = Dynamic_Unload_Module(zlLib->mHandle,
			&zlLib->symbol.dlSymbol,
			&zlLib->allocate.dlAlloc, &zlLib->init.dlInit);
		if (err != 0) {
			GT_1trace(DBLL_debugMask, GT_5CLASS,
				 "Dynamic_Unload_Module failed: 0x%x\n", err);
		}
	}
	/* remove symbols from symbol table */
	if (zlLib->symTab != NULL) {
		GH_delete(zlLib->symTab);
		zlLib->symTab = NULL;
	}
	/* delete DOFF desc since it holds *lots* of host OS
	 * resources */
	dofClose(zlLib);
func_end:
	DBC_Ensure(zlLib->loadRef >= 0);
}
开发者ID:StarKissed,项目名称:android_kernel_omap,代码行数:38,代码来源:dbll.c

示例8: LIST_PutTail

/** ============================================================================
 *  @func   LIST_PutTail
 *
 *  @desc   Adds the specified element to the tail of the list.
 *
 *  @modif  None
 *  ============================================================================
 */
EXPORT_API
DSP_STATUS
LIST_PutTail (IN List * list, IN ListElement * element)
{
    DSP_STATUS status = DSP_SOK ;

    TRC_2ENTER ("LIST_PutTail", list, element) ;

    DBC_Require (list != NULL) ;
    DBC_Require (element != NULL) ;

    if ((list == NULL) || (element == NULL)) {
        status = DSP_EINVALIDARG ;
        SET_FAILURE_REASON ;
    }
    else {
        element->prev       = list->head.prev ;
        element->next       = &list->head ;
        list->head.prev     = element ;
        element->prev->next = element ;
    }

    DBC_Assert (   (DSP_SUCCEEDED (status) && (!LIST_IsEmpty (list)))
                || (DSP_FAILED (status)));

    TRC_1LEAVE ("LIST_PutTail", status) ;

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

示例9: DBLL_create

/*
 *  ======== DBLL_create ========
 */
DSP_STATUS DBLL_create(struct DBLL_TarObj **pTarget, struct DBLL_Attrs *pAttrs)
{
	struct DBLL_TarObj *pzlTarget;
	DSP_STATUS status = DSP_SOK;

	DBC_Require(cRefs > 0);
	DBC_Require(pAttrs != NULL);
	DBC_Require(pTarget != NULL);

	GT_2trace(DBLL_debugMask, GT_ENTER,
		  "DBLL_create: pTarget: 0x%x pAttrs: "
		  "0x%x\n", pTarget, pAttrs);
	/* Allocate DBL target object */
	MEM_AllocObject(pzlTarget, struct DBLL_TarObj, DBLL_TARGSIGNATURE);
	if (pTarget != NULL) {
		if (pzlTarget == NULL) {
			GT_0trace(DBLL_debugMask, GT_6CLASS,
				 "DBLL_create: Memory allocation"
				 " failed\n");
			*pTarget = NULL;
			status = DSP_EMEMORY;
		} else {
			pzlTarget->attrs = *pAttrs;
			*pTarget = (struct DBLL_TarObj *)pzlTarget;
		}
		DBC_Ensure((DSP_SUCCEEDED(status) &&
			  MEM_IsValidHandle(((struct DBLL_TarObj *)(*pTarget)),
			  DBLL_TARGSIGNATURE)) || (DSP_FAILED(status) &&
			  *pTarget == NULL));
	}

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

示例10: DBLL_getCAddr

/*
 *  ======== DBLL_getCAddr ========
 *  Get address of a "C" name in the specified library.
 */
bool DBLL_getCAddr(struct DBLL_LibraryObj *zlLib, char *name,
		   struct DBLL_Symbol **ppSym)
{
	struct Symbol *sym;
	char cname[MAXEXPR + 1];
	bool status = false;

	DBC_Require(cRefs > 0);
	DBC_Require(MEM_IsValidHandle(zlLib, DBLL_LIBSIGNATURE));
	DBC_Require(ppSym != NULL);
	DBC_Require(zlLib->symTab != NULL);
	DBC_Require(name != NULL);

	cname[0] = '_';

       strncpy(cname + 1, name, sizeof(cname) - 2);
	cname[MAXEXPR] = '\0'; 	/* insure '\0' string termination */

	/* Check for C name, if not found */
	sym = (struct Symbol *)GH_find(zlLib->symTab, cname);

	if (sym != NULL) {
		*ppSym = &sym->value;
		status = true;
	}

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

示例11: DBLL_close

/*
 *  ======== DBLL_close ========
 */
void DBLL_close(struct DBLL_LibraryObj *zlLib)
{
	struct DBLL_TarObj *zlTarget;

	DBC_Require(cRefs > 0);
	DBC_Require(MEM_IsValidHandle(zlLib, DBLL_LIBSIGNATURE));
	DBC_Require(zlLib->openRef > 0);
	zlTarget = zlLib->pTarget;
	GT_1trace(DBLL_debugMask, GT_ENTER, "DBLL_close: lib: 0x%x\n", zlLib);
	zlLib->openRef--;
	if (zlLib->openRef == 0) {
		/* Remove library from list */
		if (zlTarget->head == zlLib)
			zlTarget->head = zlLib->next;

		if (zlLib->prev)
			(zlLib->prev)->next = zlLib->next;

		if (zlLib->next)
			(zlLib->next)->prev = zlLib->prev;

		/* Free DOF resources */
		dofClose(zlLib);
		if (zlLib->fileName)
			MEM_Free(zlLib->fileName);

		/* remove symbols from symbol table */
		if (zlLib->symTab)
			GH_delete(zlLib->symTab);

		/* remove the library object itself */
		MEM_FreeObject(zlLib);
		zlLib = NULL;
	}
}
开发者ID:StarKissed,项目名称:android_kernel_omap,代码行数:38,代码来源:dbll.c

示例12: COD_ReadSection

/*
 *  ======== COD_ReadSection ========
 *  Purpose:
 *      Retrieve the content of a code section given the section name.
 */
DSP_STATUS COD_ReadSection(struct COD_LIBRARYOBJ *lib, IN char *pstrSect,
			   OUT char *pstrContent, IN u32 cContentSize)
{
	DSP_STATUS status = DSP_SOK;

	DBC_Require(cRefs > 0);
	DBC_Require(lib != NULL);
	DBC_Require(IsValid(lib->hCodMgr));
	DBC_Require(pstrSect != NULL);
	DBC_Require(pstrContent != NULL);

	GT_4trace(COD_debugMask, GT_ENTER, "Entered COD_ReadSection Args: 0x%x,"
		 " 0x%x, 0x%x, 0x%x\n", lib, pstrSect, pstrContent,
		 cContentSize);

	if (lib != NULL) {
		status = lib->hCodMgr->fxns.readSectFxn(lib->dbllLib, pstrSect,
							pstrContent,
							cContentSize);
		if (DSP_FAILED(status)) {
			GT_1trace(COD_debugMask, GT_7CLASS,
				 "COD_ReadSection failed: 0x%lx\n", status);
		}
	} else {
		status = COD_E_NOSYMBOLSLOADED;
		GT_0trace(COD_debugMask, GT_7CLASS,
			  "COD_ReadSection: No Symbols loaded\n");
	}
	return status;
}
开发者ID:MuMu360121,项目名称:jordan-kernel,代码行数:35,代码来源:cod.c

示例13: COD_GetSymValue

/*
 *  ======== COD_GetSymValue ========
 *  Purpose:
 *      Retrieve the value for the specified symbol. The symbol is first
 *      searched for literally and then, if not found, searched for as a
 *      C symbol.
 *
 */
DSP_STATUS COD_GetSymValue(struct COD_MANAGER *hMgr, char *pstrSym,
			   u32 *pulValue)
{
	struct DBLL_Symbol *pSym;

	DBC_Require(cRefs > 0);
	DBC_Require(IsValid(hMgr));
	DBC_Require(pstrSym != NULL);
	DBC_Require(pulValue != NULL);

	GT_3trace(COD_debugMask, GT_ENTER, "Entered COD_GetSymValue Args \t\n"
		  "hMgr: 0x%x\t\npstrSym: 0x%x\t\npulValue: 0x%x\n",
		  hMgr, pstrSym, pulValue);
	if (hMgr->baseLib) {
		if (!hMgr->fxns.getAddrFxn(hMgr->baseLib, pstrSym, &pSym)) {
			if (!hMgr->fxns.getCAddrFxn(hMgr->baseLib, pstrSym,
			    &pSym)) {
				GT_0trace(COD_debugMask, GT_7CLASS,
					  "COD_GetSymValue: "
					  "Symbols not found\n");
				return COD_E_SYMBOLNOTFOUND;
			}
		}
	} else {
		GT_0trace(COD_debugMask, GT_7CLASS, "COD_GetSymValue: "
			 "No Symbols loaded\n");
		return COD_E_NOSYMBOLSLOADED;
	}

	*pulValue = pSym->value;

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

示例14: KFILEDEF_Tell

/** ============================================================================
 *  @func   KFILEDEF_Tell
 *
 *  @desc   Returns the current file pointer position for the specified
 *          file handle.
 *
 *  @modif  None
 *  ============================================================================
 */
EXPORT_API
DSP_STATUS
KFILEDEF_Tell (IN  Void *        fileHandle,
               OUT Int32 *       pos)
{
    DSP_STATUS   status = DSP_SOK ;
    KFILEDEF_Object * fileObj = NULL ;

    TRC_2ENTER ("KFILEDEF_Tell", fileObj, pos) ;

    DBC_Require (fileHandle != NULL) ;
    DBC_Require (pos != NULL) ;

    if (pos == NULL) {
        status = DSP_EINVALIDARG ;
        SET_FAILURE_REASON ;
    }
    else {
        fileObj = (KFILEDEF_Object *) fileHandle ;
        *pos = fileObj->curPos ;
        DBC_Assert (*pos == fileObj->fileDesc->f_pos) ;
    }

    DBC_Ensure (   (DSP_SUCCEEDED (status) && (pos != NULL) && (*pos >= 0))
                   || (DSP_FAILED (status))) ;

    TRC_1LEAVE ("KFILEDEF_Tell", status) ;

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

示例15: PRCS_Delete

/** ============================================================================
 *  @func   PRCS_Delete
 *
 *  @desc   Frees up resources used by the specified object.
 *
 *  @modif  None
 *  ============================================================================
 */
EXPORT_API
DSP_STATUS
PRCS_Delete (IN PrcsObject * prcsObj)
{
    DSP_STATUS  status = DSP_SOK ;

    TRC_1ENTER ("PRCS_Delete", prcsObj) ;

    DBC_Require (PRCS_IsInitialized == TRUE) ;
    DBC_Require (prcsObj != NULL) ;
    DBC_Require (IS_OBJECT_VALID (prcsObj, SIGN_PRCS)) ;

    if (IS_OBJECT_VALID (prcsObj, SIGN_PRCS)) {
        prcsObj->signature = SIGN_NULL ;
        status = FREE_PTR (prcsObj) ;
        if (DSP_FAILED (status)) {
            SET_FAILURE_REASON ;
        }
    }
    else {
        status = DSP_EPOINTER ;
        SET_FAILURE_REASON ;
    }

    TRC_1LEAVE ("PRCS_Delete", status) ;

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


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