www.pudn.com > s3c2443_test_code.zip > Exception.c


 
#include "System.h" 
 
//=================================================================== 
void HaltUndef(void) 
{ 
	printf("Undefined instruction exception.\n"); 
	while(1); 
} 
 
//=================================================================== 
void HaltSwi(void) 
{ 
	printf("SWI exception.\n"); 
	while(1); 
} 
 
//=================================================================== 
void HaltPabort(void) 
{ 
	printf("IFSR=0x%x\n",MMU_ReadIFSR()); 
	printf("FAR=0x%x\n",MMU_ReadFAR()); 
	printf("Pabort exception.\n"); 
	while(1); 
} 
 
//=================================================================== 
void HaltDabort(void) 
{ 
	printf("DFSR=0x%x\n",MMU_ReadDFSR()); 
	printf("FAR=0x%x\n",MMU_ReadFAR()); 
	printf("Dabort exception.\n"); 
	while(1); 
} 
 
 
void Isr_Init(void) 
{ 
    pISR_UNDEF	= (unsigned)HaltUndef; 
    pISR_SWI  	= (unsigned)HaltSwi; 
    pISR_PABORT	= (unsigned)HaltPabort; 
    pISR_DABORT	= (unsigned)HaltDabort; 
	pISR_IRQ	= (unsigned)IsrIRQ; 
 
    rINTMOD	= 0x0;	  // All=IRQ mode 
    rINTMSK	= BIT_ALLMSK;	  // All interrupt is masked. 
 
	CLR_IF(); 
}