__longjmp.S 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * libc/sysdeps/linux/nios2/__longjmp.S
  3. *
  4. * Copyright (C) 2004,05,06 Microtronix Datacom Ltd
  5. *
  6. * This file is subject to the terms and conditions of the GNU Lesser
  7. * General Public License. See the file COPYING.LIB in the main
  8. * directory of this archive for more details.
  9. *
  10. * Written by Wentao Xu <wentao@microtronix.com>
  11. *
  12. */
  13. #include <features.h>
  14. #define _ASM
  15. #define _SETJMP_H
  16. #include <bits/setjmp.h>
  17. .globl __longjmp
  18. .type __longjmp,@function
  19. .balign 4
  20. __longjmp:
  21. /* return value is in r5*/
  22. mov r2, r5
  23. /* jmp_buf in r4, restore regs. */
  24. ldw r16, (JB_REGS+ 0)(r4)
  25. ldw r17, (JB_REGS+ 4)(r4)
  26. ldw r18, (JB_REGS+ 8)(r4)
  27. ldw r19, (JB_REGS+12)(r4)
  28. ldw r20, (JB_REGS+16)(r4)
  29. ldw r21, (JB_REGS+20)(r4)
  30. ldw r22, (JB_REGS+24)(r4)
  31. ldw r23, (JB_REGS+28)(r4)
  32. ldw ra, JB_PC(r4)
  33. ldw fp, JB_FP(r4)
  34. ldw gp, JB_GP(r4)
  35. ldw sp, JB_SP(r4)
  36. #if defined(__HAVE_FPU__)
  37. RESTORE_FPU r4 JB_FPREGS
  38. #endif
  39. /* return to saved RA */
  40. ret
  41. .size __longjmp,.-__longjmp
  42. libc_hidden_def(__longjmp)