1 /****************************************************************************/
2 /* COFF_TRG.H */
3 /* This file contains target dependent parameters for COFF files. */
4 /****************************************************************************/
5 #ifndef COFF_TRG_H
6 #define COFF_TRG_H
8 #if defined(TOOL_ASSEMBLER)
9 #error The COFF submodule should no longer be used by the assembler; use TICOFF04
10 #endif
12 /*--------------------------------------------------------------------------*/
13 /* TMS340 (GSP) Target Specific Parameters (bit-addressable) */
14 /*--------------------------------------------------------------------------*/
15 #if TMS340
16 #define MAGIC MAGIC_340 /* Magic number for GSP */
17 #define TRG_MEM_WIDTH 1 /* Bit address */
18 #endif
20 /*--------------------------------------------------------------------------*/
21 /* TMS370/C8 Target Specific Parameters (byte-addressable) */
22 /*--------------------------------------------------------------------------*/
23 #if TMS370
24 #define MAGIC MAGIC_370 /* 370 Magic number */
25 #define TRG_MEM_WIDTH 8 /* Byte address */
26 #endif
28 #if TMS370C8
29 #define MAGIC MAGIC_370 /* C8 Magic number */
30 #define TRG_MEM_WIDTH 8 /* Byte address */
31 #endif
33 #if TMS370C8P
34 #define MAGIC MAGIC_C8P /* C8 Magic number */
35 #define TRG_MEM_WIDTH 8 /* Byte address */
36 #endif
38 /*--------------------------------------------------------------------------*/
39 /* TMS37016 (C16) Target Specific Parameters (byte-addressable) */
40 /*--------------------------------------------------------------------------*/
41 #if TMS37016
42 #define MAGIC MAGIC_C16 /* 370/16 Magic number */
43 #define TRG_MEM_WIDTH 8 /* Byte address */
44 #endif
46 /*--------------------------------------------------------------------------*/
47 /* TMS32030 (C30) Target Specific Parameters (32-bit word-addressable) */
48 /*--------------------------------------------------------------------------*/
49 #if TMS32030
50 #define MAGIC MAGIC_C30 /* Magic number for C30 */
51 #define TRG_MEM_WIDTH 32 /* 32-bit address */
52 #endif
54 /*--------------------------------------------------------------------------*/
55 /* TMS32025 (DSP) Target Specific Parameters (16-bit word-addressable) */
56 /*--------------------------------------------------------------------------*/
57 #if TMS32025
58 #define MAGIC MAGIC_DSP /* Magic number for C1x/2x/5x */
59 #define TRG_MEM_WIDTH 16 /* 16-bit address */
60 #endif
62 /*--------------------------------------------------------------------------*/
63 /* TMS380 (EGL) Target Specific Parameters (byte-addressable) */
64 /*--------------------------------------------------------------------------*/
65 #if TMS380
66 #define MAGIC MAGIC_380 /* Magic number for TMS380 */
67 #define TRG_MEM_WIDTH 8 /* Byte address */
68 #endif
70 /*--------------------------------------------------------------------------*/
71 /* TMS320C8x (MVP MP/PP) Target Specific Parameters (byte-addressable) */
72 /*--------------------------------------------------------------------------*/
73 #if MVP_PP || MVP_MP
74 #define MAGIC MAGIC_MVP /* Magic number for PP */
75 #define TRG_MEM_WIDTH 8 /* Byte address */
76 #endif
78 /*--------------------------------------------------------------------------*/
79 /* TMS320C54x (LEAD) Target Specific Parameters (16-bit word-addressable) */
80 /*--------------------------------------------------------------------------*/
81 #if LEAD
82 #define MAGIC MAGIC_LEAD /* Magic number for C5xx */
83 #define TRG_MEM_WIDTH 16 /* 16-bit address */
84 #define TRG_INST_ALIGN 16 /* Instruction alignment */
85 #endif
87 /*--------------------------------------------------------------------------*/
88 /* TMS470 (ARM) Target Specific Parameters (byte-addressable) */
89 /*--------------------------------------------------------------------------*/
90 #if ARM
91 #define MAGIC MAGIC_ARM /* Magic number for ARM */
92 #define TRG_MEM_WIDTH 8 /* Byte address */
93 #define TRG_ARM_MODE 0 /* ARM setting for curr_objmode */
94 #define TRG_THUMB_MODE 1 /* Thumb setting for curr_objmode */
95 #ifndef TRG_INST_ALIGN_THUMB
96 #define TRG_INST_ALIGN_THUMB 16
97 #endif
99 #ifndef TRG_INST_ALIGN_ARM
100 #define TRG_INST_ALIGN_ARM 32
101 #endif
103 #ifndef TRG_INST_ALIGN
104 #define TRG_INST_ALIGN (curr_objmode == TRG_ARM_MODE ? \
105 TRG_INST_ALIGN_ARM \
106 : TRG_INST_ALIGN_THUMB)
107 #endif
108 extern unsigned char curr_objmode;
110 /*------------------------------------------------------------------------*/
111 /* Target device identification flags (bits 4-7 in file header flags) */
112 /*------------------------------------------------------------------------*/
113 #define F_ARM9ABI 0x10 /* 0x10 = ARM9ABI, 0x00 = TIABI */
114 #define F_ARCH4 0x20 /* ARCH4 = ARM7 */
115 #define F_ARCH5E 0x40 /* ARCH5E = ARM9 */
116 #define F_ARCH6 0x60 /* ARCH6 = ARM11 */
117 #define F_DMODE 0x80 /* DUAL MODE */
118 #define ARCH_MASK 0x60
120 #define ARCH5E_FLAGS(flg) ((flg & ARCH_MASK) == F_ARCH5E)
121 #define ARCH6_FLAGS(flg) ((flg & ARCH_MASK) == F_ARCH6)
122 #define ARCH4_FLAGS(flg) ((flg & ARCH_MASK) == F_ARCH4)
124 #undef F_VERSION
125 #define F_VERSION ( F_ARM9ABI | F_ARCH4 | \
126 F_ARCH5E | F_DMODE )
127 #endif
130 /*--------------------------------------------------------------------------*/
131 /* TMS320C6x Target Specific Parameters (byte-addressable) */
132 /*--------------------------------------------------------------------------*/
133 #if TMS32060
134 #define MAGIC MAGIC_C60 /* Magic number for C60 */
135 #define TRG_MEM_WIDTH 8 /* Byte address */
136 #define TRG_INST_ALIGN 32 /* Instruction alignment */
137 #endif
139 /*--------------------------------------------------------------------------*/
140 /* TARANTULA Target Specific Parameters (byte-addressable) */
141 /*--------------------------------------------------------------------------*/
142 #if TARANTULA
143 #define MAGIC MAGIC_TARANTULA /* Magic number for TARANTULA */
144 #define TRG_MEM_WIDTH 8 /* Byte address */
145 #endif
147 /*--------------------------------------------------------------------------*/
148 /* TMS320C2xxx (Ankoor) Target Specific Parameters (16-bit word-addressable)*/
149 /*--------------------------------------------------------------------------*/
150 #if RTC
151 #define MAGIC MAGIC_ANKOOR /* Magic number for Ankoor */
152 #define TRG_MEM_WIDTH 16 /* 16-bit address */
153 #define TRG_INST_ALIGN 16 /* Instruction alignment */
154 #endif
156 /*--------------------------------------------------------------------------*/
157 /* TMS320C55xx (LEAD3) Target Specific Parameters (byte-addressable code) */
158 /* (16-bit word-addressable data) */
159 /*--------------------------------------------------------------------------*/
160 #if LEAD3
161 /*--------------------------------------------------------------------------*/
162 /* The C55x object consumers can accept either Laijin or Ryujin object */
163 /* files, so ISMAGIC() becomes a target-specific macro, and MAGIC is not */
164 /* defined. */
165 /*--------------------------------------------------------------------------*/
166 #define ISMAGIC(x) (((unsigned short)(x)) == MAGIC_LEAD3 || \
167 ((unsigned short)(x)) == MAGIC_LEAD3_R35)
169 #define TRG_MEM_WIDTH 8 /* Byte address */
170 #define TRG_INST_ALIGN 8 /* Instruction alignment */
171 #endif
173 /*--------------------------------------------------------------------------*/
174 /* MSP430 Target Specific Parameters (byte-addressable) */
175 /*--------------------------------------------------------------------------*/
176 #if MSP
177 #define MAGIC MAGIC_MSP /* Magic number for MSP */
178 #define TRG_MEM_WIDTH 8 /* Byte address */
179 #define TRG_INST_ALIGN 16
180 #endif
182 /*--------------------------------------------------------------------------*/
183 /* IF WE DIDN'T DEFINE ANY TARGET, DEFINE THEM TO SOMETHING... */
184 /*--------------------------------------------------------------------------*/
185 #ifndef TRG_MEM_WIDTH
186 #define TRG_MEM_WIDTH 8 /* ARBITRARY... */
187 #endif
189 #ifndef TRG_INST_ALIGN
190 #define TRG_INST_ALIGN 32 /* Instruction alignment */
191 #endif
193 #ifndef MAGIC
194 #define MAGIC 0 /* ARBITRARY... */
195 #endif
197 #ifndef ISMAGIC
198 #define ISMAGIC(x) (((unsigned short)(x)) == MAGIC)
199 #endif
201 #endif /* COFF_TRG_H */