compiler-rt.S 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * Special support for eabi and SVR4
  3. *
  4. * Copyright (C) 1995-2014 Free Software Foundation, Inc.
  5. * Written By Michael Meissner
  6. * 64-bit support written by David Edelsohn
  7. *
  8. * This file is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 3, or (at your option) any
  11. * later version.
  12. *
  13. * This file is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * Under Section 7 of GPL version 3, you are granted additional
  19. * permissions described in the GCC Runtime Library Exception, version
  20. * 3.1, as published by the Free Software Foundation.
  21. *
  22. * You should have received a copy of the GNU General Public License and
  23. * a copy of the GCC Runtime Library Exception along with this program;
  24. * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  25. * <http://www.gnu.org/licenses/>.
  26. */
  27. /* Do any initializations needed for the eabi environment */
  28. #include <grub/symbol.h>
  29. #include <grub/dl.h>
  30. .section ".text"
  31. #define CFI_RESTORE(reg) .cfi_restore reg
  32. #define CFI_OFFSET(reg, off) .cfi_offset reg, off
  33. #define CFI_DEF_CFA_REGISTER(reg) .cfi_def_cfa_register reg
  34. #define CFI_STARTPROC .cfi_startproc
  35. #define CFI_ENDPROC .cfi_endproc
  36. /* Routines for restoring integer registers, called by the compiler. */
  37. /* Called with r11 pointing to the stack header word of the caller of the */
  38. /* function, just beyond the end of the integer restore area. */
  39. CFI_STARTPROC
  40. CFI_DEF_CFA_REGISTER (11)
  41. CFI_OFFSET (65, 4)
  42. CFI_OFFSET (14, -72)
  43. CFI_OFFSET (15, -68)
  44. CFI_OFFSET (16, -64)
  45. CFI_OFFSET (17, -60)
  46. CFI_OFFSET (18, -56)
  47. CFI_OFFSET (19, -52)
  48. CFI_OFFSET (20, -48)
  49. CFI_OFFSET (21, -44)
  50. CFI_OFFSET (22, -40)
  51. CFI_OFFSET (23, -36)
  52. CFI_OFFSET (24, -32)
  53. CFI_OFFSET (25, -28)
  54. CFI_OFFSET (26, -24)
  55. CFI_OFFSET (27, -20)
  56. CFI_OFFSET (28, -16)
  57. CFI_OFFSET (29, -12)
  58. CFI_OFFSET (30, -8)
  59. CFI_OFFSET (31, -4)
  60. FUNCTION(_restgpr_14_x) lwz 14,-72(11) /* restore gp registers */
  61. CFI_RESTORE (14)
  62. FUNCTION(_restgpr_15_x) lwz 15,-68(11)
  63. CFI_RESTORE (15)
  64. FUNCTION(_restgpr_16_x) lwz 16,-64(11)
  65. CFI_RESTORE (16)
  66. FUNCTION(_restgpr_17_x) lwz 17,-60(11)
  67. CFI_RESTORE (17)
  68. FUNCTION(_restgpr_18_x) lwz 18,-56(11)
  69. CFI_RESTORE (18)
  70. FUNCTION(_restgpr_19_x) lwz 19,-52(11)
  71. CFI_RESTORE (19)
  72. FUNCTION(_restgpr_20_x) lwz 20,-48(11)
  73. CFI_RESTORE (20)
  74. FUNCTION(_restgpr_21_x) lwz 21,-44(11)
  75. CFI_RESTORE (21)
  76. FUNCTION(_restgpr_22_x) lwz 22,-40(11)
  77. CFI_RESTORE (22)
  78. FUNCTION(_restgpr_23_x) lwz 23,-36(11)
  79. CFI_RESTORE (23)
  80. FUNCTION(_restgpr_24_x) lwz 24,-32(11)
  81. CFI_RESTORE (24)
  82. FUNCTION(_restgpr_25_x) lwz 25,-28(11)
  83. CFI_RESTORE (25)
  84. FUNCTION(_restgpr_26_x) lwz 26,-24(11)
  85. CFI_RESTORE (26)
  86. FUNCTION(_restgpr_27_x) lwz 27,-20(11)
  87. CFI_RESTORE (27)
  88. FUNCTION(_restgpr_28_x) lwz 28,-16(11)
  89. CFI_RESTORE (28)
  90. FUNCTION(_restgpr_29_x) lwz 29,-12(11)
  91. CFI_RESTORE (29)
  92. FUNCTION(_restgpr_30_x) lwz 30,-8(11)
  93. CFI_RESTORE (30)
  94. FUNCTION(_restgpr_31_x) lwz 0,4(11)
  95. lwz 31,-4(11)
  96. CFI_RESTORE (31)
  97. mtlr 0
  98. CFI_RESTORE (65)
  99. mr 1,11
  100. CFI_DEF_CFA_REGISTER (1)
  101. blr
  102. CFI_ENDPROC
  103. CFI_STARTPROC
  104. FUNCTION(_savegpr_14) stw 14,-72(11) /* save gp registers */
  105. FUNCTION(_savegpr_15) stw 15,-68(11)
  106. FUNCTION(_savegpr_16) stw 16,-64(11)
  107. FUNCTION(_savegpr_17) stw 17,-60(11)
  108. FUNCTION(_savegpr_18) stw 18,-56(11)
  109. FUNCTION(_savegpr_19) stw 19,-52(11)
  110. FUNCTION(_savegpr_20) stw 20,-48(11)
  111. FUNCTION(_savegpr_21) stw 21,-44(11)
  112. FUNCTION(_savegpr_22) stw 22,-40(11)
  113. FUNCTION(_savegpr_23) stw 23,-36(11)
  114. FUNCTION(_savegpr_24) stw 24,-32(11)
  115. FUNCTION(_savegpr_25) stw 25,-28(11)
  116. FUNCTION(_savegpr_26) stw 26,-24(11)
  117. FUNCTION(_savegpr_27) stw 27,-20(11)
  118. FUNCTION(_savegpr_28) stw 28,-16(11)
  119. FUNCTION(_savegpr_29) stw 29,-12(11)
  120. FUNCTION(_savegpr_30) stw 30,-8(11)
  121. FUNCTION(_savegpr_31) stw 31,-4(11)
  122. blr
  123. CFI_ENDPROC