rem: u32 id,level,ret = 0; exibus_priv *exi = &eximap[nChn];
add: u32 level,ret; exibus_priv *exi = NULL; #ifdef _EXI_DEBUG printf("EXI_Attach(%d)\n",nChn); #endif if(nChn<EXI_CHANNEL_0 || nChn>=EXI_CHANNEL_2) return 0; exi = &eximap[nChn];
context: u32 EXI_Attach(u32 nChn,EXICallback ext_cb){	u32 id,level,ret = 0;	exibus_priv *exi = &eximap[nChn];	if(__exi_probe(nChn) && !exi->exi_id) EXI_GetID(nChn,EXI_DEVICE_0,&id);	_CPU_ISR_Disable(level);	if(exi->exi_id) {		_CPU_ISR_Disable(level);		if(!(exi->flags&EXI_FLAG_ATTACH)) {			if(__exi_probe(nChn)) {				exi->CallbackEXT = ext_cb;				__exi_clearirqs(nChn,1,0,0);				__UnmaskIrq(IRQMASK((IRQ_EXI0_EXT+(nChn*3))));				exi->flags |= EXI_FLAG_ATTACH;				ret = 1;			}		}		_CPU_ISR_Restore(level);	}	_CPU_ISR_Restore(level);#ifdef _EXI_DEBUG	printf("EXI_Attach(exi_id = %d)\n",id);#endif	return ret;	}