__longjmp.S 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  3. *
  4. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  5. */
  6. #define _SETJMP_H
  7. #define _ASM
  8. #include <bits/setjmp.h>
  9. # setjmp/longjmp for Frv. The jmpbuf looks like this:
  10. #
  11. # Register jmpbuf offset
  12. # R16-R31 0x0-0x03c
  13. # R48-R63 0x40-0x7c
  14. # FR16-FR31 0x80-0xbc
  15. # FR48-FR63 0xc0-0xfc
  16. # LR 0x100
  17. # SP 0x104
  18. # FP 0x108
  19. #
  20. # R8 contains the pointer to jmpbuf
  21. .text
  22. .global __longjmp
  23. .type __longjmp,@function
  24. __longjmp:
  25. lddi @(gr8,0), gr16
  26. lddi @(gr8,8), gr18
  27. lddi @(gr8,16), gr20
  28. lddi @(gr8,24), gr22
  29. lddi @(gr8,32), gr24
  30. lddi @(gr8,40), gr26
  31. lddi @(gr8,48), gr28
  32. lddi @(gr8,56), gr30
  33. #if __FRV_GPR__ != 32
  34. lddi @(gr8,64), gr48
  35. lddi @(gr8,72), gr50
  36. lddi @(gr8,80), gr52
  37. lddi @(gr8,88), gr54
  38. lddi @(gr8,96), gr56
  39. lddi @(gr8,104), gr58
  40. lddi @(gr8,112), gr60
  41. lddi @(gr8,120), gr62
  42. #endif
  43. #if __FRV_FPR__ != 0
  44. lddfi @(gr8,128), fr16
  45. lddfi @(gr8,136), fr18
  46. lddfi @(gr8,144), fr20
  47. lddfi @(gr8,152), fr22
  48. lddfi @(gr8,160), fr24
  49. lddfi @(gr8,168), fr26
  50. lddfi @(gr8,176), fr28
  51. lddfi @(gr8,184), fr30
  52. #if __FRV_FPR__ != 32
  53. lddfi @(gr8,192), fr48
  54. lddfi @(gr8,200), fr50
  55. lddfi @(gr8,208), fr52
  56. lddfi @(gr8,216), fr54
  57. lddfi @(gr8,224), fr56
  58. lddfi @(gr8,232), fr58
  59. lddfi @(gr8,240), fr60
  60. lddfi @(gr8,248), fr62
  61. #endif
  62. #endif
  63. ldi @(gr8,256), gr4
  64. movgs gr4,lr
  65. ldi @(gr8,260), sp
  66. ldi @(gr8,264), fp
  67. # Value to return is in r9. If zero, return 1
  68. cmp gr9, gr0, icc0
  69. setlos #1, gr8
  70. ckne icc0, cc4
  71. cmov gr9, gr8, cc4, 1
  72. ret
  73. .Lend2:
  74. .size __longjmp,.Lend2-__longjmp
  75. libc_hidden_def(__longjmp)