打印

关于伪中断

[复制链接]
2246|8
手机看帖
扫描二维码
随时随地手机跟帖
沙发
米其林r| | 2010-9-22 19:19 | 只看该作者
当ARM核被中断,但是在读AIC_IVR时中断源已经消失的时候,会产生一个伪中断。


这发生在:

当在设置为电平出发的外部中断上施加一个边沿信号时
当一个中断发生时恰巧禁止该中断(处理器的流水线操作副反应)
当循环检查一个使用PDC的中断,并循环检查相应的数据保存寄存器时(事实上PDC的读和写是由硬件完成的

使用特权

评论回复
板凳
3B1105| | 2010-9-22 19:27 | 只看该作者
关于伪中断,arm官网上有说的,还提出了3个workaround

使用特权

评论回复
地板
huzixian| | 2010-9-22 19:54 | 只看该作者
伪中断其实就是个BUG,在对应的伪中断处理程序里面写中断结束命令即可

使用特权

评论回复
5
原野之狼| | 2010-9-23 10:54 | 只看该作者
关注一下 哪位高人来解答一下
官网上资料按还没看明白

使用特权

评论回复
6
米其林r| | 2010-9-23 18:39 | 只看该作者
网上搜搜吧

使用特权

评论回复
7
思行合一| | 2010-9-23 22:40 | 只看该作者
还有伪中断?路过,学习下

使用特权

评论回复
8
X-Hawk| | 2010-9-25 21:54 | 只看该作者
三个workaround的具体做法,原文见:
http://infocenter.arm.com/help/topic/com.arm.doc.faqs/ka3783.html
------------------------------------------------------------------------------------------------
Workaround:
There are 3 suggested workarounds. Which of these is most applicable will depend upon the requirements of the particular system.
Add code similar to the following at the start of the interrupt routine.
SUB lr, lr, #4 ; Adjust LR to point to return
STMFD sp!, {..., lr} ; Get some free regs
MRS lr, SPSR ; See if we got an interrupt while
TST lr, #I_Bit ; interrupts were disabled.
LDMNEFD sp!, {..., pc}^ ; If so, just return immediately.
; The interrupt will remain
; pending since we haven't
; acknowledged it and will be
; reissued when interrupts are next
; enabled.
; Rest of interrupt routine
This code will test for the situation where the IRQ was received during a write to disable IRQs. If this is the case, the code returns immediately - resulting in the IRQ not being acknowledged (cleared), and further IRQs being disabled.
Similar code may also be applied to the FIQ handler, in order to resolve the first issue.
This is the recommended workaround, as it overcomes both problems mentioned above. However, in the case of problem two, it does add several cycles to the maximum length of time FIQs will be disabled.
Disable IRQs and FIQs using separate writes to the CPSR, eg:
MRS r0, cpsr
ORR r0, r0, #I_Bit ;disable IRQs
MSR cpsr_c, r0
ORR r0, r0, #F_Bit ;disable FIQs
MSR cpsr_c, r0
This is the best workaround where the maximum time for which FIQs are disabled is critical (it does not increase this time at all). However, it does not solve problem one, and requires extra instructions at every point where IRQs and FIQs are disabled together.
Re-enable FIQs at the beginning of the IRQ handler. As the required state of all bits in the c field of the CPSR are known, this can be most efficiently be achieved by writing an immediate value to CPSR_c, for example:
MSR cpsr_c, #I_Bit:OR:irq_MODE ;IRQ should be disabled
;FIQ enabled
;ARM state, IRQ mode
This requires only the IRQ handler to be modified, and FIQs may be re-enabled more quickly than by using workaround 1. However, this should only be used if the system can guarantee that FIQs are never disabled while IRQs are enabled. It does not address problem one.

使用特权

评论回复
9
黑发尤物| | 2010-9-25 22:07 | 只看该作者
听说可以恢复中断,但是不知道怎么恢复,还是等高手解答吧

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

191

主题

1265

帖子

2

粉丝