Line | |
---|

1 | /* NIOS2 crtn.asm fix |
---|

2 | * |
---|

3 | * COPYRIGHT (c) 2005-2006 Kolja Waschk rtemsdev/ixo.de |
---|

4 | * |
---|

5 | * The license and distribution terms for this file may be |
---|

6 | * found in the file LICENSE in this distribution or at |
---|

7 | * http://www.rtems.org/license/LICENSE. |
---|

8 | */ |
---|

9 | |
---|

10 | /* Can't use the original crtn.asm from Altera because it doesn't |
---|

11 | restore the stack pointer correctly (in 5.1b73, the stack pointer |
---|

12 | is further decreased by 48 instead of increased). This is named |
---|

13 | differently (crtnn instead crtn) to make sure it can be picked up |
---|

14 | using custom gcc specs instead of gcc's crtn. - kawk */ |
---|

15 | |
---|

16 | .section .init |
---|

17 | ldw ra, 44(sp) |
---|

18 | ldw r23, 40(sp) |
---|

19 | ldw r22, 36(sp) |
---|

20 | ldw r21, 32(sp) |
---|

21 | ldw r20, 28(sp) |
---|

22 | ldw r19, 24(sp) |
---|

23 | ldw r18, 20(sp) |
---|

24 | ldw r17, 16(sp) |
---|

25 | ldw r16, 12(sp) |
---|

26 | ldw fp, 8(sp) |
---|

27 | addi sp, sp, 48 |
---|

28 | ret |
---|

29 | |
---|

30 | .section .fini |
---|

31 | ldw ra, 44(sp) |
---|

32 | ldw r23, 40(sp) |
---|

33 | ldw r22, 36(sp) |
---|

34 | ldw r21, 32(sp) |
---|

35 | ldw r20, 28(sp) |
---|

36 | ldw r19, 24(sp) |
---|

37 | ldw r18, 20(sp) |
---|

38 | ldw r17, 16(sp) |
---|

39 | ldw r16, 12(sp) |
---|

40 | ldw fp, 8(sp) |
---|

41 | addi sp, sp, 48 |
---|

42 | ret |
---|

43 | |
---|

**Note:** See

TracBrowser
for help on using the repository browser.