setjmp.S 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. #define _SETJMP_H
  18. #define _ASM
  19. #include <bits/setjmp.h>
  20. .global __sigsetjmp
  21. .type __sigsetjmp,%function
  22. .align 4
  23. __sigsetjmp:
  24. /* Save registers */
  25. #if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
  26. # ifdef __MAVERICK__
  27. cfstrd mvd4, [r0], #8 ; nop
  28. cfstrd mvd5, [r0], #8 ; nop
  29. cfstrd mvd6, [r0], #8 ; nop
  30. cfstrd mvd7, [r0], #8 ; nop
  31. cfstrd mvd8, [r0], #8 ; nop
  32. cfstrd mvd9, [r0], #8 ; nop
  33. cfstrd mvd10, [r0], #8 ; nop
  34. cfstrd mvd11, [r0], #8 ; nop
  35. cfstrd mvd12, [r0], #8 ; nop
  36. cfstrd mvd13, [r0], #8 ; nop
  37. cfstrd mvd14, [r0], #8 ; nop
  38. cfstrd mvd15, [r0], #8
  39. # else
  40. sfmea f4, 4, [r0]!
  41. # endif
  42. #else
  43. # ifdef __MAVERICK__
  44. add r0, r0, #96 /* skip the FP registers */
  45. # else
  46. add r0, r0, #48 /* skip the FP registers */
  47. # endif
  48. #endif
  49. stmia r0, {v1-v6, sl, fp, sp, lr}
  50. /* Restore pointer to jmp_buf */
  51. #ifdef __MAVERICK__
  52. sub r0, r0, #96
  53. #else
  54. sub r0, r0, #48
  55. #endif
  56. /* Make a tail call to __sigjmp_save; it takes the same args. */
  57. #ifdef __PIC__
  58. B __sigjmp_save(PLT)
  59. #else
  60. B __sigjmp_save
  61. #endif
  62. .size __sigsetjmp,.-__sigsetjmp