compiler-rt-emu.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. /* compiler-rt-emu.h - prototypes for compiler helpers. */
  2. /*
  3. * GRUB -- GRand Unified Bootloader
  4. * Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010-2014 Free Software Foundation, Inc.
  5. *
  6. * GRUB is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * GRUB is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef GRUB_COMPILER_RT_HEADER
  20. #define GRUB_COMPILER_RT_HEADER 1
  21. #include <config-util.h>
  22. #include <grub/types.h>
  23. #include <grub/symbol.h>
  24. #ifdef HAVE___UDIVSI3
  25. grub_uint32_t
  26. EXPORT_FUNC (__udivsi3) (grub_uint32_t a, grub_uint32_t b);
  27. #endif
  28. #ifdef HAVE___UMODSI3
  29. grub_uint32_t
  30. EXPORT_FUNC (__umodsi3) (grub_uint32_t a, grub_uint32_t b);
  31. #endif
  32. #ifdef HAVE___DIVSI3
  33. grub_int32_t
  34. EXPORT_FUNC (__divsi3) (grub_int32_t a, grub_int32_t b);
  35. #endif
  36. #ifdef HAVE___MODSI3
  37. grub_int32_t
  38. EXPORT_FUNC (__modsi3) (grub_int32_t a, grub_int32_t b);
  39. #endif
  40. #ifdef HAVE___DIVDI3
  41. grub_int64_t
  42. EXPORT_FUNC (__divdi3) (grub_int64_t a, grub_int64_t b);
  43. #endif
  44. #ifdef HAVE___MODDI3
  45. grub_int64_t
  46. EXPORT_FUNC (__moddi3) (grub_int64_t a, grub_int64_t b);
  47. #endif
  48. #ifdef HAVE___UDIVDI3
  49. grub_uint64_t
  50. EXPORT_FUNC (__udivdi3) (grub_uint64_t a, grub_uint64_t b);
  51. #endif
  52. #ifdef HAVE___UMODDI3
  53. grub_uint64_t
  54. EXPORT_FUNC (__umoddi3) (grub_uint64_t a, grub_uint64_t b);
  55. #endif
  56. #ifdef HAVE___CTZDI2
  57. unsigned
  58. EXPORT_FUNC (__ctzdi2) (grub_uint64_t x);
  59. #endif
  60. #ifdef HAVE___CTZSI2
  61. unsigned
  62. EXPORT_FUNC (__ctzsi2) (grub_uint32_t x);
  63. #endif
  64. #ifdef HAVE___CLZDI2
  65. int
  66. EXPORT_FUNC (__clzdi2) (grub_uint64_t x);
  67. #endif
  68. #ifdef HAVE___AEABI_UIDIV
  69. grub_uint32_t
  70. EXPORT_FUNC (__aeabi_uidiv) (grub_uint32_t a, grub_uint32_t b);
  71. #endif
  72. #ifdef HAVE___AEABI_UIDIVMOD
  73. grub_uint32_t
  74. EXPORT_FUNC (__aeabi_uidivmod) (grub_uint32_t a, grub_uint32_t b);
  75. #endif
  76. #ifdef HAVE___AEABI_IDIV
  77. grub_int32_t
  78. EXPORT_FUNC (__aeabi_idiv) (grub_int32_t a, grub_int32_t b);
  79. #endif
  80. #ifdef HAVE___AEABI_IDIVMOD
  81. grub_int32_t
  82. EXPORT_FUNC (__aeabi_idivmod) (grub_int32_t a, grub_int32_t b);
  83. #endif
  84. #ifdef HAVE___AEABI_ULCMP
  85. int
  86. EXPORT_FUNC (__aeabi_ulcmp) (grub_uint64_t a, grub_uint64_t b);
  87. #endif
  88. /* Needed for allowing modules to be compiled as thumb. */
  89. #ifdef HAVE___MULDI3
  90. grub_uint64_t
  91. EXPORT_FUNC (__muldi3) (grub_uint64_t a, grub_uint64_t b);
  92. #endif
  93. #ifdef HAVE___AEABI_LMUL
  94. grub_uint64_t
  95. EXPORT_FUNC (__aeabi_lmul) (grub_uint64_t a, grub_uint64_t b);
  96. #endif
  97. #ifdef HAVE___AEABI_MEMCPY
  98. void *
  99. EXPORT_FUNC (__aeabi_memcpy) (void *dest, const void *src, grub_size_t n);
  100. #endif
  101. #ifdef HAVE___AEABI_MEMCPY4
  102. void *
  103. EXPORT_FUNC (__aeabi_memcpy4) (void *dest, const void *src, grub_size_t n);
  104. #endif
  105. #ifdef HAVE___AEABI_MEMCPY8
  106. void *
  107. EXPORT_FUNC (__aeabi_memcpy8) (void *dest, const void *src, grub_size_t n);
  108. #endif
  109. #ifdef HAVE___AEABI_MEMSET
  110. void *
  111. EXPORT_FUNC(__aeabi_memset) (void *s, int c, grub_size_t n);
  112. #endif
  113. #ifdef HAVE___AEABI_MEMCLR
  114. void *
  115. EXPORT_FUNC(__aeabi_memclr) (void *s, grub_size_t n);
  116. #endif
  117. #ifdef HAVE___AEABI_MEMCLR4
  118. void *
  119. EXPORT_FUNC(__aeabi_memclr4) (void *s, grub_size_t n);
  120. #endif
  121. #ifdef HAVE___AEABI_MEMCLR8
  122. void *
  123. EXPORT_FUNC(__aeabi_memclr8) (void *s, grub_size_t n);
  124. #endif
  125. #ifdef HAVE___AEABI_LASR
  126. grub_uint64_t
  127. EXPORT_FUNC (__aeabi_lasr) (grub_uint64_t u, int b);
  128. #endif
  129. #ifdef HAVE___AEABI_LLSL
  130. grub_uint64_t
  131. EXPORT_FUNC (__aeabi_llsl) (grub_uint64_t u, int b);
  132. #endif
  133. #ifdef HAVE___AEABI_LLSR
  134. grub_uint64_t
  135. EXPORT_FUNC (__aeabi_llsr) (grub_uint64_t u, int b);
  136. #endif
  137. #ifdef HAVE__RESTGPR_14_X
  138. void EXPORT_FUNC (_restgpr_14_x) (void);
  139. void EXPORT_FUNC (_restgpr_15_x) (void);
  140. void EXPORT_FUNC (_restgpr_16_x) (void);
  141. void EXPORT_FUNC (_restgpr_17_x) (void);
  142. void EXPORT_FUNC (_restgpr_18_x) (void);
  143. void EXPORT_FUNC (_restgpr_19_x) (void);
  144. void EXPORT_FUNC (_restgpr_20_x) (void);
  145. void EXPORT_FUNC (_restgpr_21_x) (void);
  146. void EXPORT_FUNC (_restgpr_22_x) (void);
  147. void EXPORT_FUNC (_restgpr_23_x) (void);
  148. void EXPORT_FUNC (_restgpr_24_x) (void);
  149. void EXPORT_FUNC (_restgpr_25_x) (void);
  150. void EXPORT_FUNC (_restgpr_26_x) (void);
  151. void EXPORT_FUNC (_restgpr_27_x) (void);
  152. void EXPORT_FUNC (_restgpr_28_x) (void);
  153. void EXPORT_FUNC (_restgpr_29_x) (void);
  154. void EXPORT_FUNC (_restgpr_30_x) (void);
  155. void EXPORT_FUNC (_restgpr_31_x) (void);
  156. void EXPORT_FUNC (_savegpr_14) (void);
  157. void EXPORT_FUNC (_savegpr_15) (void);
  158. void EXPORT_FUNC (_savegpr_16) (void);
  159. void EXPORT_FUNC (_savegpr_17) (void);
  160. void EXPORT_FUNC (_savegpr_18) (void);
  161. void EXPORT_FUNC (_savegpr_19) (void);
  162. void EXPORT_FUNC (_savegpr_20) (void);
  163. void EXPORT_FUNC (_savegpr_21) (void);
  164. void EXPORT_FUNC (_savegpr_22) (void);
  165. void EXPORT_FUNC (_savegpr_23) (void);
  166. void EXPORT_FUNC (_savegpr_24) (void);
  167. void EXPORT_FUNC (_savegpr_25) (void);
  168. void EXPORT_FUNC (_savegpr_26) (void);
  169. void EXPORT_FUNC (_savegpr_27) (void);
  170. void EXPORT_FUNC (_savegpr_28) (void);
  171. void EXPORT_FUNC (_savegpr_29) (void);
  172. void EXPORT_FUNC (_savegpr_30) (void);
  173. void EXPORT_FUNC (_savegpr_31) (void);
  174. #endif
  175. #ifdef HAVE___UCMPDI2
  176. int
  177. EXPORT_FUNC(__ucmpdi2) (grub_uint64_t a, grub_uint64_t b);
  178. #endif
  179. #ifdef HAVE___ASHLDI3
  180. grub_uint64_t
  181. EXPORT_FUNC(__ashldi3) (grub_uint64_t u, int b);
  182. #endif
  183. #ifdef HAVE___ASHRDI3
  184. grub_uint64_t
  185. EXPORT_FUNC(__ashrdi3) (grub_uint64_t u, int b);
  186. #endif
  187. #ifdef HAVE___LSHRDI3
  188. grub_uint64_t
  189. EXPORT_FUNC (__lshrdi3) (grub_uint64_t u, int b);
  190. #endif
  191. #ifdef HAVE___BSWAPSI2
  192. grub_uint32_t
  193. EXPORT_FUNC(__bswapsi2) (grub_uint32_t u);
  194. #endif
  195. #ifdef HAVE___BSWAPDI2
  196. grub_uint64_t
  197. EXPORT_FUNC(__bswapdi2) (grub_uint64_t u);
  198. #endif
  199. int EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n);
  200. void *EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n);
  201. void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n);
  202. void *EXPORT_FUNC(memset) (void *s, int c, grub_size_t n);
  203. #ifdef HAVE___BZERO
  204. void EXPORT_FUNC (__bzero) (void *s, grub_size_t n);
  205. #endif
  206. #ifdef HAVE___REGISTER_FRAME_INFO
  207. void EXPORT_FUNC (__register_frame_info) (void);
  208. #endif
  209. #ifdef HAVE___DEREGISTER_FRAME_INFO
  210. void EXPORT_FUNC (__deregister_frame_info) (void);
  211. #endif
  212. #ifdef HAVE____CHKSTK_MS
  213. void EXPORT_FUNC (___chkstk_ms) (void);
  214. #endif
  215. #ifdef HAVE___CHKSTK_MS
  216. void EXPORT_FUNC (__chkstk_ms) (void);
  217. #endif
  218. #endif