[RTEMS Project] #3077: SPARC: Add lazy floating point context switching

RTEMS trac trac at rtems.org
Tue Jul 25 09:45:08 UTC 2017


#3077: SPARC: Add lazy floating point context switching
-----------------------------+------------------------------
 Reporter:  Sebastian Huber  |       Owner:  Sebastian Huber
     Type:  enhancement      |      Status:  assigned
 Priority:  normal           |   Milestone:  4.12.0
Component:  cpukit           |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |
-----------------------------+------------------------------

Comment (by Sebastian Huber <sebastian.huber@…>):

 In [changeset:"146adb1edfaa0271ee0df5180a1f64d54e6e860d/rtems"
 146adb1/rtems]:
 {{{
 #!CommitTicketReference repository="rtems"
 revision="146adb1edfaa0271ee0df5180a1f64d54e6e860d"
 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
 context.

 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
 trap (INTERNAL_ERROR_ILLEGAL_USE_OF_FLOATING_POINT_UNIT).

 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.
 }}}

--
Ticket URL: <http://devel.rtems.org/ticket/3077#comment:4>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list