summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/m68k/cpu_asm.S
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/cpu/m68k/cpu_asm.S')
-rw-r--r--cpukit/score/cpu/m68k/cpu_asm.S9
1 files changed, 8 insertions, 1 deletions
diff --git a/cpukit/score/cpu/m68k/cpu_asm.S b/cpukit/score/cpu/m68k/cpu_asm.S
index 0d14c16401..c8357a09c5 100644
--- a/cpukit/score/cpu/m68k/cpu_asm.S
+++ b/cpukit/score/cpu/m68k/cpu_asm.S
@@ -139,6 +139,8 @@ SYM (_ISR_Handler):
#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 )
+ tstl SYM (_ISR_Nest_level) | Interrupting an interrupt handler?
+ bne 2f | Yes, just skip over stack switch code
movel _CPU_Interrupt_stack_high,a0 | a0 now point just above interrupt stack
cmpl _CPU_Interrupt_stack_low,a7 | stack below interrupt stack?
bcs.b 1f | yes, switch to interrupt stack
@@ -151,6 +153,8 @@ SYM (_ISR_Handler):
2:
#endif /* CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 */
+ addql #1,SYM(_ISR_Nest_level) | one nest level deeper
+
movel SYM (_ISR_Vector_table),a0 | a0= base of RTEMS table
#if ( M68K_HAS_PREINDEXING == 1 )
movel (a0,d0:w:1),a0 | a0 = address of user routine
@@ -165,14 +169,17 @@ SYM (_ISR_Handler):
addql #4,a7 | remove vector number
#if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 )
+ subql #1,SYM(_ISR_Nest_level) | Reduce interrupt-nesting count
+ bne 1f | Skip if return to interrupt
movel _CPU_Interrupt_stack_high,a0
subql #4,a0
cmpl a0,a7 | At top of interrupt stack?
bne.b 1f | No, do not restore task stack pointer
movel (a7),a7 | Restore task stack pointer
1:
+#else
+ subql #1,SYM (_ISR_Nest_level) | one less nest level
#endif /* CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 */
-
subql #1,SYM (_Thread_Dispatch_disable_level)
| unnest multitasking
bne.b exit | If dispatch disabled, exit