rem: struct timespec tb;
context: static s32 __sdcard_multidatawrite(s32 chn,void *buf,u32 len){	u8 dummy[32];	u16 crc;	u32 cnt;	s32 ret;	struct timespec tb;	sdcard_block *card = NULL;	if(chn<EXI_CHANNEL_0 || chn>=EXI_CHANNEL_2) return SDCARD_ERROR_NOCARD;	card = &sdcard_map[chn];	for(cnt=0;cnt<32;cnt++) dummy[cnt] = clr_flag;	crc = __make_crc16(buf,len);		if(EXI_Lock(chn,EXI_DEVICE_0,NULL)==0) return SDCARD_ERROR_FATALERROR;	if(EXI_Select(chn,EXI_DEVICE_0,sdcard_freq)==0) {		EXI_Unlock(chn);		return SDCARD_ERROR_NOCARD;	}	dummy[0] = 0xfc;	if(EXI_ImmEx(chn,dummy,1,EXI_WRITE)==0) {		EXI_Deselect(chn);		EXI_Unlock(chn);		return SDCARD_ERROR_IOERROR;	}	if(EXI_ImmEx(chn,buf,len,EXI_WRITE)==0) {		EXI_Deselect(chn);		EXI_Unlock(chn);		return SDCARD_ERROR_IOERROR;	}	/* setalarm, wait */	tb.tv_sec = 0;	tb.tv_nsec = 40*TB_NSPERMS;	SYS_SetAlarm(&card->timeout_svc,&tb,__timeout_handler);	LWP_SleepThread(card->alarm_queue);	ret = SDCARD_ERROR_READY;	if(EXI_ImmEx(chn,&crc,2,EXI_WRITE)==0) ret = SDCARD_ERROR_IOERROR;	EXI_Deselect(chn);	EXI_Unlock(chn);	return ret;}