XilinxProcessorIPLib/drivers/mcdma/src/xmcdma_bd.c
int XMcdma_UpdateChanCDesc(XMcdma_ChanCtrl *Chan)
{
	UINTPTR BdPtr;
	u32 Offset;

	if (Chan->ChanState == XMCDMA_CHAN_BUSY) {
		return XST_SUCCESS;
	}

	Offset = (Chan->Chan_id - 1) * XMCDMA_NXTCHAN_OFFSET;
	BdPtr = (UINTPTR)(void *)Chan->BdHead;
	XMCDMA_CACHE_FLUSH((UINTPTR)(BdPtr));

	XMcdma_WriteReg(Chan->ChanBase,
				(XMCDMA_CDESC_OFFSET + Offset),
				(u32)BdPtr);
	if (Chan->ext_addr) {
		XMcdma_WriteReg(Chan->ChanBase,
				(XMCDMA_CDESC_MSB_OFFSET + Offset),
			UPPER_32_BITS(BdPtr));
	}

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
* Update Current Descriptor for the MCDMA Channel
*
* @param	Chan is the Channel instance to be worked on
*
* @return
*		- XST_SUCCESS upon success
*
* @note		None.
*
*****************************************************************************/
Update Current Descriptor for the MCDMA Channel
Update Current Descriptor for the MCDMA Channel
int XMcdma_UpdateChanCDesc(XMcdma_ChanCtrl *Chan)
{
	UINTPTR BdPtr;
	u32 Offset;
	if (Chan->ChanState == XMCDMA_CHAN_BUSY) {
		return XST_SUCCESS;
	}
	Offset = (Chan->Chan_id - 1) * XMCDMA_NXTCHAN_OFFSET;
	BdPtr = (UINTPTR)(void *)Chan->BdHead;
	XMCDMA_CACHE_FLUSH((UINTPTR)(BdPtr));
	XMcdma_WriteReg(Chan->ChanBase,
				(XMCDMA_CDESC_OFFSET + Offset),
				(u32)BdPtr);
	if (Chan->ext_addr) {
		XMcdma_WriteReg(Chan->ChanBase,
				(XMCDMA_CDESC_MSB_OFFSET + Offset),
			UPPER_32_BITS(BdPtr));
	}
	return XST_SUCCESS;
}
int XMcdma_UpdateChanCDesc ( XMcdma_ChanCtrl * Chan ) { UINTPTR BdPtr ; u32 Offset ; if ( Chan -> ChanState == XMCDMA_CHAN_BUSY ) { return XST_SUCCESS ; } Offset = ( Chan -> Chan_id - 1 ) * XMCDMA_NXTCHAN_OFFSET ; BdPtr = ( UINTPTR ) ( void * ) Chan -> BdHead ; XMCDMA_CACHE_FLUSH ( ( UINTPTR ) ( BdPtr ) ) ; XMcdma_WriteReg ( Chan -> ChanBase , ( XMCDMA_CDESC_OFFSET + Offset ) , ( u32 ) BdPtr ) ; if ( Chan -> ext_addr ) { XMcdma_WriteReg ( Chan -> ChanBase , ( XMCDMA_CDESC_MSB_OFFSET + Offset ) , UPPER_32_BITS ( BdPtr ) ) ; } return XST_SUCCESS ; }
Update Current Descriptor for the MCDMA Channel
Update Current Descriptor for the MCDMA Channel