Ignore:
Timestamp:
Jul 17, 2017, 5:30:46 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
3a3d85c
Parents:
600d88d
git-author:
Sebastian Huber <sebastian.huber@…> (07/17/17 05:30:46)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/25/17 09:41:12)
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/sparc/Makefile.am

    r600d88d r146adb1  
    1313
    1414noinst_LIBRARIES = libscorecpu.a
    15 libscorecpu_a_SOURCES = cpu.c cpu_asm.S
     15libscorecpu_a_SOURCES = cpu.c
    1616libscorecpu_a_SOURCES += sparc-context-volatile-clobber.S
    1717libscorecpu_a_SOURCES += sparc-context-validate.S
Note: See TracChangeset for help on using the changeset viewer.