ADSP-BF53x/BF56x Blackfin Processor Programming Reference
4-53
Program Sequencer
Figure 4-9
illustrates that by pushing
RETI
onto the stack, interrupts can
be re-enabled during an interrupt service routine, resulting in a short
duration where interrupts are globally disabled.
Example Prolog Code for Nested Interrupt Service Routine
Listing 4-3. Prolog Code for Nested ISR
/* Prolog code for nested interrupt service routine.
Push return address in RETI into Supervisor stack, ensuring that
interrupts are back on. Until now, interrupts have been
suspended.*/
ISR:
[--SP] = RETI ; /* Enables interrupts and saves return address to
stack */
[--SP] = ASTAT ;
Figure 4-9. Nested Interrupt Handling
IF 1
IF 2
IF 3
DEC
AC
DF1
DF2
EX1
EX2
WB
A8
1
CYCLE 1: INTERRUPT IS LATCHED. ALL POSSIBLE INTERRUPT SOURCES DETERMINED.
CYCLE 2: INTERRUPT IS PRIORITIZED.
CYCLE 3: ALL INSTRUCTIONS ABOVE A2 ARE KILLED. A2 IS KILLED IF IT IS AN RTI OR CLI INSTRUCTION. ISR STARTING
ADDRESS LOOKUP OCCURS.
CYCLE 4: I0 (INSTRUCTION AT START OF ISR) ENTERS PIPELINE. ASSUME IT IS A PUSH RETI INSTRUCTION (TO ENABLE NESTING).
CYCLE 10: WHEN PUSH REACHES DF2 STAGE, INTERRUPTS ARE RE-ENABLED.
CYCLE M+1: WHEN THE POP RETI INSTRUCTION REACHES THE DF2 STAGE, INTERRUPTS ARE DISABLED.
CYCLE M+5: WHEN RTI REACHES THE WB STAGE, INTERRUPTS ARE RE-ENABLED.
2
3
4
5
6
7
8
9
10
m
CYCLE:
A9
A7
A6
A5
A4
A3
A2
A1
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A1 0
A9
A8
A7
A6
A5
A4
A3
A2
PUSH
I2
I1
I1
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
I3
I5
I6
m+1
m+2 m+3
m+4 m+5
A3
A4
A5
A6
A7
A3
A4
A5
A6
A3
A4
A5
A4
A3
A3
RT I
In
I
I
I n-3
n-2
n-1
I
I n-2
n-1
I n-1
In
PUSH
PUSH
I2
I1
PUSH
I3
I2
I1
PUSH
I4
I3
I2
I1
PUSH
I4
I5
I3
I2
I1
PUSH
I4
POP
POP
POP
POP
POP
RTI
RTI
RTI
RTI
RTI
In
In
INTERRUPTS DISABLED
DURING THIS INTERVAL.
INTERRUPTS DISABLED
DURING THIS INTERVAL.
PIPELINE
STAGE
Summary of Contents for ADSP-BF53x Blackfin
Page 38: ...Conventions xxxviii ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 134: ...System Reset and Powerup 3 18 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 324: ...Instruction Overview 7 20 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 486: ...Instruction Overview 13 28 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 512: ...Instruction Overview 14 26 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 604: ...Instruction Overview 15 92 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 688: ...Instruction Overview 18 48 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 742: ...Instruction Overview 19 54 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 752: ...Examples 20 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 790: ...ADSP BF535 Flags A 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 800: ...Performance Monitor Registers B 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Page 1042: ...Index I 40 ADSP BF53x BF56x Blackfin Processor Programming Reference...