We have always set LR to 0xFFFFFFFD at the end of context switch, but this is a redundant or dangerous work.
Exception entry will store EXC_RETURN to LR automatically by hardware according to previous operation mode.
ARM DUI 0533A 2-27:
The processor writes an EXC_RETURN value to the LR.
This indicates which stack pointer corresponds to the stack frame and
what operation mode the processor was in before the entry occurred
It may cause some unpredictable result as someone might intend to utilize other function of EXC_RETURN.
We have always set LR to
0xFFFFFFFD
at the end of context switch, but this is a redundant or dangerous work.Exception entry will store
EXC_RETURN
to LR automatically by hardware according to previous operation mode.It may cause some unpredictable result as someone might intend to utilize other function of
EXC_RETURN
.