ARM(920T)有四种反常(复位、未界说指令、预取指、数据间断)和三个中止(软件中止、IRQ中止、FIQ中止)
因此有七个向量,向量表如下:
1.跳转
Reset
bHandlerReset ;处理器默许运转形式是 中止向量0x00000000
bHandlerUndef 中止向量为0x00000004
bHandlerSWI中止向量为0x00000008
bHandlerPabort中止向量为0x0000000c
bHandlerDabort中止向量为0x00000010
b. ;.一共当时地址,一共当时地址死循环 0x00000014保存
bHandlerIRQ 中止向量为0x00000018
bHandlerFIQ 中止向量为0x0000001c
CPU内核默许的中止向量(VA)如上,假如当时未舱位MMU地址重映射,则PA的中止向量也为上面所述。
2.榜首次映射
LTORG
HandlerFIQ HANDLER HandleFIQ
HandlerIRQ HANDLER HandleIRQ
HandlerUndef HANDLER HandleUndef
HandlerSWI HANDLER HandleSWI
HandlerDabort HANDLER HandleDabort
HandlerPabort HANDLER HandlePabort
宏界说如下:
MACRO
$HandlerLabelHANDLER$HandleLabel;
$HandlerLabel
subsp,sp,#4;空出一个字
stmfdsp!,{r0};将R0入仓库,此刻的R0存在的数据是前一个形式所留传的,有必要加以保存
ldrr0,=$HandleLabel;RAM中的中止向量表
ldrr0,[r0] ;取此中止榜首个字晒干的内容
strr0,[sp,#4];先将SP指针加4个字节,后把R0存入,不更新sp
ldmfdsp!,{r0,pc};进行跳转
MEND
假如是IRQ中止则进入下列子程序进行IRQ子中止区分
ldrr0,=HandleIRQ;判别是哪个IRQ的子程序,树立IRQ中止在内存指针的重映射
ldrr1,=IRQ_SEV
strr1,[r0]
IRQ_SEV;子中止判别并跳转
subsp,sp,#4
stmfdsp!,{r8-r9}
ldrr9,=INTOFFSET
ldrr9,[r9]
ldrr8,=HandleEINT0
addr8,r8,r9,lsl #2
ldrr8,[r8]
strr8,[sp,#8]
ldmfdsp!,{r8-r9,pc}
内存中界说一个中止地址表寄存中止服务程序的开始地址(在府第言语中指定)
ALIGN
AREARWDATA,DATA,READWRITE
MAP_ISR_STARTADDRESS
HandleReset# 4 ;#–Field:界说一个结构化内存表中的数据域,该域为4个字节(32bit)
HandleUndef # 4
HandleSWI # 4
HandlePabort # 4
HandleDabort # 4
HandleReserved # 4
HandleIRQ # 4
HandleFIQ # 4
;以下是IRQ的子中止
HandleEINT0 # 4
HandleEINT1 # 4
HandleEINT2 # 4
HandleEINT3 # 4
HandleEINT4_7# 4
HandleEINT8_23# 4
HandleRSV6# 4
HandleBATFLT # 4
HandleTICK # 4
HandleWDT# 4
HandleTIMER0 # 4
HandleTIMER1 # 4
HandleTIMER2 # 4
HandleTIMER3 # 4
HandleTIMER4 # 4
HandleUART2 # 4
HandleLCD # 4
HandleDMA0# 4
HandleDMA1# 4
HandleDMA2# 4
HandleDMA3# 4
HandleMMC# 4
HandleSPI0# 4
HandleUART1# 4
HandleRSV24# 4
HandleUSBD# 4
HandleUSBH# 4
HandleIIC # 4
HandleUART0 # 4
HandleSPI1 # 4
HandleRTC # 4
HandleADC # 4
END
3.第2次映射(将中止服务子程序地址放入内存中的中止地址表)
#define pISR_RESET (*(unsigned *)(_ISR_STARTADDRESS+0x0))
#define pISR_UNDEF (*(unsigned *)(_ISR_STARTADDRESS+0x4))
#define pISR_SWI (*(unsigned *)(_ISR_STARTADDRESS+0x8))
#define pISR_PABORT (*(unsigned *)(_ISR_STARTADDRESS+0xc))
#define pISR_DABORT (*(unsigned *)(_ISR_STARTADDRESS+0x10))
#define pISR_RESERVED (*(unsigned *)(_ISR_STARTADDRESS+0x14))
#define pISR_IRQ (*(unsigned *)(_ISR_STARTADDRESS+0x18))
#define pISR_FIQ (*(unsigned *)(_ISR_STARTADDRESS+0x1c))
#define pISR_EINT0 (*(unsigned *)(_ISR_STARTADDRESS+0x20))
#define pISR_EINT1 (*(unsigned *)(_ISR_STARTADDRESS+0x24))
#define pISR_EINT2 (*(unsigned *)(_ISR_STARTADDRESS+0x28))
#define pISR_EINT3 (*(unsigned *)(_ISR_STARTADDRESS+0x2c))
#define pISR_EINT4_7 (*(unsigned *)(_ISR_STARTADDRESS+0x30))
#define pISR_EINT8_23 (*(unsigned *)(_ISR_STARTADDRESS+0x34))
#define pISR_NOTUSED6 (*(unsigned *)(_ISR_STARTADDRESS+0x38))
#define pISR_BAT_FLT (*(unsigned *)(_ISR_STARTADDRESS+0x3c))
#define pISR_TICK (*(unsigned *)(_ISR_STARTADDRESS+0x40))
#define pISR_WDT (*(unsigned *)(_ISR_STARTADDRESS+0x44))
#define pISR_TIMER0 (*(unsigned *)(_ISR_STARTADDRESS+0x48))
#define pISR_TIMER1 (*(unsigned *)(_ISR_STARTADDRESS+0x4c))
#define pISR_TIMER2 (*(unsigned *)(_ISR_STARTADDRESS+0x50))
#define pISR_TIMER3 (*(unsigned *)(_ISR_STARTADDRESS+0x54))
#define pISR_TIMER4 (*(unsigned *)(_ISR_STARTADDRESS+0x58))
#define pISR_UART2 (*(unsigned *)(_ISR_STARTADDRESS+0x5c))
#define pISR_LCD (*(unsigned *)(_ISR_STARTADDRESS+0x60))
#define pISR_DMA0 (*(unsigned *)(_ISR_STARTADDRESS+0x64))
#define pISR_DMA1 (*(unsigned *)(_ISR_STARTADDRESS+0x68))
#define pISR_DMA2 (*(unsigned *)(_ISR_STARTADDRESS+0x6c))
#define pISR_DMA3 (*(unsigned *)(_ISR_STARTADDRESS+0x70))
#define pISR_SDI (*(unsigned *)(_ISR_STARTADDRESS+0x74))
#define pISR_SPI0 (*(unsigned *)(_ISR_STARTADDRESS+0x78))
#define pISR_UART1 (*(unsigned *)(_ISR_STARTADDRESS+0x7c))
#define pISR_NOTUSED24 (*(unsigned *)(_ISR_STARTADDRESS+0x80))
#define pISR_USBD (*(unsigned *)(_ISR_STARTADDRESS+0x84))
#define pISR_USBH (*(unsigned *)(_ISR_STARTADDRESS+0x88))
#define pISR_I%&&&&&% (*(unsigned *)(_ISR_STARTADDRESS+0x8c))
#define pISR_UART0 (*(unsigned *)(_ISR_STARTADDRESS+0x90))
#define pISR_SPI1 (*(unsigned *)(_ISR_STARTADDRESS+0x94))
#define pISR_RTC (*(unsigned *)(_ISR_STARTADDRESS+0x98))
#define pISR_ADC (*(unsigned *)(_ISR_STARTADDRESS+0x9c))
pISR_UNDEF = (unsigned)HaltUndef; //将中止处理程序进口地址放入中止变量地址所指向的内存空间
pISR_SWI = (unsigned)HaltSwi; //往中止地址表中填入中止服务子程序地址
pISR_PABORT = (unsigned)HaltPabort;
pISR_DABORT = (unsigned)HaltDabort;
pISR_EINT1 = (unsigned)Eint1Int;
声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/qiche/dianzi/264576.html