130 lines
2.8 KiB
C
130 lines
2.8 KiB
C
|
/*
|
||
|
**********************************************************************************************************************
|
||
|
* eGon
|
||
|
* the Embedded GO-ON Bootloader System
|
||
|
* eGON arm boot sub-system
|
||
|
*
|
||
|
* Copyright(C), 2006-2014, Allwinner Technology Co., Ltd.
|
||
|
* All Rights Reserved
|
||
|
*
|
||
|
* File :
|
||
|
*
|
||
|
* By : Jerry
|
||
|
*
|
||
|
* Version : V2.00
|
||
|
*
|
||
|
* Date :
|
||
|
*
|
||
|
* Descript:
|
||
|
**********************************************************************************************************************
|
||
|
*/
|
||
|
#include "common.h"
|
||
|
/*
|
||
|
************************************************************************************************************
|
||
|
*
|
||
|
* function
|
||
|
*
|
||
|
* name :
|
||
|
*
|
||
|
* parmeters :
|
||
|
*
|
||
|
* return :
|
||
|
*
|
||
|
* note :
|
||
|
*
|
||
|
*
|
||
|
************************************************************************************************************
|
||
|
*/
|
||
|
static int __IsFullName(const char *FilePath)
|
||
|
{
|
||
|
if ( FilePath[0] == '/')
|
||
|
{
|
||
|
return 1;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
return 0;
|
||
|
}
|
||
|
}
|
||
|
/*
|
||
|
************************************************************************************************************
|
||
|
*
|
||
|
* function
|
||
|
*
|
||
|
* name :
|
||
|
*
|
||
|
* parmeters :
|
||
|
*
|
||
|
* return :
|
||
|
*
|
||
|
* note :
|
||
|
*
|
||
|
*
|
||
|
************************************************************************************************************
|
||
|
*/
|
||
|
void sunxi_GetFullPath(char *dName, const char *sName)
|
||
|
{
|
||
|
char Buffer[MAX_PATH];
|
||
|
|
||
|
if(__IsFullName(sName))
|
||
|
{
|
||
|
strcpy(dName, sName);
|
||
|
return ;
|
||
|
}
|
||
|
|
||
|
/* Get the current working directory: */
|
||
|
if(getcwd(Buffer, MAX_PATH ) == NULL)
|
||
|
{
|
||
|
perror( "_getcwd error" );
|
||
|
return ;
|
||
|
}
|
||
|
sprintf(dName, "%s/%s", Buffer, sName);
|
||
|
}
|
||
|
/*
|
||
|
************************************************************************************************************
|
||
|
*
|
||
|
* function
|
||
|
*
|
||
|
* name :
|
||
|
*
|
||
|
* parmeters :
|
||
|
*
|
||
|
* return :
|
||
|
*
|
||
|
* note :
|
||
|
*
|
||
|
*
|
||
|
************************************************************************************************************
|
||
|
*/
|
||
|
void sunxi_dump(char *buf, int count)
|
||
|
{
|
||
|
int i,j;
|
||
|
|
||
|
for(j=0;j<count;j+=16)
|
||
|
{
|
||
|
for(i=0;i<16;i++)
|
||
|
{
|
||
|
printf("%02x ", buf[j+i] & 0xff);
|
||
|
}
|
||
|
printf("\n");
|
||
|
}
|
||
|
printf("\n");
|
||
|
}
|
||
|
/*
|
||
|
************************************************************************************************************
|
||
|
*
|
||
|
* function
|
||
|
*
|
||
|
* name :
|
||
|
*
|
||
|
* parmeters :
|
||
|
*
|
||
|
* return :
|
||
|
*
|
||
|
* note :
|
||
|
*
|
||
|
*
|
||
|
************************************************************************************************************
|
||
|
*/
|
||
|
|