source: rtems/cpukit/score/cpu/sparc/ @ 146adb1

Last change on this file since 146adb1 was 146adb1, checked in by Sebastian Huber <sebastian.huber@…>, on Jul 17, 2017 at 5:30:46 AM

sparc: Add lazy floating point switch

The SPARC ABI is a bit special with respect to the floating point context.
The complete floating point context is volatile. Thus, from an ABI point
of view nothing needs to be saved and restored during a context switch.
Instead the floating point context must be saved and restored during
interrupt processing. Historically, the deferred floating point switch was
used for SPARC and the complete floating point context is saved and
restored during a context switch to the new floating point unit owner.
This is a bit dangerous since post-switch actions (e.g. signal handlers)
and context switch extensions may silently corrupt the floating point

The floating point unit is disabled for interrupt handlers. Thus, in case
an interrupt handler uses the floating point unit then this will result in a

In uniprocessor configurations, a lazy floating point context switch is
used. In case an active floating point thread is interrupted (PSR[EF] == 1)
and a thread dispatch is carried out, then this thread is registered as the
floating point owner. When a floating point owner is present during a
context switch, the floating point unit is disabled for the heir thread
(PSR[EF] == 0). The floating point disabled trap checks that the use of the
floating point unit is allowed and saves/restores the floating point context
on demand.

Update #3077.

  • Property mode set to 100644
File size: 854 bytes
1include $(top_srcdir)/automake/
3include_rtemsdir = $(includedir)/rtems
4include_rtems_HEADERS = rtems/asm.h
6include_rtems_scoredir = $(includedir)/rtems/score
7include_rtems_score_HEADERS = rtems/score/sparc.h
8include_rtems_score_HEADERS += rtems/score/cpu.h
9include_rtems_score_HEADERS += rtems/score/cpuimpl.h
10include_rtems_score_HEADERS += rtems/score/sparcimpl.h
11include_rtems_score_HEADERS += rtems/score/types.h
12include_rtems_score_HEADERS += rtems/score/cpuatomic.h
14noinst_LIBRARIES = libscorecpu.a
15libscorecpu_a_SOURCES = cpu.c
16libscorecpu_a_SOURCES += sparc-context-volatile-clobber.S
17libscorecpu_a_SOURCES += sparc-context-validate.S
18libscorecpu_a_SOURCES += sparc-counter.c
19libscorecpu_a_SOURCES += sparc-counter-asm.S
20libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)
22include $(srcdir)/
23include $(top_srcdir)/automake/
Note: See TracBrowser for help on using the repository browser.