2 Copyright (C) 1997 Free Software Foundation, Inc.
3 Contributed by Cygnus Support.
5 This file is part of GDB, the GNU debugger.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
23 /* TI C80 control registers */
98 nr_tic80_control_regs
,
101 /* extern int tic80_cr2index (tic80_control_regs reg); */
103 /* Map an instruction CR index onto the corresponding internal cr enum
104 or SCRATCH_CR if the index is invalid */
106 extern tic80_control_regs
tic80_index2cr (int index
);
109 /* TIc80 interrupt register bits */
112 IE_CR_PE
= BIT32(31),
113 IE_CR_X4
= BIT32(30),
114 IE_CR_X3
= BIT32(29),
115 IE_CR_BP
= BIT32(28),
116 IE_CR_PB
= BIT32(27),
117 IE_CR_PC
= BIT32(26),
118 IE_CR_MI
= BIT32(25),
120 IE_CR_P3
= BIT32(19),
121 IE_CR_P2
= BIT32(18),
122 IE_CR_P1
= BIT32(17),
123 IE_CR_P0
= BIT32(16),
124 IE_CR_IO
= BIT32(15),
125 IE_CR_MF
= BIT32(14),
127 IE_CR_X2
= BIT32(12),
128 IE_CR_X1
= BIT32(11),
129 IE_CR_TI
= BIT32(10),
148 unsigned32 cr
[nr_tic80_control_regs
];
149 int is_user_mode
; /* hidden mode latch */
154 #define GPR(N) ((CPU)->reg[N])
155 #define ACC(N) ((CPU)->acc[N])
156 #define CR(N) ((CPU)->cr[tic80_index2cr ((N))])
160 #if defined(WITH_TRACE)
161 extern char *tic80_trace_alu3
PARAMS ((int, unsigned32
, unsigned32
, unsigned32
));
162 extern char *tic80_trace_alu2
PARAMS ((int, unsigned32
, unsigned32
));
163 extern char *tic80_trace_shift
PARAMS ((int, unsigned32
, unsigned32
, int, int, int, int, int));
164 extern void tic80_trace_fpu3
PARAMS ((SIM_DESC
, sim_cpu
*, sim_cia
, int,
165 sim_fpu
, sim_fpu
, sim_fpu
));
166 extern void tic80_trace_fpu2
PARAMS ((SIM_DESC
, sim_cpu
*, sim_cia
, int,
168 extern void tic80_trace_fpu2i
PARAMS ((SIM_DESC
, sim_cpu
*, sim_cia
, int,
169 unsigned32
, sim_fpu
, sim_fpu
));
170 extern char *tic80_trace_nop
PARAMS ((int));
171 extern char *tic80_trace_sink1
PARAMS ((int, unsigned32
));
172 extern char *tic80_trace_sink2
PARAMS ((int, unsigned32
, unsigned32
));
173 extern char *tic80_trace_sink3
PARAMS ((int, unsigned32
, unsigned32
, unsigned32
));
174 extern char *tic80_trace_cond_br
PARAMS ((int, int, unsigned32
, unsigned32
));
175 extern char *tic80_trace_ucond_br
PARAMS ((int, unsigned32
));
176 extern char *tic80_trace_ldst
PARAMS ((int, int, int, int, unsigned32
, unsigned32
, unsigned32
));
178 #define TRACE_ALU3(indx, result, input1, input2) \
180 if (TRACE_ALU_P (CPU)) { \
181 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
182 itable[indx].line_nr, "alu", \
183 tic80_trace_alu3 (indx, result, input1, input2)); \
187 #define TRACE_ALU2(indx, result, input) \
189 if (TRACE_ALU_P (CPU)) { \
190 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
191 itable[indx].line_nr, "alu", \
192 tic80_trace_alu2 (indx, result, input)); \
196 #define TRACE_SHIFT(indx, result, input, i, n, merge, endmask, rotate) \
198 if (TRACE_ALU_P (CPU)) { \
199 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
200 itable[indx].line_nr, "shift", \
201 tic80_trace_shift (indx, result, input, i, n, \
202 merge, endmask, rotate)); \
206 #define TRACE_FPU3(indx, result, input1, input2) \
208 if (TRACE_FPU_P (CPU)) { \
209 tic80_trace_fpu3 (SD, CPU, cia, indx, result, input1, input2); \
213 #define TRACE_FPU2(indx, result, input) \
215 if (TRACE_FPU_P (CPU)) { \
216 tic80_trace_fpu2 (SD, CPU, cia, indx, result, input); \
220 #define TRACE_FPU2I(indx, result, input1, input2) \
222 if (TRACE_FPU_P (CPU)) { \
223 tic80_trace_fpu2i (SD, CPU, cia, indx, result, input1, input2); \
227 #define TRACE_NOP(indx) \
229 if (TRACE_ALU_P (CPU)) { \
230 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
231 itable[indx].line_nr, "nop", \
232 tic80_trace_nop (indx)); \
236 #define TRACE_SINK1(indx, input) \
238 if (TRACE_ALU_P (CPU)) { \
239 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
240 itable[indx].line_nr, "nop", \
241 tic80_trace_sink1 (indx, input)); \
245 #define TRACE_SINK2(indx, input1, input2) \
247 if (TRACE_ALU_P (CPU)) { \
248 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
249 itable[indx].line_nr, "nop", \
250 tic80_trace_sink2 (indx, input1, input2)); \
254 #define TRACE_SINK3(indx, input1, input2, input3) \
256 if (TRACE_ALU_P (CPU)) { \
257 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
258 itable[indx].line_nr, "nop", \
259 tic80_trace_sink3 (indx, input1, input2, input3)); \
263 #define TRACE_COND_BR(indx, jump_p, cond, target) \
265 if (TRACE_BRANCH_P (CPU)) { \
266 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
267 itable[indx].line_nr, "branch", \
268 tic80_trace_cond_br (indx, jump_p, cond, target)); \
272 #define TRACE_UCOND_BR(indx, target) \
274 if (TRACE_ALU_P (CPU)) { \
275 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
276 itable[indx].line_nr, "branch", \
277 tic80_trace_ucond_br (indx, target)); \
281 #define TRACE_LD(indx, result, m, s, addr1, addr2) \
283 if (TRACE_MEMORY_P (CPU)) { \
284 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
285 itable[indx].line_nr, "memory", \
286 tic80_trace_ldst (indx, 0, m, s, result, \
291 #define TRACE_ST(indx, value, m, s, addr1, addr2) \
293 if (TRACE_MEMORY_P (CPU)) { \
294 trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file, \
295 itable[indx].line_nr, "memory", \
296 tic80_trace_ldst (indx, 1, m, s, value, \
302 #define TRACE_ALU3(indx, result, input1, input2)
303 #define TRACE_ALU2(indx, result, input)
304 #define TRACE_NOP(indx)
305 #define TRACE_SINK1(indx, input)
306 #define TRACE_SINK2(indx, input1, input2)
307 #define TRACE_SINK3(indx, input1, input2, input3)
308 #define TRACE_COND_BR(indx, jump_p, cond, target)
309 #define TRACE_UCOND_BR(indx, target)
310 #define TRACE_LD(indx, m, s, result, addr1, addr2)
311 #define TRACE_ST(indx, m, s, value, addr1, addr2)
This page took 0.03455 seconds and 4 git commands to generate.