__longjmp.S 1.8 KB

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