lib/sw_services/xilplmi/src/xplmi_generic.c
static int XPlmi_DmaWrite(XPlmi_Cmd *Cmd)
{
	int Status = XST_FAILURE;
	u64 DestAddr;
	u64 SrcAddr;
	u32 Len = Cmd->PayloadLen;
	u32 DestOffset = 0U;

	XPlmi_Printf(DEBUG_DETAILED, "%s \n\r", __func__);

	if (Cmd->ProcessedLen == 0U) {
		/* Store the destination address in resume data */
		Cmd->ResumeData[0U] = Cmd->Payload[0U];
		Cmd->ResumeData[1U] = Cmd->Payload[1U];
		SrcAddr = (u64)(UINTPTR) &Cmd->Payload[2U];
		Len -= 2U;
	} else {
		SrcAddr = (u64)(UINTPTR) &Cmd->Payload[0U];
		/* Decrement the destination offset by CMD params */
		DestOffset = 2U;
	}

	DestAddr = (u64) Cmd->ResumeData[0U];
	DestAddr = ((u64)Cmd->ResumeData[1U] | (DestAddr << 32U));
	DestAddr += (((u64)Cmd->ProcessedLen - DestOffset) * XPLMI_WORD_LEN);

	/* Call XPlmi_DmaTransfer with flags DMA0 and INCR */
	Status = XPlmi_DmaTransfer(DestAddr, SrcAddr, Len, XPLMI_PMCDMA_0);

	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function provides DMA write command execution.
 *  		Command payload parameters are
 *		- High Dest Addr
 *		- Low Dest Addr
 *
 * @param	Cmd is pointer to the command structure
 *
 * @return	XST_SUCCESS on success and error code on failure
 *
 *****************************************************************************/
@brief       This function provides DMA write command execution.
Command payload parameters are
- High Dest Addr
- Low Dest Addr

@param       Cmd is pointer to the command structure

@return      XST_SUCCESS on success and error code on failure
@brief This function provides DMA write command execution . Command payload parameters are - High Dest Addr - Low Dest Addr @param Cmd is pointer to the command structure @return XST_SUCCESS on success and error code on failure
static int XPlmi_DmaWrite(XPlmi_Cmd *Cmd)
{
	int Status = XST_FAILURE;
	u64 DestAddr;
	u64 SrcAddr;
	u32 Len = Cmd->PayloadLen;
	u32 DestOffset = 0U;
	XPlmi_Printf(DEBUG_DETAILED, "%s \n\r", __func__);
	if (Cmd->ProcessedLen == 0U) {
		Cmd->ResumeData[0U] = Cmd->Payload[0U];
		Cmd->ResumeData[1U] = Cmd->Payload[1U];
		SrcAddr = (u64)(UINTPTR) &Cmd->Payload[2U];
		Len -= 2U;
	} else {
		SrcAddr = (u64)(UINTPTR) &Cmd->Payload[0U];
		DestOffset = 2U;
	}
	DestAddr = (u64) Cmd->ResumeData[0U];
	DestAddr = ((u64)Cmd->ResumeData[1U] | (DestAddr << 32U));
	DestAddr += (((u64)Cmd->ProcessedLen - DestOffset) * XPLMI_WORD_LEN);
	Status = XPlmi_DmaTransfer(DestAddr, SrcAddr, Len, XPLMI_PMCDMA_0);
	return Status;
}
static int XPlmi_DmaWrite ( XPlmi_Cmd * Cmd ) { int Status = XST_FAILURE ; u64 DestAddr ; u64 SrcAddr ; u32 Len = Cmd -> PayloadLen ; u32 DestOffset = 0U ; XPlmi_Printf ( DEBUG_DETAILED , " \n \r " , __func__ ) ; if ( Cmd -> ProcessedLen == 0U ) { Cmd -> ResumeData [ 0U ] = Cmd -> Payload [ 0U ] ; Cmd -> ResumeData [ 1U ] = Cmd -> Payload [ 1U ] ; SrcAddr = ( u64 ) ( UINTPTR ) & Cmd -> Payload [ 2U ] ; Len -= 2U ; } else { SrcAddr = ( u64 ) ( UINTPTR ) & Cmd -> Payload [ 0U ] ; DestOffset = 2U ; } DestAddr = ( u64 ) Cmd -> ResumeData [ 0U ] ; DestAddr = ( ( u64 ) Cmd -> ResumeData [ 1U ] | ( DestAddr << 32U ) ) ; DestAddr += ( ( ( u64 ) Cmd -> ProcessedLen - DestOffset ) * XPLMI_WORD_LEN ) ; Status = XPlmi_DmaTransfer ( DestAddr , SrcAddr , Len , XPLMI_PMCDMA_0 ) ; return Status ; }
@brief       This function provides DMA write command execution.
@brief This function provides DMA write command execution .
/* Store the destination address in resume data */ /* Decrement the destination offset by CMD params */ /* Call XPlmi_DmaTransfer with flags DMA0 and INCR */