Changeset b2d191e in rtems


Ignore:
Timestamp:
05/14/14 08:23:18 (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
249eaf9
Parents:
3730a07f
git-author:
Sebastian Huber <sebastian.huber@…> (05/14/14 08:23:18)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/14/14 12:46:20)
Message:

bsps/sparc: Fix data copy in start procedure

Use the register %g4 for the data content since it must be an even
numbered register due to the std/ldd. Use the register %g2 for the BSS
start address, so that it can be later re-used for the BSS zero loop.

File:
1 edited

Legend:

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

    r3730a07f rb2d191e  
    320320         */
    321321
    322         sethi %hi(_endtext),%g2
    323         or    %g2,%lo(_endtext),%g2     ! g2 = start of initialized data in ROM
     322        sethi %hi(_endtext),%g1
     323        or    %g1,%lo(_endtext),%g1     ! g1 = start of initialized data in ROM
    324324
    325325        sethi %hi(_data_start),%g3
    326326        or    %g3,%lo(_data_start),%g3  ! g3 = start of initialized data in RAM
    327327
    328         sethi %hi(__bss_start),%g4
    329         or    %g4,%lo(__bss_start),%g4  ! g4 = end of initialized data in RAM
    330 
    331         cmp   %g2, %g3
     328        sethi %hi(__bss_start), %g2
     329        or    %g2,%lo(__bss_start),%g2  ! g2 = end of initialized data in RAM
     330
     331        cmp   %g1, %g3
    332332        be    1f
    333333        nop
    334334
    335335copy_data:
    336         ldd   [ %g2 ], %g5
    337         std   %g5 , [ %g3 ]             ! copy this double word
     336        ldd   [%g1], %g4
     337        std   %g4 , [%g3]               ! copy this double word
    338338        add   %g3, 8, %g3               ! bump the destination pointer
    339         add   %g2, 8, %g2               ! bump the source pointer
    340         cmp   %g3, %g4                  ! Is the pointer past the end of dest?
     339        add   %g1, 8, %g1               ! bump the source pointer
     340        cmp   %g3, %g2                  ! Is the pointer past the end of dest?
    341341        bl    copy_data
    342342        nop
Note: See TracChangeset for help on using the changeset viewer.