setjmp.S 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (C) 2013 Imagination Technologies Ltd.
  3. *
  4. * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
  5. */
  6. !!! setjmp and variants
  7. .text
  8. !! int _setjmp (jmp_buf __env)
  9. !! Store the calling environment in ENV, not saving the signal mask.
  10. !! Return 0. */
  11. .global __setjmp
  12. .type __setjmp,function
  13. __setjmp:
  14. MOV D0Ar2,#0
  15. B ___sigsetjmp1
  16. .size __setjmp,.-__setjmp
  17. !! int setjmp (jmp_buf __env)
  18. !! Store the calling environment in ENV, also saving the signal mask.
  19. !! Return 0. */
  20. .global _setjmp
  21. .type _setjmp,function
  22. _setjmp:
  23. MOV D0Ar2,#1
  24. !! fall through to __sigsetjmp
  25. .size _setjmp,.-_setjmp
  26. !! int __sigsetjmp (jmp_buf __env, int __savemask)
  27. !! Store the calling environment in ENV, also saving the
  28. !! signal mask if SAVEMASK is nonzero. Return 0.
  29. !! This is the internal name for `sigsetjmp'.
  30. .global ___sigsetjmp
  31. .type ___sigsetjmp,function
  32. ___sigsetjmp:
  33. ___sigsetjmp1:
  34. !! Save A0/A1 regs
  35. MSETL [D1Ar1++],A0.0,A0.1
  36. !! Use A0.3 as temp
  37. MOV A0.3,D1Ar1
  38. !! Rewind D1Ar1 that was modified above
  39. SUB D1Ar1,D1Ar1,#(2*8)
  40. !! Save D0/D1 regs
  41. MSETL [A0.3++],D0FrT,D0.5,D0.6,D0.7
  42. !! Tail call __sigjmp_save
  43. #ifdef __PIC__
  44. B ___sigjmp_save@PLT
  45. #else
  46. B ___sigjmp_save
  47. #endif
  48. .size ___sigsetjmp,.-___sigsetjmp