asmdefs.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. //*****************************************************************************
  2. //
  3. // asmdefs.h - Macros to allow assembly code be portable among toolchains.
  4. //
  5. // Copyright (c) 2005-2014 Texas Instruments Incorporated. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Redistribution and use in source and binary forms, with or without
  9. // modification, are permitted provided that the following conditions
  10. // are met:
  11. //
  12. // Redistributions of source code must retain the above copyright
  13. // notice, this list of conditions and the following disclaimer.
  14. //
  15. // Redistributions in binary form must reproduce the above copyright
  16. // notice, this list of conditions and the following disclaimer in the
  17. // documentation and/or other materials provided with the
  18. // distribution.
  19. //
  20. // Neither the name of Texas Instruments Incorporated nor the names of
  21. // its contributors may be used to endorse or promote products derived
  22. // from this software without specific prior written permission.
  23. //
  24. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  25. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  26. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  27. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  28. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  29. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  30. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  31. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  32. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  33. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  34. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. //
  36. // This is part of revision 2.1.0.12573 of the Tiva Firmware Development Package.
  37. //
  38. //*****************************************************************************
  39. #ifndef __ASMDEFS_H__
  40. #define __ASMDEFS_H__
  41. //*****************************************************************************
  42. //
  43. // The defines required for code_red.
  44. //
  45. //*****************************************************************************
  46. #ifdef codered
  47. //
  48. // The assembly code preamble required to put the assembler into the correct
  49. // configuration.
  50. //
  51. .syntax unified
  52. .thumb
  53. //
  54. // Section headers.
  55. //
  56. #define __LIBRARY__ @
  57. #define __TEXT__ .text
  58. #define __DATA__ .data
  59. #define __BSS__ .bss
  60. #define __TEXT_NOROOT__ .text
  61. //
  62. // Assembler nmenonics.
  63. //
  64. #define __ALIGN__ .balign 4
  65. #define __END__ .end
  66. #define __EXPORT__ .globl
  67. #define __IMPORT__ .extern
  68. #define __LABEL__ :
  69. #define __STR__ .ascii
  70. #define __THUMB_LABEL__ .thumb_func
  71. #define __WORD__ .word
  72. #define __INLINE_DATA__
  73. #endif // codered
  74. //*****************************************************************************
  75. //
  76. // The defines required for EW-ARM.
  77. //
  78. //*****************************************************************************
  79. #ifdef ewarm
  80. //
  81. // Section headers.
  82. //
  83. #define __LIBRARY__ module
  84. #define __TEXT__ rseg CODE:CODE(2)
  85. #define __DATA__ rseg DATA:DATA(2)
  86. #define __BSS__ rseg DATA:DATA(2)
  87. #define __TEXT_NOROOT__ rseg CODE:CODE:NOROOT(2)
  88. //
  89. // Assembler nmenonics.
  90. //
  91. #define __ALIGN__ alignrom 2
  92. #define __END__ end
  93. #define __EXPORT__ export
  94. #define __IMPORT__ import
  95. #define __LABEL__
  96. #define __STR__ dcb
  97. #define __THUMB_LABEL__ thumb
  98. #define __WORD__ dcd
  99. #define __INLINE_DATA__ data
  100. #endif // ewarm
  101. //*****************************************************************************
  102. //
  103. // The defines required for GCC.
  104. //
  105. //*****************************************************************************
  106. #if defined(gcc)
  107. //
  108. // The assembly code preamble required to put the assembler into the correct
  109. // configuration.
  110. //
  111. .syntax unified
  112. .thumb
  113. //
  114. // Section headers.
  115. //
  116. #define __LIBRARY__ @
  117. #define __TEXT__ .text
  118. #define __DATA__ .data
  119. #define __BSS__ .bss
  120. #define __TEXT_NOROOT__ .text
  121. //
  122. // Assembler nmenonics.
  123. //
  124. #define __ALIGN__ .balign 4
  125. #define __END__ .end
  126. #define __EXPORT__ .globl
  127. #define __IMPORT__ .extern
  128. #define __LABEL__ :
  129. #define __STR__ .ascii
  130. #define __THUMB_LABEL__ .thumb_func
  131. #define __WORD__ .word
  132. #define __INLINE_DATA__
  133. #endif // gcc
  134. //*****************************************************************************
  135. //
  136. // The defines required for RV-MDK.
  137. //
  138. //*****************************************************************************
  139. #ifdef rvmdk
  140. //
  141. // The assembly code preamble required to put the assembler into the correct
  142. // configuration.
  143. //
  144. thumb
  145. require8
  146. preserve8
  147. //
  148. // Section headers.
  149. //
  150. #define __LIBRARY__ ;
  151. #define __TEXT__ area ||.text||, code, readonly, align=2
  152. #define __DATA__ area ||.data||, data, align=2
  153. #define __BSS__ area ||.bss||, noinit, align=2
  154. #define __TEXT_NOROOT__ area ||.text||, code, readonly, align=2
  155. //
  156. // Assembler nmenonics.
  157. //
  158. #define __ALIGN__ align 4
  159. #define __END__ end
  160. #define __EXPORT__ export
  161. #define __IMPORT__ import
  162. #define __LABEL__
  163. #define __STR__ dcb
  164. #define __THUMB_LABEL__
  165. #define __WORD__ dcd
  166. #define __INLINE_DATA__
  167. #endif // rvmdk
  168. //*****************************************************************************
  169. //
  170. // The defines required for Sourcery G++.
  171. //
  172. //*****************************************************************************
  173. #if defined(sourcerygxx)
  174. //
  175. // The assembly code preamble required to put the assembler into the correct
  176. // configuration.
  177. //
  178. .syntax unified
  179. .thumb
  180. //
  181. // Section headers.
  182. //
  183. #define __LIBRARY__ @
  184. #define __TEXT__ .text
  185. #define __DATA__ .data
  186. #define __BSS__ .bss
  187. #define __TEXT_NOROOT__ .text
  188. //
  189. // Assembler nmenonics.
  190. //
  191. #define __ALIGN__ .balign 4
  192. #define __END__ .end
  193. #define __EXPORT__ .globl
  194. #define __IMPORT__ .extern
  195. #define __LABEL__ :
  196. #define __STR__ .ascii
  197. #define __THUMB_LABEL__ .thumb_func
  198. #define __WORD__ .word
  199. #define __INLINE_DATA__
  200. #endif // sourcerygxx
  201. #endif // __ASMDEF_H__