lib/sw_services/xilloader/src/xloader_cmd.c
static int XLoader_AddImageStorePdi(XPlmi_Cmd *Cmd)
{
	int Status = XST_FAILURE;
	u64 PdiAddr = (u64)Cmd->Payload[XLOADER_CMD_IMGSTORE_PDIADDR_HIGH_INDEX];
	XLoader_ImageStore *PdiList = XLoader_GetPdiList();
	u8 Index;

	if (PdiList->Count >= XLOADER_MAX_PDI_LIST) {
		Status = XPlmi_UpdateStatus(XLOADER_ERR_PDI_LIST_FULL, 0);
		goto END;
	}
	PdiAddr = ((u64)Cmd->Payload[XLOADER_CMD_IMGSTORE_PDIADDR_LOW_INDEX]) |
			(PdiAddr << 32U);
	for (Index = 0U; Index < PdiList->Count; Index++) {
		if (PdiList->PdiAddr[Index] == PdiAddr) {
			break;
		}
	}
	if (Index > PdiList->Count) {
		Status = XPlmi_UpdateStatus(XLOADER_ERR_PDI_ADDR_EXISTS, 0);
		goto END;
	}

	Status = XLoader_DdrInit(XLOADER_PDI_SRC_DDR);
	if (Status != XST_SUCCESS) {
		goto END;
	}
	PdiList->PdiAddr[Index] = PdiAddr;
	PdiList->Count++;

END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function adds PdiAddress to ImageStore PdiList
 *  Command payload parameters are
 *	- High PdiAddr - Upper 32 bit value of PdiAddr
 *	- Low PdiAddr - Lower 32 bit value of PdiAddr
 *
 * @param	Cmd is pointer to the command structure
 *
 * @return	XST_SUCCESS on success and error code on failure
 *
 *****************************************************************************/
@brief       This function adds PdiAddress to ImageStore PdiList
Command payload parameters are
- High PdiAddr - Upper 32 bit value of PdiAddr
- Low PdiAddr - Lower 32 bit value of PdiAddr

@param       Cmd is pointer to the command structure

@return      XST_SUCCESS on success and error code on failure
@brief This function adds PdiAddress to ImageStore PdiList Command payload parameters are - High PdiAddr - Upper 32 bit value of PdiAddr - Low PdiAddr - Lower 32 bit value of PdiAddr @param Cmd is pointer to the command structure @return XST_SUCCESS on success and error code on failure
static int XLoader_AddImageStorePdi(XPlmi_Cmd *Cmd)
{
	int Status = XST_FAILURE;
	u64 PdiAddr = (u64)Cmd->Payload[XLOADER_CMD_IMGSTORE_PDIADDR_HIGH_INDEX];
	XLoader_ImageStore *PdiList = XLoader_GetPdiList();
	u8 Index;
	if (PdiList->Count >= XLOADER_MAX_PDI_LIST) {
		Status = XPlmi_UpdateStatus(XLOADER_ERR_PDI_LIST_FULL, 0);
		goto END;
	}
	PdiAddr = ((u64)Cmd->Payload[XLOADER_CMD_IMGSTORE_PDIADDR_LOW_INDEX]) |
			(PdiAddr << 32U);
	for (Index = 0U; Index < PdiList->Count; Index++) {
		if (PdiList->PdiAddr[Index] == PdiAddr) {
			break;
		}
	}
	if (Index > PdiList->Count) {
		Status = XPlmi_UpdateStatus(XLOADER_ERR_PDI_ADDR_EXISTS, 0);
		goto END;
	}
	Status = XLoader_DdrInit(XLOADER_PDI_SRC_DDR);
	if (Status != XST_SUCCESS) {
		goto END;
	}
	PdiList->PdiAddr[Index] = PdiAddr;
	PdiList->Count++;
END:
	return Status;
}
static int XLoader_AddImageStorePdi ( XPlmi_Cmd * Cmd ) { int Status = XST_FAILURE ; u64 PdiAddr = ( u64 ) Cmd -> Payload [ XLOADER_CMD_IMGSTORE_PDIADDR_HIGH_INDEX ] ; XLoader_ImageStore * PdiList = XLoader_GetPdiList ( ) ; u8 Index ; if ( PdiList -> Count >= XLOADER_MAX_PDI_LIST ) { Status = XPlmi_UpdateStatus ( XLOADER_ERR_PDI_LIST_FULL , 0 ) ; goto END ; } PdiAddr = ( ( u64 ) Cmd -> Payload [ XLOADER_CMD_IMGSTORE_PDIADDR_LOW_INDEX ] ) | ( PdiAddr << 32U ) ; for ( Index = 0U ; Index < PdiList -> Count ; Index ++ ) { if ( PdiList -> PdiAddr [ Index ] == PdiAddr ) { break ; } } if ( Index > PdiList -> Count ) { Status = XPlmi_UpdateStatus ( XLOADER_ERR_PDI_ADDR_EXISTS , 0 ) ; goto END ; } Status = XLoader_DdrInit ( XLOADER_PDI_SRC_DDR ) ; if ( Status != XST_SUCCESS ) { goto END ; } PdiList -> PdiAddr [ Index ] = PdiAddr ; PdiList -> Count ++ ; END : return Status ; }
@brief       This function adds PdiAddress to ImageStore PdiList
  Command payload parameters are
      - High PdiAddr - Upper 32 bit value of PdiAddr
      - Low PdiAddr - Lower 32 bit value of PdiAddr
@brief This function adds PdiAddress to ImageStore PdiList Command payload parameters are - High PdiAddr - Upper 32 bit value of PdiAddr - Low PdiAddr - Lower 32 bit value of PdiAddr