Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:51

0001 /*  NIOS2 crtn.asm fix
0002  *
0003  *  COPYRIGHT (c) 2005-2006 Kolja Waschk rtemsdev/ixo.de
0004  *
0005  *  The license and distribution terms for this file may be
0006  *  found in the file LICENSE in this distribution or at
0007  *  http://www.rtems.org/license/LICENSE.
0008  */
0009 
0010 /* Can't use the original crtn.asm from Altera because it doesn't
0011    restore the stack pointer correctly (in 5.1b73, the stack pointer
0012    is further decreased by 48 instead of increased). This is named
0013    differently (crtnn instead crtn) to make sure it can be picked up
0014    using custom gcc specs instead of gcc's crtn. - kawk */
0015 
0016     .section .init
0017     ldw ra, 44(sp)
0018     ldw r23, 40(sp)
0019     ldw r22, 36(sp)
0020     ldw r21, 32(sp)
0021     ldw r20, 28(sp)
0022     ldw r19, 24(sp)
0023     ldw r18, 20(sp)
0024     ldw r17, 16(sp)
0025     ldw r16, 12(sp)
0026     ldw fp, 8(sp)
0027     addi sp, sp, 48
0028     ret
0029     
0030     .section .fini
0031     ldw ra, 44(sp)
0032     ldw r23, 40(sp)
0033     ldw r22, 36(sp)
0034     ldw r21, 32(sp)
0035     ldw r20, 28(sp)
0036     ldw r19, 24(sp)
0037     ldw r18, 20(sp)
0038     ldw r17, 16(sp)
0039     ldw r16, 12(sp)
0040     ldw fp, 8(sp)
0041     addi sp, sp, 48
0042     ret
0043