target/linux/at91/image/dfboot/src/include/lib_AT91RM9200.h
//*----------------------------------------------------------------------------
//* \fn    AT91F_AIC_Open
//* \brief Set exception vectors and AIC registers to default values
//*----------------------------------------------------------------------------
\fn    AT91F_AIC_Open
\brief Set exception vectors and AIC registers to default values
\ fn AT91F_AIC_Open \ brief Set exception vectors and AIC registers to default values
static inline void AT91F_AIC_Open(
	AT91PS_AIC pAic,        
	void (*IrqHandler) (),  
	void (*FiqHandler) (),  
	void (*DefaultHandler)  (), 
	void (*SpuriousHandler) (), 
	unsigned int protectMode)   
{
	int i;
	for (i = 0; i < 32; ++i) {
		AT91F_AIC_DisableIt(pAic, i);
		AT91F_AIC_ConfigureIt(pAic, i, AT91C_AIC_PRIOR_LOWEST, AT91C_AIC_SRCTYPE_INT_LEVEL_SENSITIVE, DefaultHandler);
	}
	AT91F_AIC_SetExceptionVector((unsigned int *) 0x18, IrqHandler);
	AT91F_AIC_SetExceptionVector((unsigned int *) 0x1C, FiqHandler);
	pAic->AIC_SPU = (unsigned int) SpuriousHandler;
	pAic->AIC_DCR = protectMode;
}
static inline void AT91F_AIC_Open ( AT91PS_AIC pAic , void ( * IrqHandler ) ( ) , void ( * FiqHandler ) ( ) , void ( * DefaultHandler ) ( ) , void ( * SpuriousHandler ) ( ) , unsigned int protectMode ) { int i ; for ( i = 0 ; i < 32 ; ++ i ) { AT91F_AIC_DisableIt ( pAic , i ) ; AT91F_AIC_ConfigureIt ( pAic , i , AT91C_AIC_PRIOR_LOWEST , AT91C_AIC_SRCTYPE_INT_LEVEL_SENSITIVE , DefaultHandler ) ; } AT91F_AIC_SetExceptionVector ( ( unsigned int * ) 0x18 , IrqHandler ) ; AT91F_AIC_SetExceptionVector ( ( unsigned int * ) 0x1C , FiqHandler ) ; pAic -> AIC_SPU = ( unsigned int ) SpuriousHandler ; pAic -> AIC_DCR = protectMode ; }
\fn    AT91F_AIC_Open
\brief Set exception vectors and AIC registers to default values
\ fn AT91F_AIC_Open \ brief Set exception vectors and AIC registers to default values
// \arg pointer to the AIC registers // \arg Default IRQ vector exception // \arg Default FIQ vector exception // \arg Default Handler set in ISR // \arg Default Spurious Handler // \arg Debug Control Register // Disable all interrupts and set IVR to the default handler // Set the IRQ exception vector // Set the Fast Interrupt exception vector