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 
25 #ifndef __ASMDEFS_H__
26 #define __ASMDEFS_H__
27 
28 //*****************************************************************************
29 //
30 // The defines required for code_red.
31 //
32 //*****************************************************************************
33 #ifdef codered
34 
35 //
36 // The assembly code preamble required to put the assembler into the correct
37 // configuration.
38 //
39     .syntax unified
40     .thumb
41 
42 //
43 // Section headers.
44 //
45 #define __LIBRARY__             @
46 #define __TEXT__                .text
47 #define __DATA__                .data
48 #define __BSS__                 .bss
49 #define __TEXT_NOROOT__         .text
50 
51 //
52 // Assembler nmenonics.
53 //
54 #define __ALIGN__               .balign 4
55 #define __END__                 .end
56 #define __EXPORT__              .globl
57 #define __IMPORT__              .extern
58 #define __LABEL__               :
59 #define __STR__                 .ascii
60 #define __THUMB_LABEL__         .thumb_func
61 #define __WORD__                .word
62 #define __INLINE_DATA__
63 
64 #endif // codered
65 
66 //*****************************************************************************
67 //
68 // The defines required for EW-ARM.
69 //
70 //*****************************************************************************
71 #ifdef ewarm
72 
73 //
74 // Section headers.
75 //
76 #define __LIBRARY__             module
77 #define __TEXT__                rseg CODE:CODE(2)
78 #define __DATA__                rseg DATA:DATA(2)
79 #define __BSS__                 rseg DATA:DATA(2)
80 #define __TEXT_NOROOT__         rseg CODE:CODE:NOROOT(2)
81 
82 //
83 // Assembler nmenonics.
84 //
85 #define __ALIGN__               alignrom 2
86 #define __END__                 end
87 #define __EXPORT__              export
88 #define __IMPORT__              import
89 #define __LABEL__
90 #define __STR__                 dcb
91 #define __THUMB_LABEL__         thumb
92 #define __WORD__                dcd
93 #define __INLINE_DATA__         data
94 
95 #endif // ewarm
96 
97 //*****************************************************************************
98 //
99 // The defines required for GCC.
100 //
101 //*****************************************************************************
102 #if defined(gcc)
103 
104 //
105 // The assembly code preamble required to put the assembler into the correct
106 // configuration.
107 //
108     .syntax unified
109     .thumb
110 
111 //
112 // Section headers.
113 //
114 #define __LIBRARY__             @
115 #define __TEXT__                .text
116 #define __DATA__                .data
117 #define __BSS__                 .bss
118 #define __TEXT_NOROOT__         .text
119 
120 //
121 // Assembler nmenonics.
122 //
123 #define __ALIGN__               .balign 4
124 #define __END__                 .end
125 #define __EXPORT__              .globl
126 #define __IMPORT__              .extern
127 #define __LABEL__               :
128 #define __STR__                 .ascii
129 #define __THUMB_LABEL__         .thumb_func
130 #define __WORD__                .word
131 #define __INLINE_DATA__
132 
133 #endif // gcc
134 
135 //*****************************************************************************
136 //
137 // The defines required for RV-MDK.
138 //
139 //*****************************************************************************
140 #ifdef rvmdk
141 
142 //
143 // The assembly code preamble required to put the assembler into the correct
144 // configuration.
145 //
146     thumb
147     require8
148     preserve8
149 
150 //
151 // Section headers.
152 //
153 #define __LIBRARY__             ;
154 #define __TEXT__                area ||.text||, code, readonly, align=2
155 #define __DATA__                area ||.data||, data, align=2
156 #define __BSS__                 area ||.bss||, noinit, align=2
157 #define __TEXT_NOROOT__         area ||.text||, code, readonly, align=2
158 
159 //
160 // Assembler nmenonics.
161 //
162 #define __ALIGN__               align 4
163 #define __END__                 end
164 #define __EXPORT__              export
165 #define __IMPORT__              import
166 #define __LABEL__
167 #define __STR__                 dcb
168 #define __THUMB_LABEL__
169 #define __WORD__                dcd
170 #define __INLINE_DATA__
171 
172 #endif // rvmdk
173 
174 //*****************************************************************************
175 //
176 // The defines required for Sourcery G++.
177 //
178 //*****************************************************************************
179 #if defined(sourcerygxx)
180 
181 //
182 // The assembly code preamble required to put the assembler into the correct
183 // configuration.
184 //
185     .syntax unified
186     .thumb
187 
188 //
189 // Section headers.
190 //
191 #define __LIBRARY__             @
192 #define __TEXT__                .text
193 #define __DATA__                .data
194 #define __BSS__                 .bss
195 #define __TEXT_NOROOT__         .text
196 
197 //
198 // Assembler nmenonics.
199 //
200 #define __ALIGN__               .balign 4
201 #define __END__                 .end
202 #define __EXPORT__              .globl
203 #define __IMPORT__              .extern
204 #define __LABEL__               :
205 #define __STR__                 .ascii
206 #define __THUMB_LABEL__         .thumb_func
207 #define __WORD__                .word
208 #define __INLINE_DATA__
209 
210 #endif // sourcerygxx
211 
212 #endif // __ASMDEF_H__
213