Save/Restore the necessary registers for an ISR

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Save/Restore the necessary registers for an ISR

506 Views
tsybezoff
Contributor II

Hi to all!
I try to port free RTOS to P1010. I have some questions about macroses isr_prologue/isr_epilogue in eppc_exception.asm. As i know these marcoses save/restore task current contexts. Size of context is 320 bytes. 20 registers saved by macroses. Please, tell me someone about r0, r3-r12!!! this is GRPs??? why i should save its??? what kind of data does it store??? where are r1 and r2 in these macroses??? 

Labels (1)
0 Kudos
3 Replies

344 Views
alexander_yakov
NXP Employee
NXP Employee

"Save context" means saving all processor registers, so you can safely switch context to another one, perform any operation using any register, and than return back restoring presious context (previous state of registers). If you have an information, which registers are used and which are not used, than you do not need to save all registers, but only used ones. In other words, if your interrupt handler use only several registers, for example r0 only, than you have to save and restore only r0.


Have a great day,
Alexander

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

344 Views
tsybezoff
Contributor II

r0, r1, r2.... r12 are GPRs???

0 Kudos

344 Views
alexander_yakov
NXP Employee
NXP Employee

Yes, I assume r0 is a short for gpr0, and so on.

0 Kudos