rem: static s32 __card_formatregion(u32 chn,u32 encode,cardcallback callback)
add: static s32 __card_formatregion(s32 chn,u32 encode,cardcallback callback)
context: static s32 __card_formatregion(u32 chn,u32 encode,cardcallback callback){	s32 ret;	u32 srambase,cnt,thi,tlo;	u64 time;	void *workarea,*memblock;	cardcallback cb = NULL;	card_block *card = NULL;	struct card_bat *fatblock = NULL;	struct card_dircntrl *dircntrl = NULL;#ifdef _CARD_DEBUG	printf("__card_formatregion(%d,%d,%p)\n",chn,encode,callback);#endif	if(chn<EXI_CHANNEL_0 || chn>=EXI_CHANNEL_2) return CARD_ERROR_NOCARD;	if((ret=__card_getcntrlblock(chn,&card))<0) return ret;		workarea = card->workarea;	memset(workarea,0xff,8192);		srambase = __SYS_LockSram();	((u32*)workarea)[5] = ((u32*)srambase)[3];	((u32*)workarea)[6] = ((u8*)srambase)[18];	__SYS_UnlockSram(0);	cnt = 0;	time = gettime();	thi = time>>32;	tlo = time;		srambase = __SYS_LockSramEx();	while(cnt<12) {				cnt++;	}	__SYS_UnlockSramEx(0);	*(u64*)(((u32*)workarea)[3]) = time;	((u32*)workarea)[8] = 0;	((u16*)workarea)[17] = card->card_size;	__card_checksum(workarea,508,&((u16*)workarea)[254],&((u16*)workarea)[255]);		cnt = 0;	while(cnt<2) {		memblock = workarea+((cnt+1)<<13);		dircntrl = memblock+8128;		memset(memblock,255,8192);		__card_checksum(memblock,8188,&dircntrl->chksum1,&dircntrl->chksum2);		cnt++;	}	cnt = 0;	while(cnt<2) {		memblock = workarea+((cnt+3)<<13);		fatblock = memblock;		memset(memblock,0,8192);		fatblock->updated = cnt;		fatblock->freeblocks = card->blocks-CARD_SYSAREA;		fatblock->lastalloc = 4;		__card_checksum(memblock+4,8188,&fatblock->chksum1,&fatblock->chksum2);		cnt++;	}	cb = callback;	if(!cb) cb = __card_defaultapicallback;	card->card_api_cb = cb;		DCStoreRange(card->workarea,0xA000);		card->format_step = 0;	if((ret=__card_sectorerase(chn,(card->sector_size*card->format_step),__format_callback))>=0) return ret;	__card_putcntrlblock(card,ret);	return ret;}