Changeset 33de203 in rtems


Ignore:
Timestamp:
Mar 17, 2016, 8:12:19 AM (4 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
4.11
Children:
94b1ba5
Parents:
d85db176
git-author:
Daniel Hellstrom <daniel@…> (03/17/16 08:12:19)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/24/16 06:41:01)
Message:

sparc: Fix window underflow trap handler

The window underflow trap handler used %i5 which destroyed the %o5 of
the calling context. Bug introduced by
0d3b5d47429effb350448d9e9123a67db722109f.

Go back to the pre 0d3b5d47429effb350448d9e9123a67db722109f behaviour
and use the two unused instructions in the trap vector to optimize a
bit.

Close #2651.

Location:
c/src/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/shared/start/start.S

    rd85db176 r33de203  
    6767  sethi %hi(_handler), %l4 ; \
    6868  jmp   %l4+%lo(_handler); \
    69    mov  %g0, %wim ! WIM = 0, so that we can restore regardless of WIM
     69   sll  %l3, 1, %l4 ! l4 = WIM << 1
    7070
    7171/*
  • c/src/lib/libcpu/sparc/reg_win/window.S

    rd85db176 r33de203  
    7777         *    l1 = pc
    7878         *    l2 = npc
    79          *    l3 = wim (from trap table)
     79         *    l3 = wim (from trap vector)
     80         *    l4 = wim << 1 (from trap vector)
    8081         */
    8182
     
    9798         */
    9899
    99         ! In WIM 3 write instruction delay. since WIM<=0 from trap entry
    100         sll  %l3, 1, %l4                ! l4 = WIM << 1
    101100        srl  %l3, SPARC_NUMBER_OF_REGISTER_WINDOWS-1, %l5
    102         or   %l5, %l4, %i5              ! %i5= (WIM << 1) |
     101        or   %l5, %l4, %l5              ! l5 = (WIM << 1) |
    103102                                        !      (WIM >> (Number Windows-1))
     103        mov  %l5, %wim                  ! load the new WIM
     104        nop; nop; nop                   ! 3 slot delay
    104105        restore                         ! Two restores to get into the
    105         restore %o5, %g0, %l7           ! window to restore. Carry along new WIM
     106        restore                         ! window to restore
    106107        ldd  [%sp + 0x00], %l0          ! First the local register set
    107         mov   %l7, %wim                 ! load the new WIM
    108108        ldd  [%sp + 0x08], %l2
    109109        ldd  [%sp + 0x10], %l4
Note: See TracChangeset for help on using the changeset viewer.