Changeset a3818705 in rtems


Ignore:
Timestamp:
Jun 5, 2019, 7:22:36 PM (5 months ago)
Author:
Maksim E. Kozlov <maksim.e.kozlov@…>
Branches:
master
Children:
2a720f4
Parents:
7d7cbf3c
git-author:
Maksim E. Kozlov <maksim.e.kozlov@…> (06/05/19 19:22:36)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/06/19 06:40:47)
Message:

sparc: Fix missed restoring of PSR in syscall_lazy_fp_switch

It is needed to restore PSR just before return because condition
codes are dirty after the CMP instructions and this may cause
undefined program behavior after returning from the switching
procedure (on following branch instruction, for example).

Close #3756.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/sparc/syscall.S

    r7d7cbf3c ra3818705  
    242242.Lfp_restore_done:
    243243
     244        /*
     245         * Restore condition codes.  PSR[EF] is 1 here.  Take PSR write delay
     246         * into account (maximum is three instructions).
     247         */
     248        mov     %l0, %psr
     249        nop
     250
    244251        /* Now, retry the floating point instruction with PSR[EF] == 1 */
    245252        jmp     %l1
     
    248255.Lillegal_use_of_floating_point_unit:
    249256
     257        /*
     258         * There is no need to restore the condition codes here, since
     259         * _Internal_error() does not return.
     260         */
    250261        sethi   %hi(_Internal_error), %l1
    251262        or      %l1, %lo(_Internal_error), %l1
Note: See TracChangeset for help on using the changeset viewer.