__longjmp.S 1.6 KB

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