fix warning

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@232 4ee2a332-4b2b-5046-8439-1ba90f034370
This commit is contained in:
shirait 2007-08-09 04:10:27 +00:00
parent 4aa053eca9
commit 0d3ae3a16d
7 changed files with 35 additions and 22 deletions

View File

@ -112,7 +112,6 @@ void nandSetFormatRequest( u16 partition_num, u32* partition_sectors)
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
BOOL nandCheckMedia( void) //TODO:nand partition仕様に対応させること BOOL nandCheckMedia( void) //TODO:nand partition仕様に対応させること
{ {
u16 i;
SdmcResultInfo SdResult; SdmcResultInfo SdResult;
u8* bufp; u8* bufp;
u32 buffer[512/4]; u32 buffer[512/4];
@ -160,6 +159,7 @@ BOOL nandRtfsIo( int driveno, dword block, void* buffer, word count, BOOLEAN rea
{ {
u16 result; u16 result;
SdmcResultInfo SdResult; SdmcResultInfo SdResult;
#pragma unused( driveno)
/**/ /**/
sdmcSelect( (u16)SDMC_PORT_NAND); sdmcSelect( (u16)SDMC_PORT_NAND);
@ -201,7 +201,6 @@ int nandRtfsCtrl( int driveno, int opcode, void* pargs)
{ {
DDRIVE *pdr; DDRIVE *pdr;
DEV_GEOMETRY gc; DEV_GEOMETRY gc;
int heads, secptrack;
/**/ /**/
sdmcSelect( (u16)SDMC_PORT_NAND); sdmcSelect( (u16)SDMC_PORT_NAND);
@ -634,7 +633,7 @@ static BOOL sdi_get_nom( u32 MIN_NOM)
/*FATのビット数を返す*/ /*FATのビット数を返す*/
static void sdi_get_fatparams( void) static void sdi_get_fatparams( void)
{ {
int i, mbytes; u32 i, mbytes;
for( i=0; i<NAND_FAT_PARTITION_COUNT; i++) { for( i=0; i<NAND_FAT_PARTITION_COUNT; i++) {
// mbytes = (sdmc_current_spec.card_capacity / (1024 * 1024)) * 512; // mbytes = (sdmc_current_spec.card_capacity / (1024 * 1024)) * 512;
@ -700,7 +699,7 @@ static void sdi_build_partition_table( void)
u32 starting_head[4], starting_sect[4], starting_cyl[4]; u32 starting_head[4], starting_sect[4], starting_cyl[4];
u32 ending_head[4], ending_sect[4], ending_cyl[4]; u32 ending_head[4], ending_sect[4], ending_cyl[4];
u32 total_sect[4]; u32 total_sect[4];
u32 starting_data[4], ending_data[4]; // u32 starting_data[4], ending_data[4];
u32 systemid[4]; u32 systemid[4];
u16 i; u16 i;

View File

@ -141,6 +141,7 @@ BOOL sdmcRtfsIo( int driveno, dword block, void* buffer, word count, BOOLEAN rea
{ {
u16 result; u16 result;
SdmcResultInfo SdResult; SdmcResultInfo SdResult;
#pragma unused( driveno)
/**/ /**/
sdmcSelect( (u16)SDMC_PORT_CARD); sdmcSelect( (u16)SDMC_PORT_CARD);
@ -182,7 +183,6 @@ int sdmcRtfsCtrl( int driveno, int opcode, void* pargs)
{ {
DDRIVE *pdr; DDRIVE *pdr;
DEV_GEOMETRY gc; DEV_GEOMETRY gc;
int heads, secptrack;
/**/ /**/
sdmcSelect( (u16)SDMC_PORT_CARD); sdmcSelect( (u16)SDMC_PORT_CARD);
@ -235,8 +235,8 @@ int sdmcRtfsCtrl( int driveno, int opcode, void* pargs)
gc.fmt.oemname[1] = 'W'; gc.fmt.oemname[1] = 'W';
gc.fmt.oemname[2] = 'L'; gc.fmt.oemname[2] = 'L';
gc.fmt.oemname[3] = '\0'; gc.fmt.oemname[3] = '\0';
gc.fmt.secpalloc = sdmc_current_spec.SC; /*sectors per cluster(FIX by capacity)*/ gc.fmt.secpalloc = (u8)(sdmc_current_spec.SC); /*sectors per cluster(FIX by capacity)*/
gc.fmt.secreserved = sdmc_current_spec.RSC;//sdmc_current_spec.RSC;/*reserved sectors(FIX 1 at FAT12,16)*/ gc.fmt.secreserved = (u16)(sdmc_current_spec.RSC);//sdmc_current_spec.RSC;/*reserved sectors(FIX 1 at FAT12,16)*/
gc.fmt.numfats = 2; gc.fmt.numfats = 2;
gc.fmt.secpfat = sdmc_current_spec.SF; gc.fmt.secpfat = sdmc_current_spec.SF;
gc.fmt.numhide = sdmc_current_spec.NOM; /**/ gc.fmt.numhide = sdmc_current_spec.NOM; /**/
@ -245,7 +245,7 @@ int sdmcRtfsCtrl( int driveno, int opcode, void* pargs)
gc.fmt.secptrk = sdmc_current_spec.secptrack; //CHS Recommendation gc.fmt.secptrk = sdmc_current_spec.secptrack; //CHS Recommendation
gc.fmt.numhead = sdmc_current_spec.heads; gc.fmt.numhead = sdmc_current_spec.heads;
gc.fmt.numcyl = sdmc_current_spec.cylinders; gc.fmt.numcyl = sdmc_current_spec.cylinders;
gc.fmt.physical_drive_no = driveno; gc.fmt.physical_drive_no = (u8)driveno;
gc.fmt.binary_volume_label = BIN_VOL_LABEL; gc.fmt.binary_volume_label = BIN_VOL_LABEL;
gc.fmt.text_volume_label[0] = '\0'; gc.fmt.text_volume_label[0] = '\0';
//TODO:dev_geometry_lbasもセットする必要あるか調べること //TODO:dev_geometry_lbasもセットする必要あるか調べること
@ -392,7 +392,7 @@ BOOL sdmcRtfsAttach( int driveno)
/*SD File System Specification(仕様書)に基づいた値を出す*/ /*SD File System Specification(仕様書)に基づいた値を出す*/
static void sdi_get_CHS_params( void) static void sdi_get_CHS_params( void)
{ {
int mbytes; u32 mbytes;
// mbytes = (sdmc_current_spec.card_capacity / (1024 * 1024)) * 512; // mbytes = (sdmc_current_spec.card_capacity / (1024 * 1024)) * 512;
mbytes = (sdmc_current_spec.card_capacity >> 11); mbytes = (sdmc_current_spec.card_capacity >> 11);

View File

@ -227,14 +227,14 @@ void (*func_SDCARD_Out)(void); /*
Returns: None Returns: None
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
static void MyCpuRecv32( const u32* src, u32* dest, u16 size) static void MyCpuRecv32( const u32* src, u32* dest, u32 size)
{ {
u32 i; u32 i;
for( i=0; i<(size/sizeof(u32)); i++) { for( i=0; i<(size/sizeof(u32)); i++) {
*(u32*)dest++ = *(u32*)src; *(u32*)dest++ = *(u32*)src;
} }
} }
static void MyCpuRecv16( const u16* src, u16* dest, u16 size) static void MyCpuRecv16( const u16* src, u16* dest, u32 size)
{ {
u32 i; u32 i;
for( i=0; i<(size/sizeof(u16)); i++) { for( i=0; i<(size/sizeof(u16)); i++) {
@ -811,8 +811,8 @@ void i_sdmcCalcSize( void)
sdmc_current_spec.memory_capacity = ulCSize; sdmc_current_spec.memory_capacity = ulCSize;
ulSDCARD_Size = ulCSize; ulSDCARD_Size = ulCSize;
/* プロテクト領域サイズ算出 */ /* プロテクト領域サイズ算出 */
sdmc_current_spec.protected_capacity = (((SD_SwapByte( &SD_SDSTATUS[2])) << 16) + sdmc_current_spec.protected_capacity = (u32)((((SD_SwapByte( &SD_SDSTATUS[2])) << 16) +
(SD_SwapByte( &SD_SDSTATUS[3]))) / 0x200; (SD_SwapByte( &SD_SDSTATUS[3]))) / 0x200);
/*トータルサイズ算出 */ /*トータルサイズ算出 */
sdmc_current_spec.card_capacity = sdmc_current_spec.memory_capacity + sdmc_current_spec.card_capacity = sdmc_current_spec.memory_capacity +
sdmc_current_spec.protected_capacity; sdmc_current_spec.protected_capacity;
@ -821,13 +821,13 @@ void i_sdmcCalcSize( void)
sdmc_current_spec.csd_ver2_flag = 0; sdmc_current_spec.csd_ver2_flag = 0;
ulCSize = (u32)(((SD_CSD[3] & CSD_C_SIZE_BIT_71_62) >> 6) + ulCSize = (u32)(((SD_CSD[3] & CSD_C_SIZE_BIT_71_62) >> 6) +
((SD_CSD[4] & CSD_C_SIZE_BIT_73_72) << 10) + 1); ((SD_CSD[4] & CSD_C_SIZE_BIT_73_72) << 10) + 1);
mult_val = ((SD_CSD[2] & CSD_C_SIZE_MULT) >> 7) + 2; //2Ì<E2809A>æ<EFBFBD> mult_val = (u16)(((SD_CSD[2] & CSD_C_SIZE_MULT) >> 7) + 2); //2Ì<E2809A>æ<EFBFBD>
ulCSize = ulCSize << mult_val; ulCSize = ulCSize << mult_val;
if(SDCARD_MMCFlag){ /* MMCカードフラグON かチェック */ if(SDCARD_MMCFlag){ /* MMCカードフラグON かチェック */
read_block_len_val = ((SD_CSD[4] & CSD_READ_BL_LEN) >> 8); read_block_len_val = (u16)((SD_CSD[4] & CSD_READ_BL_LEN) >> 8);
ulCSize = (ulCSize << read_block_len_val); ulCSize = (ulCSize << read_block_len_val);
}else{ /* SDカードフラグ(SDCARD_SDFlag)ON のはず */ }else{ /* SDカードフラグ(SDCARD_SDFlag)ON のはず */
read_block_len_val = (((SD_CSD[1] & CSD_WRITE_BL_LEN_BIT_25_24) << 2) | read_block_len_val = (u16)(((SD_CSD[1] & CSD_WRITE_BL_LEN_BIT_25_24) << 2) |
((SD_CSD[0] & CSD_WRITE_BL_LEN_BIT_23_22) >> 14)); ((SD_CSD[0] & CSD_WRITE_BL_LEN_BIT_23_22) >> 14));
ulCSize = (ulCSize << read_block_len_val); ulCSize = (ulCSize << read_block_len_val);
} }
@ -836,8 +836,8 @@ void i_sdmcCalcSize( void)
sdmc_current_spec.memory_capacity = ulCSize; sdmc_current_spec.memory_capacity = ulCSize;
ulSDCARD_Size += ulCSize; /* 全セクタ数のセット */ ulSDCARD_Size += ulCSize; /* 全セクタ数のセット */
/* プロテクト領域サイズ算出 */ /* プロテクト領域サイズ算出 */
sdmc_current_spec.protected_capacity = ((SD_SwapByte( &SD_SDSTATUS[2])) << 16) + sdmc_current_spec.protected_capacity = (u32)((SD_SwapByte( &SD_SDSTATUS[2])) << 16) +
(SD_SwapByte( &SD_SDSTATUS[3])); (SD_SwapByte( &SD_SDSTATUS[3]));
sdmc_current_spec.protected_capacity <<= mult_val; sdmc_current_spec.protected_capacity <<= mult_val;
sdmc_current_spec.protected_capacity <<= read_block_len_val; sdmc_current_spec.protected_capacity <<= read_block_len_val;
sdmc_current_spec.protected_capacity /= SDCARD_SectorSize; //TODO:構造体にまとめること sdmc_current_spec.protected_capacity /= SDCARD_SectorSize; //TODO:構造体にまとめること
@ -1126,6 +1126,7 @@ static SDMC_ERR_CODE SDCARDi_Read(void* buf,u32 bufsize,u32 offset,void(*func)(v
s16 nRetryCount; /* リトライ回数カウント */ s16 nRetryCount; /* リトライ回数カウント */
SDMC_ERR_CODE SaveErrStatus; /* エラーステータス保存用 */ SDMC_ERR_CODE SaveErrStatus; /* エラーステータス保存用 */
u32 SaveStatus; /* カードステータス保存用 */ u32 SaveStatus; /* カードステータス保存用 */
#pragma unused( func)
for( nRetryCount=0; nRetryCount<SDCARD_RETRY_COUNT; nRetryCount++) { for( nRetryCount=0; nRetryCount<SDCARD_RETRY_COUNT; nRetryCount++) {
@ -1449,6 +1450,8 @@ static void SDCARD_TimerStop(void)
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
static void SDCARD_Timer_irq(void* arg) static void SDCARD_Timer_irq(void* arg)
{ {
#pragma unused( arg)
#if (SD_DEBUG_PRINT_ON == 1) #if (SD_DEBUG_PRINT_ON == 1)
u16 tmp; u16 tmp;
@ -1756,9 +1759,11 @@ static u16 SDCARD_SD_Status(void)
/*******************************************************************************/ /*******************************************************************************/
int MMCP_SetBusWidth( BOOL b4bit) int MMCP_SetBusWidth( BOOL b4bit)
{ {
#if 0
u32 ulSave_SectorSize; /* セクタサイズ保存用 */ u32 ulSave_SectorSize; /* セクタサイズ保存用 */
// u16 TestData; // u16 TestData;
u16 Resid; u16 Resid;
#endif
SD_EnableClock(); /* SD-CLK Enable */ SD_EnableClock(); /* SD-CLK Enable */
@ -2395,6 +2400,7 @@ static void SDCARD_Thread( void* arg)
SDCARDMsg* SdMsg; SDCARDMsg* SdMsg;
OSMessage current_dat; OSMessage current_dat;
SDMC_ERR_CODE api_result; SDMC_ERR_CODE api_result;
#pragma unused( arg)
while( TRUE) { while( TRUE) {
/* メッセージ待ち */ /* メッセージ待ち */
@ -2459,7 +2465,8 @@ static void SDCARD_Intr_Thread( void* arg)
{ {
static i = 0; static i = 0;
u16 sd_info1;//, sd_info2; u16 sd_info1;//, sd_info2;
OSIntrMode enabled; // OSIntrMode enabled;
#pragma unused( arg)
OS_EnableInterrupts(); OS_EnableInterrupts();
OS_EnableIrq(); OS_EnableIrq();

View File

@ -31,6 +31,7 @@ static BOOL load_strndx_done = FALSE;
static u8 *load_elf32_byte(u8 *dest, u8 *org, int lsb) static u8 *load_elf32_byte(u8 *dest, u8 *org, int lsb)
{ {
u8 *temp_ptr; u8 *temp_ptr;
#pragma unused( lsb)
temp_ptr = (u8 *)org; temp_ptr = (u8 *)org;
*dest = *temp_ptr; *dest = *temp_ptr;

View File

@ -751,6 +751,8 @@ void* elFreeAdrTbl( void)
-----------------------------------------------------*/ -----------------------------------------------------*/
static void i_elReadFile( void* buf, void* file_struct, u32 file_base, u32 file_offset, u32 size) static void i_elReadFile( void* buf, void* file_struct, u32 file_base, u32 file_offset, u32 size)
{ {
#pragma unused( file_base)
#if (TARGET_OS_NITRO == 1) #if (TARGET_OS_NITRO == 1)
FS_SeekFile( file_struct, (s32)(file_offset), FS_SEEK_SET); FS_SeekFile( file_struct, (s32)(file_offset), FS_SEEK_SET);
FS_ReadFile( file_struct, buf, (s32)(size)); FS_ReadFile( file_struct, buf, (s32)(size));
@ -762,6 +764,8 @@ static void i_elReadFile( void* buf, void* file_struct, u32 file_base, u32 file_
static void i_elReadMem( void* buf, void* file_struct, u32 file_base, u32 file_offset, u32 size) static void i_elReadMem( void* buf, void* file_struct, u32 file_base, u32 file_offset, u32 size)
{ {
#pragma unused( file_struct)
OSAPI_CPUCOPY8( (void*)(file_base + file_offset), OSAPI_CPUCOPY8( (void*)(file_base + file_offset),
buf, buf,
size); size);
@ -771,6 +775,8 @@ static void i_elReadMem( void* buf, void* file_struct, u32 file_base, u32 file_o
//#else //#else
static void i_elReadUsr( void* buf, void* file_struct, u32 file_base, u32 file_offset, u32 size) static void i_elReadUsr( void* buf, void* file_struct, u32 file_base, u32 file_offset, u32 size)
{ {
#pragma unused( file_struct, file_base)
i_elReadImage( file_offset, buf, size); i_elReadImage( file_offset, buf, size);
} }
//#endif //#endif

View File

@ -791,13 +791,13 @@ BOOL i_elDoRelocate( ElDesc* elElfDesc, ElUnresolvedEntry* UnresolvedInfo)
signed_val = (( (s32)(_S_) + _A_) | (s32)(_T_)) - (s32)(_P_); signed_val = (( (s32)(_S_) + _A_) | (s32)(_T_)) - (s32)(_P_);
signed_val >>= 1; signed_val >>= 1;
if( _T_) { /*BL命令でThumbからThumbに飛ぶ*/ if( _T_) { /*BL命令でThumbからThumbに飛ぶ*/
relocation_val = (*(vu16*)relocation_adr & 0xF800) | ((signed_val>>11) & 0x07FF) + relocation_val = (u32)(*(vu16*)relocation_adr & 0xF800) | ((signed_val>>11) & 0x07FF) +
((((*((vu16*)(relocation_adr)+1)) & 0xF800) | (signed_val & 0x07FF)) << 16); ((((*((vu16*)(relocation_adr)+1)) & 0xF800) | (signed_val & 0x07FF)) << 16);
}else{ /*BLX命令でThumbからARMに飛ぶ(v5未満だとBL→ベニアでBXという仕組みが必要)*/ }else{ /*BLX命令でThumbからARMに飛ぶ(v5未満だとBL→ベニアでBXという仕組みが必要)*/
if( (signed_val & 0x1)) { //_P_が4バイトアラインされていないとここに来る if( (signed_val & 0x1)) { //_P_が4バイトアラインされていないとここに来る
signed_val += 1; signed_val += 1;
} }
relocation_val = (*(vu16*)relocation_adr & 0xF800) | ((signed_val>>11) & 0x07FF) + relocation_val = (u32)(*(vu16*)relocation_adr & 0xF800) | ((signed_val>>11) & 0x07FF) +
((((*((vu16*)(relocation_adr)+1)) & 0xE800) | (signed_val & 0x07FF)) << 16); ((((*((vu16*)(relocation_adr)+1)) & 0xE800) | (signed_val & 0x07FF)) << 16);
} }
*(vu16*)relocation_adr = (vu16)relocation_val; *(vu16*)relocation_adr = (vu16)relocation_val;

View File

@ -204,7 +204,6 @@ void TwlSpMain(void)
#endif #endif
/*----------------------------*/ /*----------------------------*/
#else
sdmcSelect( (u16)SDMC_PORT_CARD); sdmcSelect( (u16)SDMC_PORT_CARD);
DEBUG_BEGIN(); DEBUG_BEGIN();
@ -228,6 +227,7 @@ void TwlSpMain(void)
PRINTDEBUG( "sdmcWriteFifo success.\n"); PRINTDEBUG( "sdmcWriteFifo success.\n");
} }
#else
/*デバイスドライバの登録*/ /*デバイスドライバの登録*/