SPARC Context Switch Code

Ingolf Steinbach ingolf.steinbach at
Thu Feb 6 11:17:51 UTC 2014

My original reply (which was also sent to Sebastian directly) bounced
from the list, so here we are again.

2014-02-06 Sebastian Huber <sebastian.huber at>:
> what do the RTEMS SPARC user think about the attached patch?  Why did the
> SPARC context switch code save and restore volatile registers?

According to the SPARC ABI, volatility of a register means that there
is no guarantee that the register will retain its state across a
function call. I understand that the _CPU_Context_switch can be
invoked at arbitrary places within a user program (at least when using
preemptive scheduling), so it must make sure that *all* registers are
saved and restored. Otherwise it would render %g1 pretty much useless
as (from a user POV) its content might change in an unpredictable way
in the middle of a sequence of instructions.

Kind regards

More information about the users mailing list