critical_intr.c

来自「基于ADI 公司的blackfin芯片的通用中断框架程序」· C语言 代码 · 共 99 行

C
99
字号
#include <stdio.h>


void exception_handler(unsigned event, unsigned long breakpoint)
{   
    switch(event)
    {
    case 0x10:
    	puts("The processor is now in single step mode!");
    	break;
    	
    case 0x11:
    	puts("Trace buffer overflowed!");
    	break;
    	
    case 0x21:
    	puts("undefined instruction!");
    	break;
    	
    case 0x22:
    	puts("illegal instruction combination!");
    	break;
    	
    case 0x23:
    	puts("Data access CPLB protection violation!");
    	break;
    	
    case 0x24:
    	puts("Data access mis-aligned address violation!");
    	break;
    	
    case 0x25:
    	puts("Unrecoverable event caused!");
    	break;
    	
    case 0x26:
    	puts("Data access CPLB miss!");
    	break;
    	
    case 0x27:
    	puts("Data access multiple CPLB hits!");
    	break;
    	
    case 0x28:
    	puts("Exception caused by an emulation watch point match!");
    	break;
    	
    case 0x2a:
    	puts("Instruction fetch mis-aligned address violation!");
    	break;
    	
    case 0x2b:
    	puts("Instruction fetch CPLB protection violation!");
    	break;
    	
    case 0x2c:
    	puts("Instruction fetch CPLB miss!");
    	break;
    	
    case 0x2d:
    	puts("Instruction fetch multiple CPLB hits!");
    	break;
    	
    case 0x2e:
    	puts("Illegel use of supervisor resource!");
    	break;
    }
    
    printf("The instruction halt at: %x\n", breakpoint);
}



void hardware_error_handler(unsigned event, unsigned long breakpoint)
{
    switch(event)
    {
    case 0x08000:
    	puts("System MMR error!");
    	break;
    	
    case 0x0c000:
    	puts("External memory addressing error!");
    	break;
    	
    case 0x48000:
    	puts("Performance monitor overflow!");
    	break;
    	
    default:
    	puts("Other errors!");
    	break;
    }
    
    printf("The instruction halt at: %x\n", breakpoint);
}


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?