Having trouble with interrupt priority level

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Having trouble with interrupt priority level

2,019件の閲覧回数
mbrown
Contributor I
I'm trying to enable and disable interrupts on my MCF5282.  I'm doing:
 
void
interrupt_enable()
{
 printf("interrupt enable\n");
 asm {
  move.l #0x00002000,d0
  move.w d0,SR
 }
}
void
interrupt_disable()
{
 printf("interrupt disable\n");
 asm {
  move.l #0x00002700,d0
  move.w d0,SR
 }
}
 
When I call these functions manually, everything is OK.  However, when I go into an interrupt (from the FEC) and attempt to disable further interrupts, I call the disable function but interrupts never stop.
Does anyone know what is happening here?
ラベル(1)
0 件の賞賛
返信
3 返答(返信)

633件の閲覧回数
rocco
Senior Contributor II
Hi, mbrown:

Are you sure they "never" stop? Could they be stopping for the duration of the ISR, but then being re-enabled when the ISR exits?

The SR is stacked by the interrupt, and will be restored by the interrupt-return. If you changed it within the ISR, it will still be restored to what it was prior to the interrupt, upon the completion of the ISR.

If you want to change the value that the SR will be when the interrupt exits, you can modify the value that was pushed onto the stack.
0 件の賞賛
返信

633件の閲覧回数
mbrown
Contributor I
rocco, I think you're right.  I was not realizing that the SR gets pushed to the stack and then restored after the interrupt.  So the effect is that interrupts are only being disabled for the time the coldfire is processing the interrupt. 
Thanks for the help.
0 件の賞賛
返信

633件の閲覧回数
PaoloRenzo
Contributor V
Maybe your Ethernet's interrupts are configured as interrupt level 7 (unmaskable). Only guessing
0 件の賞賛
返信