The TPU Interrupt Service Routine (ISR) for a MicroC/OS-II environment shown
below contains multiple programming errors.
The ISR is to be used to unblock (i.e. signal) a task, which is waiting on a
semaphore, when the TPU Stepper Motor function has finished the last host
service request.
Indicate, by directly writing on the code, where all of the errors are.
Also indicate how the errors could be most easily corrected.
State any important assumptions that you are making in your proposed
corrections to the code:
TPU_ISR: ADDQ.B #1,OSIntNesting
MOVEM.L A0-A7/D0-D7,-(SP)
LEA.L #TPU_BASE_ADDR,A0
MOVE.B TPU_CISR(A0),D0
ANDI.W #SM_PRIM_IRQBIT,D0
BNE EXIT_TPU_ISR
MOVEM.L A0-A7/D0-D6,-(SP)
PEA.L TPU_Semaphore
JSR OSSemPend
MOVEM.W (SP)+,A0-A7/D0-D7
ADDQ.L #2,SP
EXIT_ISR: JSR OSIntExit68K
MOVEM.L (SP)+,A0-A7/D0-D7
RTS