lib/sw_services/xilloader/src/xloader_cmd.c
static int XLoader_GetImageInfo(XPlmi_Cmd *Cmd)
{
	int Status = XST_FAILURE;
	const XLoader_ImageInfo *ImageInfo = NULL;

	if (Cmd->Payload[XLOADER_CMD_GET_IMG_INFO_IMGID_INDEX] ==
		XLOADER_INVALID_IMG_ID) {
		Status = XLOADER_ERR_INVALID_IMGID;
		XPlmi_Printf(DEBUG_GENERAL, "Invalid ImgID\n\r");
		goto END;
	}

	ImageInfo = XLoader_GetImageInfoEntry(
		Cmd->Payload[XLOADER_CMD_GET_IMG_INFO_IMGID_INDEX]);
	if (ImageInfo == NULL) {
		Status = XLOADER_ERR_NO_VALID_IMG_FOUND;
		goto END;
	}
	if ((ImageInfo->ImgID != Cmd->Payload[XLOADER_CMD_GET_IMG_INFO_IMGID_INDEX])
		|| (ImageInfo->ImgID == XLOADER_INVALID_IMG_ID)) {
		Status = XLOADER_ERR_NO_VALID_IMG_FOUND;
		XPlmi_Printf(DEBUG_GENERAL, "No Valid Image Entry Found\n\r");
		goto END;
	}

	Cmd->Response[XLOADER_RESP_CMD_GET_IMG_INFO_UID_INDEX] = ImageInfo->UID;
	Cmd->Response[XLOADER_RESP_CMD_GET_IMG_INFO_PID_INDEX] = ImageInfo->PUID;
	Cmd->Response[XLOADER_RESP_CMD_GET_IMG_INFO_FUNCID_INDEX] =
		ImageInfo->FuncID;

	Status = XST_SUCCESS;

END:
	Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] = (u32)Status;
	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function provides ImageInfo stored in ImageInfoTbl for a
 *  given NodeID.
 *  Command payload parameters are
 *	- Node ID
 *  Command Response parameters are
 * 	- Unique ID
 * 	- Parent Unique ID
 * 	- Function ID
 *
 * @param	Cmd is pointer to the command structure
 *
 * @return	XST_SUCCESS on success and error code on failure
 *
 *****************************************************************************/
@brief       This function provides ImageInfo stored in ImageInfoTbl for a
given NodeID.
Command payload parameters are
- Node ID
Command Response parameters are
- Unique ID
- Parent Unique ID
- Function ID

@param       Cmd is pointer to the command structure

@return      XST_SUCCESS on success and error code on failure
@brief This function provides ImageInfo stored in ImageInfoTbl for a given NodeID . Command payload parameters are - Node ID Command Response parameters are - Unique ID - Parent Unique ID - Function ID @param Cmd is pointer to the command structure @return XST_SUCCESS on success and error code on failure
static int XLoader_GetImageInfo(XPlmi_Cmd *Cmd)
{
	int Status = XST_FAILURE;
	const XLoader_ImageInfo *ImageInfo = NULL;
	if (Cmd->Payload[XLOADER_CMD_GET_IMG_INFO_IMGID_INDEX] ==
		XLOADER_INVALID_IMG_ID) {
		Status = XLOADER_ERR_INVALID_IMGID;
		XPlmi_Printf(DEBUG_GENERAL, "Invalid ImgID\n\r");
		goto END;
	}
	ImageInfo = XLoader_GetImageInfoEntry(
		Cmd->Payload[XLOADER_CMD_GET_IMG_INFO_IMGID_INDEX]);
	if (ImageInfo == NULL) {
		Status = XLOADER_ERR_NO_VALID_IMG_FOUND;
		goto END;
	}
	if ((ImageInfo->ImgID != Cmd->Payload[XLOADER_CMD_GET_IMG_INFO_IMGID_INDEX])
		|| (ImageInfo->ImgID == XLOADER_INVALID_IMG_ID)) {
		Status = XLOADER_ERR_NO_VALID_IMG_FOUND;
		XPlmi_Printf(DEBUG_GENERAL, "No Valid Image Entry Found\n\r");
		goto END;
	}
	Cmd->Response[XLOADER_RESP_CMD_GET_IMG_INFO_UID_INDEX] = ImageInfo->UID;
	Cmd->Response[XLOADER_RESP_CMD_GET_IMG_INFO_PID_INDEX] = ImageInfo->PUID;
	Cmd->Response[XLOADER_RESP_CMD_GET_IMG_INFO_FUNCID_INDEX] =
		ImageInfo->FuncID;
	Status = XST_SUCCESS;
END:
	Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] = (u32)Status;
	return Status;
}
static int XLoader_GetImageInfo ( XPlmi_Cmd * Cmd ) { int Status = XST_FAILURE ; const XLoader_ImageInfo * ImageInfo = NULL ; if ( Cmd -> Payload [ XLOADER_CMD_GET_IMG_INFO_IMGID_INDEX ] == XLOADER_INVALID_IMG_ID ) { Status = XLOADER_ERR_INVALID_IMGID ; XPlmi_Printf ( DEBUG_GENERAL , " \n \r " ) ; goto END ; } ImageInfo = XLoader_GetImageInfoEntry ( Cmd -> Payload [ XLOADER_CMD_GET_IMG_INFO_IMGID_INDEX ] ) ; if ( ImageInfo == NULL ) { Status = XLOADER_ERR_NO_VALID_IMG_FOUND ; goto END ; } if ( ( ImageInfo -> ImgID != Cmd -> Payload [ XLOADER_CMD_GET_IMG_INFO_IMGID_INDEX ] ) || ( ImageInfo -> ImgID == XLOADER_INVALID_IMG_ID ) ) { Status = XLOADER_ERR_NO_VALID_IMG_FOUND ; XPlmi_Printf ( DEBUG_GENERAL , " \n \r " ) ; goto END ; } Cmd -> Response [ XLOADER_RESP_CMD_GET_IMG_INFO_UID_INDEX ] = ImageInfo -> UID ; Cmd -> Response [ XLOADER_RESP_CMD_GET_IMG_INFO_PID_INDEX ] = ImageInfo -> PUID ; Cmd -> Response [ XLOADER_RESP_CMD_GET_IMG_INFO_FUNCID_INDEX ] = ImageInfo -> FuncID ; Status = XST_SUCCESS ; END : Cmd -> Response [ XLOADER_RESP_CMD_EXEC_STATUS_INDEX ] = ( u32 ) Status ; return Status ; }
@brief       This function provides ImageInfo stored in ImageInfoTbl for a
  given NodeID.
@brief This function provides ImageInfo stored in ImageInfoTbl for a given NodeID .