⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 critical_intr.c

📁 基于ADI 公司的blackfin芯片的通用中断框架程序
💻 C
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -