You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
3.7 KiB

  1. /*
  2. Copyright Oliver Kowalke 2009.
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt)
  6. */
  7. /*******************************************************************
  8. * *
  9. * ------------------------------------------------------------- *
  10. * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | *
  11. * ------------------------------------------------------------- *
  12. * | 0x0 | 0x4 | 0x8 | 0xc | 0x10| 0x14| 0x18| 0x1c| 0x20| 0x24| *
  13. * ------------------------------------------------------------- *
  14. * | v1 | v2 | v3 | v4 | v5 | v6 | v7 | v8 | sp | lr | *
  15. * ------------------------------------------------------------- *
  16. * ------------------------------------------------------------- *
  17. * | 10 | | *
  18. * ------------------------------------------------------------- *
  19. * | 0x28| | *
  20. * ------------------------------------------------------------- *
  21. * | pc | | *
  22. * ------------------------------------------------------------- *
  23. * ------------------------------------------------------------- *
  24. * | 11 | 12 | | *
  25. * ------------------------------------------------------------- *
  26. * | 0x2c| 0x30| | *
  27. * ------------------------------------------------------------- *
  28. * | sp | size| | *
  29. * ------------------------------------------------------------- *
  30. * ------------------------------------------------------------- *
  31. * | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | *
  32. * ------------------------------------------------------------- *
  33. * | 0x34| 0x38|0x3c| 0x40| 0x44| 0x48| 0x4c| 0x50| 0x54| 0x58 | *
  34. * ------------------------------------------------------------- *
  35. * | s16 | s17 | s18 | s19 | s20 | s21 | s22 | s23 | s24 | s25 | *
  36. * ------------------------------------------------------------- *
  37. * ------------------------------------------------------------- *
  38. * | 23 | 24 | 25 | 26 | 27 | 28 | | *
  39. * ------------------------------------------------------------- *
  40. * | 0x5c| 0x60| 0x64| 0x68| 0x6c| 0x70| | *
  41. * ------------------------------------------------------------- *
  42. * | s26 | s27 | s28 | s29 | s30 | s31 | | *
  43. * ------------------------------------------------------------- *
  44. * *
  45. * *****************************************************************/
  46. .text
  47. .globl jump_fcontext
  48. .align 2
  49. .type jump_fcontext,%function
  50. jump_fcontext:
  51. stmia a1, {v1-v8,sp-lr} @ save V1-V8,SP-LR
  52. str lr, [a1,#40] @ save LR as PC
  53. #if (defined(__VFP_FP__) && !defined(__SOFTFP__))
  54. cmp a4, #0 @ test if fpu env should be preserved
  55. beq 1f
  56. mov a4, a1
  57. add a4, #52
  58. vstmia a4, {d8-d15} @ save S16-S31
  59. mov a4, a2
  60. add a4, #52
  61. vldmia a4, {d8-d15} @ restore S16-S31
  62. 1:
  63. #endif
  64. mov a1, a3 @ use third arg as return value after jump
  65. @ and as first arg in context function
  66. ldmia a2, {v1-v8,sp-pc} @ restore v1-V8,SP-PC
  67. .size jump_fcontext,.-jump_fcontext
  68. /* Mark that we don't need executable stack. */
  69. .section .note.GNU-stack,"",%progbits