Are r0-r3 preserved on context switching?

I’m writing an application where a module shall have reentrant functions. Because function parameters are passed in r0-r3 (in ARM), I’d like to know if these registers are also saved and preserved on context switching. This is because I’m worried about what would happen if a task calls a function and then another task immediately calls the same function right after the first call but before I can make a copy of the input parameters in local variables.

yes, they are. must be because context switches can happen at almost any time, eg when a time slice expires.

1 Like

Awesome! Thank you very much for the clarification!!