AM335X StarterWare 自带bootloader对IRQ的处理
来源:互联网 发布:优化神马pc关键词排名 编辑:程序博客网 时间:2024/06/05 01:59
IRQHandler:
SUB r14, r14, #4 @ Apply lr correction
STMFD r13!, {r0-r3, r12, r14} @ Save context
MRS r12, spsr @ Copy spsr
VMRS r1, FPSCR @ Copy fpscr
STMFD r13!, {r1, r12} @ Save spsr and fpscr
VSTMDB r13!, {d0-d7} @ Save D0-D7 NEON/VFP registers
LDR r0, =ADDR_THRESHOLD @ Get the IRQ Threshold
LDR r1, [r0, #0]
STMFD r13!, {r1} @ Save the threshold value
LDR r2, =ADDR_IRQ_PRIORITY @ Get the active IRQ priority
LDR r3, [r2, #0]
STR r3, [r0, #0] @ Set the priority as threshold
LDR r1, =ADDR_SIR_IRQ @ Get the Active IRQ
LDR r2, [r1]
AND r2, r2, #MASK_ACTIVE_IRQ @ Mask the Active IRQ number
MOV r0, #NEWIRQAGR @ To enable new IRQ Generation
LDR r1, =ADDR_CONTROL
CMP r3, #0 @ Check if non-maskable priority 0
STRNE r0, [r1] @ if > 0 priority, acknowledge INTC
DSB @ Make sure acknowledgement is completed
@
@ Enable IRQ and switch to system mode. But IRQ shall be enabled
@ only if priority level is > 0. Note that priority 0 is non maskable.
@ Interrupt Service Routines will execute in System Mode.
@
MRS r14, cpsr @ Read cpsr
ORR r14, r14, #MODE_SYS
BICNE r14, r14, #I_BIT @ Enable IRQ if priority > 0
MSR cpsr, r14
STMFD r13!, {r14} @ Save lr_usr
LDR r0, =fnRAMVectors @ Load the base of the vector table
ADD r14, pc, #0 @ Save return address in LR
LDR pc, [r0, r2, lsl #2] @ Jump to the ISR
LDMFD r13!, {r14} @ Restore lr_usr
@
@ Disable IRQ and change back to IRQ mode
@
CPSID i, #MODE_IRQ
LDR r0, =ADDR_THRESHOLD @ Get the IRQ Threshold
LDR r1, [r0, #0]
CMP r1, #0 @ If priority 0
MOVEQ r2, #NEWIRQAGR @ Enable new IRQ Generation
LDREQ r1, =ADDR_CONTROL
STREQ r2, [r1]
LDMFD r13!, {r1}
STR r1, [r0, #0] @ Restore the threshold value
VLDMIA r13!, {d0-d7} @ Restore D0-D7 Neon/VFP registers
LDMFD r13!, {r1, r12} @ Get fpscr and spsr
MSR spsr, r12 @ Restore spsr
VMSR fpscr, r1 @ Restore fpscr
LDMFD r13!, {r0-r3, r12, pc}^ @ Restore the context and return
SUB r14, r14, #4 @ Apply lr correction
STMFD r13!, {r0-r3, r12, r14} @ Save context
MRS r12, spsr @ Copy spsr
VMRS r1, FPSCR @ Copy fpscr
STMFD r13!, {r1, r12} @ Save spsr and fpscr
VSTMDB r13!, {d0-d7} @ Save D0-D7 NEON/VFP registers
LDR r0, =ADDR_THRESHOLD @ Get the IRQ Threshold
LDR r1, [r0, #0]
STMFD r13!, {r1} @ Save the threshold value
LDR r2, =ADDR_IRQ_PRIORITY @ Get the active IRQ priority
LDR r3, [r2, #0]
STR r3, [r0, #0] @ Set the priority as threshold
LDR r1, =ADDR_SIR_IRQ @ Get the Active IRQ
LDR r2, [r1]
AND r2, r2, #MASK_ACTIVE_IRQ @ Mask the Active IRQ number
MOV r0, #NEWIRQAGR @ To enable new IRQ Generation
LDR r1, =ADDR_CONTROL
CMP r3, #0 @ Check if non-maskable priority 0
STRNE r0, [r1] @ if > 0 priority, acknowledge INTC
DSB @ Make sure acknowledgement is completed
@
@ Enable IRQ and switch to system mode. But IRQ shall be enabled
@ only if priority level is > 0. Note that priority 0 is non maskable.
@ Interrupt Service Routines will execute in System Mode.
@
MRS r14, cpsr @ Read cpsr
ORR r14, r14, #MODE_SYS
BICNE r14, r14, #I_BIT @ Enable IRQ if priority > 0
MSR cpsr, r14
STMFD r13!, {r14} @ Save lr_usr
LDR r0, =fnRAMVectors @ Load the base of the vector table
ADD r14, pc, #0 @ Save return address in LR
LDR pc, [r0, r2, lsl #2] @ Jump to the ISR
LDMFD r13!, {r14} @ Restore lr_usr
@
@ Disable IRQ and change back to IRQ mode
@
CPSID i, #MODE_IRQ
LDR r0, =ADDR_THRESHOLD @ Get the IRQ Threshold
LDR r1, [r0, #0]
CMP r1, #0 @ If priority 0
MOVEQ r2, #NEWIRQAGR @ Enable new IRQ Generation
LDREQ r1, =ADDR_CONTROL
STREQ r2, [r1]
LDMFD r13!, {r1}
STR r1, [r0, #0] @ Restore the threshold value
VLDMIA r13!, {d0-d7} @ Restore D0-D7 Neon/VFP registers
LDMFD r13!, {r1, r12} @ Get fpscr and spsr
MSR spsr, r12 @ Restore spsr
VMSR fpscr, r1 @ Restore fpscr
LDMFD r13!, {r0-r3, r12, pc}^ @ Restore the context and return
0 0
- AM335X StarterWare 自带bootloader对IRQ的处理
- AM335X StarterWare Environment Setup
- ARM对中断IRQ的处理
- AM335x bootloader
- AM335x bootloader
- 非常浅显的说下C#中自带的HttpWebReponse对trunked的处理
- AM335x NorFlash NonMux boot设计---记录一段曲折的bootloader
- Gson库和Android自带JSON解析对转义字符的处理存在不同
- AM335x运用starterware裸机运行环境搭建连接到traget
- XCode对自带的SVN操作
- logrotate 是系统自带进行对日志进行处理
- 处理struts2自带的错误提示
- shell 自带的字符串处理功能
- 图片处理自带缓存的Picasso
- genexus中对字符串的格式补空处理(自带函数PadL(s,Len,[c]) )
- 对bootloader的一些看法
- 对datagrid自带的数字分页的功能补充
- 对系统自带的框架MapKit的应用
- 字符串编码方式介绍
- 2014年7月17凌晨笔记
- 简易计算程序运行次数
- DP---基本思想 具体实现 经典题目 POJ1160 POJ1037
- Visual Paradigm:10.0与Eclipse3.7集成
- AM335X StarterWare 自带bootloader对IRQ的处理
- C++内存管理
- Tomcat web 编解码过程
- 脱了裤子放屁之std::string
- Lambda
- python获取文件下所有文件
- 滞招硬逝跃撬馁颜咏撬脱我橙诽爬
- 烈忱实俅讲焦瓜掖倘两膳旁菇谀迟
- 一种可以避免数据迁移的分库分表scale-out扩容方式