I'm having an issue with my code not running as expected, and have narrowed it down to the fact that some registers are not being saved during context switching to an ISR. The register in question is related to the floating point unit, namely the FPSCR register. Because the ISR interrupting my code also uses the floating point unit, it is altering this register, and once the ISR exits, I'm failing a compare operation in my original code that is looking at the flags contained in this register.
Looking at the assembly for the ISR in question, the following context saving instructions are occuring:
STMFD R13!, {R0, R1, R2, R3, R12, R14}
FSTMDBD R13!, {D0-D7}
I believe that the D0-D7 registers indicate that is saving some of the VFP registers, however, shouldn't it also be saving the FPSCR register (which contains the flags that I'm concerned with)? I manually saved/restored this register and it fixed my issue. I'm not sure if I have some control over enabling the compiler to save this register? Also, I'm having a hard time finding in the document where it shows how the compiler determines what context registers to save. FYI, the interrupt is declared as such:
#pragma INTERRUPT(MyISR); interrupt void MyISR(void){ ...
Thanks in advance...