setjmp.S 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* setjmp for ARM.
  2. Copyright (C) 1997, 1998 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. #include <features.h>
  17. .global __sigsetjmp
  18. .type __sigsetjmp,%function
  19. .align 2
  20. __sigsetjmp:
  21. mov ip, r0
  22. /* Save registers */
  23. stmia ip!, {v1-v6, sl, fp, sp, lr}
  24. #if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
  25. # ifdef __VFP_FP__
  26. /* Store the VFP registers. */
  27. /* Following instruction is fstmiax ip!, {d8-d15}. */
  28. stc p11, cr8, [r12], #68
  29. /* Store the floating-point status register. */
  30. /* Following instruction is fmrx r2, fpscr. */
  31. mrc p10, 7, r2, cr1, cr0, 0
  32. str r2, [ip], #4
  33. # elif defined __MAVERICK__
  34. cfstrd mvd4, [ip], #8 ; nop
  35. cfstrd mvd5, [ip], #8 ; nop
  36. cfstrd mvd6, [ip], #8 ; nop
  37. cfstrd mvd7, [ip], #8 ; nop
  38. cfstrd mvd8, [ip], #8 ; nop
  39. cfstrd mvd9, [ip], #8 ; nop
  40. cfstrd mvd10, [ip], #8 ; nop
  41. cfstrd mvd11, [ip], #8 ; nop
  42. cfstrd mvd12, [ip], #8 ; nop
  43. cfstrd mvd13, [ip], #8 ; nop
  44. cfstrd mvd14, [ip], #8 ; nop
  45. cfstrd mvd15, [ip], #8
  46. # else
  47. sfmea f4, 4, [ip]!
  48. # endif
  49. #endif
  50. #ifdef __IWMMXT__
  51. /* Save the call-preserved iWMMXt registers. */
  52. /* Following instructions are wstrd wr10, [ip], #8 (etc.) */
  53. stcl p1, cr10, [r12], #8
  54. stcl p1, cr11, [r12], #8
  55. stcl p1, cr12, [r12], #8
  56. stcl p1, cr13, [r12], #8
  57. stcl p1, cr14, [r12], #8
  58. stcl p1, cr15, [r12], #8
  59. #endif
  60. /* Make a tail call to __sigjmp_save; it takes the same args. */
  61. #ifdef __PIC__
  62. B __sigjmp_save(PLT)
  63. #else
  64. B __sigjmp_save
  65. #endif
  66. .size __sigsetjmp,.-__sigsetjmp