bsd-_setjmp.S 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* __setjmp for the Blackfin project
  2. *
  3. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  4. * Copyright (C) 2002, David McCullough <davidm@snapgear.com>
  5. *
  6. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. */
  8. .text
  9. .global __setjmp;
  10. .type __setjmp,STT_FUNC;
  11. .align 4;
  12. __setjmp:
  13. [--SP] = P0; // Save P0
  14. P0 = R0;
  15. R0 = [SP++];
  16. [P0 + 0x00] = R0; // Save saved P0
  17. [P0 + 0x04] = P1;
  18. [P0 + 0x08] = P2;
  19. [P0 + 0x0C] = P3;
  20. [P0 + 0x10] = P4;
  21. [P0 + 0x14] = P5;
  22. [P0 + 0x18] = FP; // Frame Pointer
  23. [P0 + 0x1C] = SP; // Stack Pointer
  24. [P0 + 0x20] = P0; // Data Registers
  25. [P0 + 0x24] = R1;
  26. [P0 + 0x28] = R2;
  27. [P0 + 0x2C] = R3;
  28. [P0 + 0x30] = R4;
  29. [P0 + 0x34] = R5;
  30. [P0 + 0x38] = R6;
  31. [P0 + 0x3C] = R7;
  32. R0 = ASTAT;
  33. [P0 + 0x40] = R0;
  34. R0 = LC0; // Loop Counters
  35. [P0 + 0x44] = R0;
  36. R0 = LC1;
  37. [P0 + 0x48] = R0;
  38. R0 = A0.W; // Accumulators
  39. [P0 + 0x4C] = R0;
  40. R0 = A0.X;
  41. [P0 + 0x50] = R0;
  42. R0 = A1.W;
  43. [P0 + 0x54] = R0;
  44. R0 = A1.X;
  45. [P0 + 0x58] = R0;
  46. R0 = I0; // Index Registers
  47. [P0 + 0x5C] = R0;
  48. R0 = I1;
  49. [P0 + 0x60] = R0;
  50. R0 = I2;
  51. [P0 + 0x64] = R0;
  52. R0 = I3;
  53. [P0 + 0x68] = R0;
  54. R0 = M0; // Modifier Registers
  55. [P0 + 0x6C] = R0;
  56. R0 = M1;
  57. [P0 + 0x70] = R0;
  58. R0 = M2;
  59. [P0 + 0x74] = R0;
  60. R0 = M3;
  61. [P0 + 0x78] = R0;
  62. R0 = L0; // Length Registers
  63. [P0 + 0x7c] = R0;
  64. R0 = L1;
  65. [P0 + 0x80] = R0;
  66. R0 = L2;
  67. [P0 + 0x84] = R0;
  68. R0 = L3;
  69. [P0 + 0x88] = R0;
  70. R0 = B0; // Base Registers
  71. [P0 + 0x8C] = R0;
  72. R0 = B1;
  73. [P0 + 0x90] = R0;
  74. R0 = B2;
  75. [P0 + 0x94] = R0;
  76. R0 = B3;
  77. [P0 + 0x98] = R0;
  78. R0 = RETS;
  79. [P0 + 0x9C] = R0;
  80. R0 = [P0 + 0x20];
  81. R1 = 0;
  82. JUMP.L ___sigjmp_save;
  83. .size __setjmp,.-__setjmp