lib/sw_services/xilloader/src/xloader_sd.c
static int XLoader_MakeSdFileName(u32 MultiBootOffset)
{
	int Status = XST_FAILURE;
	u8 Index = 10U;
	u8 Value;

	if (MultiBootOffset >= XLOADER_SD_MAX_BOOT_FILES_LIMIT) {
		Status = XPlmi_UpdateStatus(XLOADER_ERR_SD_MAX_BOOT_FILES_LIMIT, 0);
		goto END;
	}

	if (0x0U == MultiBootOffset) {
		Status = Xil_Strcat(BootFile, "BOOT.BIN",
			XLOADER_BASE_FILE_NAME_LEN_SD);
		if (Status != XST_SUCCESS) {
			goto END;
		}
	}
	else {
		Status = Xil_Strcat(BootFile, "BOOT0000.BIN",
			XLOADER_BASE_FILE_NAME_LEN_SD);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		while (MultiBootOffset > 0U) {
			Value = (u8)(MultiBootOffset % 10U);
			MultiBootOffset /= 10U;
			BootFile[Index] += (char)Value;
			Index--;
		}
	}

	XLoader_Printf(DEBUG_INFO, "File name is %s\r\n", BootFile);

END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function creates the Boot image name for file system devices
 * based on the multiboot register.
 *
 * @param	MultiBootOffset is the value of the multiboot register that
 *			would be suffixed to the filename
 *
 * @return	XST_SUCCESS on success and error code on failure
 *
 ******************************************************************************/
@brief       This function creates the Boot image name for file system devices
based on the multiboot register.

@param       MultiBootOffset is the value of the multiboot register that
would be suffixed to the filename

@return      XST_SUCCESS on success and error code on failure
@brief This function creates the Boot image name for file system devices based on the multiboot register . @param MultiBootOffset is the value of the multiboot register that would be suffixed to the filename @return XST_SUCCESS on success and error code on failure
static int XLoader_MakeSdFileName(u32 MultiBootOffset)
{
	int Status = XST_FAILURE;
	u8 Index = 10U;
	u8 Value;
	if (MultiBootOffset >= XLOADER_SD_MAX_BOOT_FILES_LIMIT) {
		Status = XPlmi_UpdateStatus(XLOADER_ERR_SD_MAX_BOOT_FILES_LIMIT, 0);
		goto END;
	}
	if (0x0U == MultiBootOffset) {
		Status = Xil_Strcat(BootFile, "BOOT.BIN",
			XLOADER_BASE_FILE_NAME_LEN_SD);
		if (Status != XST_SUCCESS) {
			goto END;
		}
	}
	else {
		Status = Xil_Strcat(BootFile, "BOOT0000.BIN",
			XLOADER_BASE_FILE_NAME_LEN_SD);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		while (MultiBootOffset > 0U) {
			Value = (u8)(MultiBootOffset % 10U);
			MultiBootOffset /= 10U;
			BootFile[Index] += (char)Value;
			Index--;
		}
	}
	XLoader_Printf(DEBUG_INFO, "File name is %s\r\n", BootFile);
END:
	return Status;
}
static int XLoader_MakeSdFileName ( u32 MultiBootOffset ) { int Status = XST_FAILURE ; u8 Index = 10U ; u8 Value ; if ( MultiBootOffset >= XLOADER_SD_MAX_BOOT_FILES_LIMIT ) { Status = XPlmi_UpdateStatus ( XLOADER_ERR_SD_MAX_BOOT_FILES_LIMIT , 0 ) ; goto END ; } if ( 0x0U == MultiBootOffset ) { Status = Xil_Strcat ( BootFile , " " , XLOADER_BASE_FILE_NAME_LEN_SD ) ; if ( Status != XST_SUCCESS ) { goto END ; } } else { Status = Xil_Strcat ( BootFile , " " , XLOADER_BASE_FILE_NAME_LEN_SD ) ; if ( Status != XST_SUCCESS ) { goto END ; } while ( MultiBootOffset > 0U ) { Value = ( u8 ) ( MultiBootOffset % 10U ) ; MultiBootOffset /= 10U ; BootFile [ Index ] += ( char ) Value ; Index -- ; } } XLoader_Printf ( DEBUG_INFO , " \r \n " , BootFile ) ; END : return Status ; }
@brief       This function creates the Boot image name for file system devices
 based on the multiboot register.
@brief This function creates the Boot image name for file system devices based on the multiboot register .