asmdefs.h 6.3 KB

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