asmdefs.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. //*****************************************************************************
  2. //
  3. // asmdefs.h - Macros to allow assembly code be portable among toolchains.
  4. //
  5. // Copyright (c) 2005-2011 Texas Instruments Incorporated. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Texas Instruments (TI) is supplying this software for use solely and
  9. // exclusively on TI's microcontroller products. The software is owned by
  10. // TI and/or its suppliers, and is protected under applicable copyright
  11. // laws. You may not combine this software with "viral" open-source
  12. // software in order to form a larger program.
  13. //
  14. // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
  15. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
  16. // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17. // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
  18. // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
  19. // DAMAGES, FOR ANY REASON WHATSOEVER.
  20. //
  21. // This is part of revision 8264 of the Stellaris Firmware Development Package.
  22. //
  23. //*****************************************************************************
  24. #ifndef __ASMDEFS_H__
  25. #define __ASMDEFS_H__
  26. //*****************************************************************************
  27. //
  28. // The defines required for code_red.
  29. //
  30. //*****************************************************************************
  31. #ifdef codered
  32. //
  33. // The assembly code preamble required to put the assembler into the correct
  34. // configuration.
  35. //
  36. .syntax unified
  37. .thumb
  38. //
  39. // Section headers.
  40. //
  41. #define __LIBRARY__ @
  42. #define __TEXT__ .text
  43. #define __DATA__ .data
  44. #define __BSS__ .bss
  45. #define __TEXT_NOROOT__ .text
  46. //
  47. // Assembler nmenonics.
  48. //
  49. #define __ALIGN__ .balign 4
  50. #define __END__ .end
  51. #define __EXPORT__ .globl
  52. #define __IMPORT__ .extern
  53. #define __LABEL__ :
  54. #define __STR__ .ascii
  55. #define __THUMB_LABEL__ .thumb_func
  56. #define __WORD__ .word
  57. #define __INLINE_DATA__
  58. #endif // codered
  59. //*****************************************************************************
  60. //
  61. // The defines required for EW-ARM.
  62. //
  63. //*****************************************************************************
  64. #ifdef ewarm
  65. //
  66. // Section headers.
  67. //
  68. #define __LIBRARY__ module
  69. #define __TEXT__ rseg CODE:CODE(2)
  70. #define __DATA__ rseg DATA:DATA(2)
  71. #define __BSS__ rseg DATA:DATA(2)
  72. #define __TEXT_NOROOT__ rseg CODE:CODE:NOROOT(2)
  73. //
  74. // Assembler nmenonics.
  75. //
  76. #define __ALIGN__ alignrom 2
  77. #define __END__ end
  78. #define __EXPORT__ export
  79. #define __IMPORT__ import
  80. #define __LABEL__
  81. #define __STR__ dcb
  82. #define __THUMB_LABEL__ thumb
  83. #define __WORD__ dcd
  84. #define __INLINE_DATA__ data
  85. #endif // ewarm
  86. //*****************************************************************************
  87. //
  88. // The defines required for GCC.
  89. //
  90. //*****************************************************************************
  91. #if defined(gcc)
  92. //
  93. // The assembly code preamble required to put the assembler into the correct
  94. // configuration.
  95. //
  96. .syntax unified
  97. .thumb
  98. //
  99. // Section headers.
  100. //
  101. #define __LIBRARY__ @
  102. #define __TEXT__ .text
  103. #define __DATA__ .data
  104. #define __BSS__ .bss
  105. #define __TEXT_NOROOT__ .text
  106. //
  107. // Assembler nmenonics.
  108. //
  109. #define __ALIGN__ .balign 4
  110. #define __END__ .end
  111. #define __EXPORT__ .globl
  112. #define __IMPORT__ .extern
  113. #define __LABEL__ :
  114. #define __STR__ .ascii
  115. #define __THUMB_LABEL__ .thumb_func
  116. #define __WORD__ .word
  117. #define __INLINE_DATA__
  118. #endif // gcc
  119. //*****************************************************************************
  120. //
  121. // The defines required for RV-MDK.
  122. //
  123. //*****************************************************************************
  124. #ifdef rvmdk
  125. //
  126. // The assembly code preamble required to put the assembler into the correct
  127. // configuration.
  128. //
  129. thumb
  130. require8
  131. preserve8
  132. //
  133. // Section headers.
  134. //
  135. #define __LIBRARY__ ;
  136. #define __TEXT__ area ||.text||, code, readonly, align=2
  137. #define __DATA__ area ||.data||, data, align=2
  138. #define __BSS__ area ||.bss||, noinit, align=2
  139. #define __TEXT_NOROOT__ area ||.text||, code, readonly, align=2
  140. //
  141. // Assembler nmenonics.
  142. //
  143. #define __ALIGN__ align 4
  144. #define __END__ end
  145. #define __EXPORT__ export
  146. #define __IMPORT__ import
  147. #define __LABEL__
  148. #define __STR__ dcb
  149. #define __THUMB_LABEL__
  150. #define __WORD__ dcd
  151. #define __INLINE_DATA__
  152. #endif // rvmdk
  153. //*****************************************************************************
  154. //
  155. // The defines required for Sourcery G++.
  156. //
  157. //*****************************************************************************
  158. #if defined(sourcerygxx)
  159. //
  160. // The assembly code preamble required to put the assembler into the correct
  161. // configuration.
  162. //
  163. .syntax unified
  164. .thumb
  165. //
  166. // Section headers.
  167. //
  168. #define __LIBRARY__ @
  169. #define __TEXT__ .text
  170. #define __DATA__ .data
  171. #define __BSS__ .bss
  172. #define __TEXT_NOROOT__ .text
  173. //
  174. // Assembler nmenonics.
  175. //
  176. #define __ALIGN__ .balign 4
  177. #define __END__ .end
  178. #define __EXPORT__ .globl
  179. #define __IMPORT__ .extern
  180. #define __LABEL__ :
  181. #define __STR__ .ascii
  182. #define __THUMB_LABEL__ .thumb_func
  183. #define __WORD__ .word
  184. #define __INLINE_DATA__
  185. #endif // sourcerygxx
  186. #endif // __ASMDEF_H__