lib/sw_services/xilplmi/src/xplmi_generic.c
static int XPlmi_MoveProc(u8 ProcIndex, XPlmi_ProcList *ProcList)
{
	int Status = XST_FAILURE;
	u32 DestAddr;
	u32 SrcAddr;
	u32 Len;
	u8 Index = ProcIndex;
	u32 DeletedProcLen;

	/*
	 * If only one proc is available and new proc command is received with
	 * same ID, it can directly be overwritten.
	 */
	if ((ProcList->ProcCount == 1U) ||
		(Index == (ProcList->ProcCount - 1U))) {
		Status = XST_SUCCESS;
		goto END;
	}

	/*
	 * If proc command is received for existing ProcId,
	 * move all procs behind this to front
	 */
	DestAddr = ProcList->ProcData[Index].Addr;
	SrcAddr = ProcList->ProcData[Index + 1U].Addr;
	Len = (ProcList->ProcData[ProcList->ProcCount].Addr -
			SrcAddr)/XPLMI_WORD_LEN;
	/* Length of the proc that is removed */
	DeletedProcLen = ProcList->ProcData[Index + 1U].Addr -
			ProcList->ProcData[Index].Addr;

	/* Call XPlmi_DmaTransfer with flags DMA0 and INCR */
	Status = XPlmi_DmaTransfer(DestAddr, SrcAddr, Len, XPLMI_PMCDMA_0);
	if (Status != XST_SUCCESS) {
		goto END;
	}

	/* Update ProcList with moved data */
	while(Index <= ProcList->ProcCount) {
		ProcList->ProcData[Index].Id = ProcList->ProcData[Index + 1U].Id;
		ProcList->ProcData[Index].Addr =
					ProcList->ProcData[Index + 1U].Addr - DeletedProcLen;
		Index++;
	}

END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function provides functionality to move procs when proc
 *          command is received for existing ProcId.
 *
 * @param	ProcIndex is the index of ProcId to be moved
 *
 * @return	XST_SUCCESS on success and error code on failure
 *
 *****************************************************************************/
@brief       This function provides functionality to move procs when proc
command is received for existing ProcId.

@param       ProcIndex is the index of ProcId to be moved

@return      XST_SUCCESS on success and error code on failure
@brief This function provides functionality to move procs when proc command is received for existing ProcId . @param ProcIndex is the index of ProcId to be moved @return XST_SUCCESS on success and error code on failure
static int XPlmi_MoveProc(u8 ProcIndex, XPlmi_ProcList *ProcList)
{
	int Status = XST_FAILURE;
	u32 DestAddr;
	u32 SrcAddr;
	u32 Len;
	u8 Index = ProcIndex;
	u32 DeletedProcLen;
	if ((ProcList->ProcCount == 1U) ||
		(Index == (ProcList->ProcCount - 1U))) {
		Status = XST_SUCCESS;
		goto END;
	}
	DestAddr = ProcList->ProcData[Index].Addr;
	SrcAddr = ProcList->ProcData[Index + 1U].Addr;
	Len = (ProcList->ProcData[ProcList->ProcCount].Addr -
			SrcAddr)/XPLMI_WORD_LEN;
	DeletedProcLen = ProcList->ProcData[Index + 1U].Addr -
			ProcList->ProcData[Index].Addr;
	Status = XPlmi_DmaTransfer(DestAddr, SrcAddr, Len, XPLMI_PMCDMA_0);
	if (Status != XST_SUCCESS) {
		goto END;
	}
	while(Index <= ProcList->ProcCount) {
		ProcList->ProcData[Index].Id = ProcList->ProcData[Index + 1U].Id;
		ProcList->ProcData[Index].Addr =
					ProcList->ProcData[Index + 1U].Addr - DeletedProcLen;
		Index++;
	}
END:
	return Status;
}
static int XPlmi_MoveProc ( u8 ProcIndex , XPlmi_ProcList * ProcList ) { int Status = XST_FAILURE ; u32 DestAddr ; u32 SrcAddr ; u32 Len ; u8 Index = ProcIndex ; u32 DeletedProcLen ; if ( ( ProcList -> ProcCount == 1U ) || ( Index == ( ProcList -> ProcCount - 1U ) ) ) { Status = XST_SUCCESS ; goto END ; } DestAddr = ProcList -> ProcData [ Index ] . Addr ; SrcAddr = ProcList -> ProcData [ Index + 1U ] . Addr ; Len = ( ProcList -> ProcData [ ProcList -> ProcCount ] . Addr - SrcAddr ) / XPLMI_WORD_LEN ; DeletedProcLen = ProcList -> ProcData [ Index + 1U ] . Addr - ProcList -> ProcData [ Index ] . Addr ; Status = XPlmi_DmaTransfer ( DestAddr , SrcAddr , Len , XPLMI_PMCDMA_0 ) ; if ( Status != XST_SUCCESS ) { goto END ; } while ( Index <= ProcList -> ProcCount ) { ProcList -> ProcData [ Index ] . Id = ProcList -> ProcData [ Index + 1U ] . Id ; ProcList -> ProcData [ Index ] . Addr = ProcList -> ProcData [ Index + 1U ] . Addr - DeletedProcLen ; Index ++ ; } END : return Status ; }
@brief       This function provides functionality to move procs when proc
          command is received for existing ProcId.
@brief This function provides functionality to move procs when proc command is received for existing ProcId .
/*
	 * If only one proc is available and new proc command is received with
	 * same ID, it can directly be overwritten.
	 */ /*
	 * If proc command is received for existing ProcId,
	 * move all procs behind this to front
	 */ /* Length of the proc that is removed */ /* Call XPlmi_DmaTransfer with flags DMA0 and INCR */ /* Update ProcList with moved data */