OSDN Git Service

* xtensa-tdep.h (xtensa_reg_mask_t): New.
[pf3gnuchains/pf3gnuchains3x.git] / gdb / xtensa-config.c
1 /* Configuration for the Xtensa architecture for GDB, the GNU debugger.
2
3    Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
4
5    This file is part of GDB.
6
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 of the License, or
10    (at your option) any later version.
11
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.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin Street, Fifth Floor,
20    Boston, MA 02110-1301, USA.  */
21
22 #include "xtensa-config.h"
23 #include "defs.h"
24 #include "gdbarch.h"
25 #include "xtensa-tdep.h"
26 #include "gdbtypes.h"
27
28 /* Check version of configuration file.  */
29 #define XTENSA_CONFIG_VERSION 0x60
30 #if XTENSA_TDEP_VERSION != XTENSA_CONFIG_VERSION
31 #warning "xtensa-config.c version mismatch!"
32 #endif
33
34
35 /* Return the byte order from the configuration.
36    We need this function, because the byte order is needed even
37    before the target structure (tdep) has been set up.  */
38
39 int
40 xtensa_config_byte_order (void)
41 {
42   return XCHAL_HAVE_BE ? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
43 }
44
45
46 /* This routine returns the predefined architecture-dependent
47    parameter structure (tdep) and register map.  */
48
49 struct gdbarch_tdep xtensa_tdep;
50
51 struct gdbarch_tdep *
52 xtensa_config_tdep (struct gdbarch_info *info)
53 {
54   return &xtensa_tdep;
55 }
56
57
58 /* Masked registers.  */
59 xtensa_reg_mask_t xtensa_submask0[] = { { 96, 0, 4 } };
60 const xtensa_mask_t xtensa_mask0 = { 1, xtensa_submask0 };
61 xtensa_reg_mask_t xtensa_submask1[] = { { 96, 5, 1 } };
62 const xtensa_mask_t xtensa_mask1 = { 1, xtensa_submask1 };
63 xtensa_reg_mask_t xtensa_submask2[] = { { 96, 18, 1 } };
64 const xtensa_mask_t xtensa_mask2 = { 1, xtensa_submask2 };
65 xtensa_reg_mask_t xtensa_submask3[] = { { 96, 6, 2 } };
66 const xtensa_mask_t xtensa_mask3 = { 1, xtensa_submask3 };
67 xtensa_reg_mask_t xtensa_submask4[] = { { 96, 4, 1 } };
68 const xtensa_mask_t xtensa_mask4 = { 1, xtensa_submask4 };
69 xtensa_reg_mask_t xtensa_submask5[] = { { 96, 16, 2 } };
70 const xtensa_mask_t xtensa_mask5 = { 1, xtensa_submask5 };
71 xtensa_reg_mask_t xtensa_submask6[] = { { 96, 8, 4 } };
72 const xtensa_mask_t xtensa_mask6 = { 1, xtensa_submask6 };
73 xtensa_reg_mask_t xtensa_submask7[] = { { 95, 12, 20 } };
74 const xtensa_mask_t xtensa_mask7 = { 1, xtensa_submask7 };
75 xtensa_reg_mask_t xtensa_submask8[] = { { 95, 0, 1 } };
76 const xtensa_mask_t xtensa_mask8 = { 1, xtensa_submask8 };
77 xtensa_reg_mask_t xtensa_submask9[] = { { 108, 8, 4 } };
78 const xtensa_mask_t xtensa_mask9 = { 1, xtensa_submask9 };
79 xtensa_reg_mask_t xtensa_submask10[] = { { 109, 24, 8 } };
80 const xtensa_mask_t xtensa_mask10 = { 1, xtensa_submask10 };
81 xtensa_reg_mask_t xtensa_submask11[] = { { 109, 16, 8 } };
82 const xtensa_mask_t xtensa_mask11 = { 1, xtensa_submask11 };
83 xtensa_reg_mask_t xtensa_submask12[] = { { 109, 8, 8 } };
84 const xtensa_mask_t xtensa_mask12 = { 1, xtensa_submask12 };
85 xtensa_reg_mask_t xtensa_submask13[] = { { 110, 16, 2 } };
86 const xtensa_mask_t xtensa_mask13 = { 1, xtensa_submask13 };
87 xtensa_reg_mask_t xtensa_submask14[] = { { 111, 16, 2 } };
88 const xtensa_mask_t xtensa_mask14 = { 1, xtensa_submask14 };
89 xtensa_reg_mask_t xtensa_submask15[] = { { 67, 22, 10 } };
90 const xtensa_mask_t xtensa_mask15 = { 1, xtensa_submask15 };
91
92
93 /* Register map.  */
94 xtensa_register_t rmap[] = 
95 {
96   { /* 0000 */ "ar0", 0, xtRegisterTypeArRegfile, 0x2, 0, 
97     32, 4, 4, 0x00000100, 0x0006, 0, 
98     0, 0 },
99   { /* 0001 */ "ar1", 4, xtRegisterTypeArRegfile, 0x2, 0, 
100     32, 4, 4, 0x00000101, 0x0006, 0, 
101     0, 0 },
102   { /* 0002 */ "ar2", 8, xtRegisterTypeArRegfile, 0x2, 0, 
103     32, 4, 4, 0x00000102, 0x0006, 0, 
104     0, 0 },
105   { /* 0003 */ "ar3", 12, xtRegisterTypeArRegfile, 0x2, 0, 
106     32, 4, 4, 0x00000103, 0x0006, 0, 
107     0, 0 },
108   { /* 0004 */ "ar4", 16, xtRegisterTypeArRegfile, 0x2, 0, 
109     32, 4, 4, 0x00000104, 0x0006, 0, 
110     0, 0 },
111   { /* 0005 */ "ar5", 20, xtRegisterTypeArRegfile, 0x2, 0, 
112     32, 4, 4, 0x00000105, 0x0006, 0, 
113     0, 0 },
114   { /* 0006 */ "ar6", 24, xtRegisterTypeArRegfile, 0x2, 0, 
115     32, 4, 4, 0x00000106, 0x0006, 0, 
116     0, 0 },
117   { /* 0007 */ "ar7", 28, xtRegisterTypeArRegfile, 0x2, 0, 
118     32, 4, 4, 0x00000107, 0x0006, 0, 
119     0, 0 },
120   { /* 0008 */ "ar8", 32, xtRegisterTypeArRegfile, 0x2, 0, 
121     32, 4, 4, 0x00000108, 0x0006, 0, 
122     0, 0 },
123   { /* 0009 */ "ar9", 36, xtRegisterTypeArRegfile, 0x2, 0, 
124     32, 4, 4, 0x00000109, 0x0006, 0, 
125     0, 0 },
126   { /* 0010 */ "ar10", 40, xtRegisterTypeArRegfile, 0x2, 0, 
127     32, 4, 4, 0x0000010a, 0x0006, 0, 
128     0, 0 },
129   { /* 0011 */ "ar11", 44, xtRegisterTypeArRegfile, 0x2, 0, 
130     32, 4, 4, 0x0000010b, 0x0006, 0, 
131     0, 0 },
132   { /* 0012 */ "ar12", 48, xtRegisterTypeArRegfile, 0x2, 0, 
133     32, 4, 4, 0x0000010c, 0x0006, 0, 
134     0, 0 },
135   { /* 0013 */ "ar13", 52, xtRegisterTypeArRegfile, 0x2, 0, 
136     32, 4, 4, 0x0000010d, 0x0006, 0, 
137     0, 0 },
138   { /* 0014 */ "ar14", 56, xtRegisterTypeArRegfile, 0x2, 0, 
139     32, 4, 4, 0x0000010e, 0x0006, 0, 
140     0, 0 },
141   { /* 0015 */ "ar15", 60, xtRegisterTypeArRegfile, 0x2, 0, 
142     32, 4, 4, 0x0000010f, 0x0006, 0, 
143     0, 0 },
144   { /* 0016 */ "ar16", 64, xtRegisterTypeArRegfile, 0x2, 0, 
145     32, 4, 4, 0x00000110, 0x0006, 0, 
146     0, 0 },
147   { /* 0017 */ "ar17", 68, xtRegisterTypeArRegfile, 0x2, 0, 
148     32, 4, 4, 0x00000111, 0x0006, 0, 
149     0, 0 },
150   { /* 0018 */ "ar18", 72, xtRegisterTypeArRegfile, 0x2, 0, 
151     32, 4, 4, 0x00000112, 0x0006, 0, 
152     0, 0 },
153   { /* 0019 */ "ar19", 76, xtRegisterTypeArRegfile, 0x2, 0, 
154     32, 4, 4, 0x00000113, 0x0006, 0, 
155     0, 0 },
156   { /* 0020 */ "ar20", 80, xtRegisterTypeArRegfile, 0x2, 0, 
157     32, 4, 4, 0x00000114, 0x0006, 0, 
158     0, 0 },
159   { /* 0021 */ "ar21", 84, xtRegisterTypeArRegfile, 0x2, 0, 
160     32, 4, 4, 0x00000115, 0x0006, 0, 
161     0, 0 },
162   { /* 0022 */ "ar22", 88, xtRegisterTypeArRegfile, 0x2, 0, 
163     32, 4, 4, 0x00000116, 0x0006, 0, 
164     0, 0 },
165   { /* 0023 */ "ar23", 92, xtRegisterTypeArRegfile, 0x2, 0, 
166     32, 4, 4, 0x00000117, 0x0006, 0, 
167     0, 0 },
168   { /* 0024 */ "ar24", 96, xtRegisterTypeArRegfile, 0x2, 0, 
169     32, 4, 4, 0x00000118, 0x0006, 0, 
170     0, 0 },
171   { /* 0025 */ "ar25", 100, xtRegisterTypeArRegfile, 0x2, 0, 
172     32, 4, 4, 0x00000119, 0x0006, 0, 
173     0, 0 },
174   { /* 0026 */ "ar26", 104, xtRegisterTypeArRegfile, 0x2, 0, 
175     32, 4, 4, 0x0000011a, 0x0006, 0, 
176     0, 0 },
177   { /* 0027 */ "ar27", 108, xtRegisterTypeArRegfile, 0x2, 0, 
178     32, 4, 4, 0x0000011b, 0x0006, 0, 
179     0, 0 },
180   { /* 0028 */ "ar28", 112, xtRegisterTypeArRegfile, 0x2, 0, 
181     32, 4, 4, 0x0000011c, 0x0006, 0, 
182     0, 0 },
183   { /* 0029 */ "ar29", 116, xtRegisterTypeArRegfile, 0x2, 0, 
184     32, 4, 4, 0x0000011d, 0x0006, 0, 
185     0, 0 },
186   { /* 0030 */ "ar30", 120, xtRegisterTypeArRegfile, 0x2, 0, 
187     32, 4, 4, 0x0000011e, 0x0006, 0, 
188     0, 0 },
189   { /* 0031 */ "ar31", 124, xtRegisterTypeArRegfile, 0x2, 0, 
190     32, 4, 4, 0x0000011f, 0x0006, 0, 
191     0, 0 },
192   { /* 0032 */ "ar32", 128, xtRegisterTypeArRegfile, 0x2, 0, 
193     32, 4, 4, 0x00000120, 0x0006, 0, 
194     0, 0 },
195   { /* 0033 */ "ar33", 132, xtRegisterTypeArRegfile, 0x2, 0, 
196     32, 4, 4, 0x00000121, 0x0006, 0, 
197     0, 0 },
198   { /* 0034 */ "ar34", 136, xtRegisterTypeArRegfile, 0x2, 0, 
199     32, 4, 4, 0x00000122, 0x0006, 0, 
200     0, 0 },
201   { /* 0035 */ "ar35", 140, xtRegisterTypeArRegfile, 0x2, 0, 
202     32, 4, 4, 0x00000123, 0x0006, 0, 
203     0, 0 },
204   { /* 0036 */ "ar36", 144, xtRegisterTypeArRegfile, 0x2, 0, 
205     32, 4, 4, 0x00000124, 0x0006, 0, 
206     0, 0 },
207   { /* 0037 */ "ar37", 148, xtRegisterTypeArRegfile, 0x2, 0, 
208     32, 4, 4, 0x00000125, 0x0006, 0, 
209     0, 0 },
210   { /* 0038 */ "ar38", 152, xtRegisterTypeArRegfile, 0x2, 0, 
211     32, 4, 4, 0x00000126, 0x0006, 0, 
212     0, 0 },
213   { /* 0039 */ "ar39", 156, xtRegisterTypeArRegfile, 0x2, 0, 
214     32, 4, 4, 0x00000127, 0x0006, 0, 
215     0, 0 },
216   { /* 0040 */ "ar40", 160, xtRegisterTypeArRegfile, 0x2, 0, 
217     32, 4, 4, 0x00000128, 0x0006, 0, 
218     0, 0 },
219   { /* 0041 */ "ar41", 164, xtRegisterTypeArRegfile, 0x2, 0, 
220     32, 4, 4, 0x00000129, 0x0006, 0, 
221     0, 0 },
222   { /* 0042 */ "ar42", 168, xtRegisterTypeArRegfile, 0x2, 0, 
223     32, 4, 4, 0x0000012a, 0x0006, 0, 
224     0, 0 },
225   { /* 0043 */ "ar43", 172, xtRegisterTypeArRegfile, 0x2, 0, 
226     32, 4, 4, 0x0000012b, 0x0006, 0, 
227     0, 0 },
228   { /* 0044 */ "ar44", 176, xtRegisterTypeArRegfile, 0x2, 0, 
229     32, 4, 4, 0x0000012c, 0x0006, 0, 
230     0, 0 },
231   { /* 0045 */ "ar45", 180, xtRegisterTypeArRegfile, 0x2, 0, 
232     32, 4, 4, 0x0000012d, 0x0006, 0, 
233     0, 0 },
234   { /* 0046 */ "ar46", 184, xtRegisterTypeArRegfile, 0x2, 0, 
235     32, 4, 4, 0x0000012e, 0x0006, 0, 
236     0, 0 },
237   { /* 0047 */ "ar47", 188, xtRegisterTypeArRegfile, 0x2, 0, 
238     32, 4, 4, 0x0000012f, 0x0006, 0, 
239     0, 0 },
240   { /* 0048 */ "ar48", 192, xtRegisterTypeArRegfile, 0x2, 0, 
241     32, 4, 4, 0x00000130, 0x0006, 0, 
242     0, 0 },
243   { /* 0049 */ "ar49", 196, xtRegisterTypeArRegfile, 0x2, 0, 
244     32, 4, 4, 0x00000131, 0x0006, 0, 
245     0, 0 },
246   { /* 0050 */ "ar50", 200, xtRegisterTypeArRegfile, 0x2, 0, 
247     32, 4, 4, 0x00000132, 0x0006, 0, 
248     0, 0 },
249   { /* 0051 */ "ar51", 204, xtRegisterTypeArRegfile, 0x2, 0, 
250     32, 4, 4, 0x00000133, 0x0006, 0, 
251     0, 0 },
252   { /* 0052 */ "ar52", 208, xtRegisterTypeArRegfile, 0x2, 0, 
253     32, 4, 4, 0x00000134, 0x0006, 0, 
254     0, 0 },
255   { /* 0053 */ "ar53", 212, xtRegisterTypeArRegfile, 0x2, 0, 
256     32, 4, 4, 0x00000135, 0x0006, 0, 
257     0, 0 },
258   { /* 0054 */ "ar54", 216, xtRegisterTypeArRegfile, 0x2, 0, 
259     32, 4, 4, 0x00000136, 0x0006, 0, 
260     0, 0 },
261   { /* 0055 */ "ar55", 220, xtRegisterTypeArRegfile, 0x2, 0, 
262     32, 4, 4, 0x00000137, 0x0006, 0, 
263     0, 0 },
264   { /* 0056 */ "ar56", 224, xtRegisterTypeArRegfile, 0x2, 0, 
265     32, 4, 4, 0x00000138, 0x0006, 0, 
266     0, 0 },
267   { /* 0057 */ "ar57", 228, xtRegisterTypeArRegfile, 0x2, 0, 
268     32, 4, 4, 0x00000139, 0x0006, 0, 
269     0, 0 },
270   { /* 0058 */ "ar58", 232, xtRegisterTypeArRegfile, 0x2, 0, 
271     32, 4, 4, 0x0000013a, 0x0006, 0, 
272     0, 0 },
273   { /* 0059 */ "ar59", 236, xtRegisterTypeArRegfile, 0x2, 0, 
274     32, 4, 4, 0x0000013b, 0x0006, 0, 
275     0, 0 },
276   { /* 0060 */ "ar60", 240, xtRegisterTypeArRegfile, 0x2, 0, 
277     32, 4, 4, 0x0000013c, 0x0006, 0, 
278     0, 0 },
279   { /* 0061 */ "ar61", 244, xtRegisterTypeArRegfile, 0x2, 0, 
280     32, 4, 4, 0x0000013d, 0x0006, 0, 
281     0, 0 },
282   { /* 0062 */ "ar62", 248, xtRegisterTypeArRegfile, 0x2, 0, 
283     32, 4, 4, 0x0000013e, 0x0006, 0, 
284     0, 0 },
285   { /* 0063 */ "ar63", 252, xtRegisterTypeArRegfile, 0x2, 0, 
286     32, 4, 4, 0x0000013f, 0x0006, 0, 
287     0, 0 },
288   { /* 0064 */ "lbeg", 256, xtRegisterTypeSpecialReg, 0x1100, 0, 
289     32, 4, 4, 0x00000200, 0x0006, 0, 
290     0, 0 },
291   { /* 0065 */ "lend", 260, xtRegisterTypeSpecialReg, 0x1100, 0, 
292     32, 4, 4, 0x00000201, 0x0006, 0, 
293     0, 0 },
294   { /* 0066 */ "lcount", 264, xtRegisterTypeSpecialReg, 0x1100, 0, 
295     32, 4, 4, 0x00000202, 0x0006, 0, 
296     0, 0 },
297   { /* 0067 */ "ptevaddr", 268, xtRegisterTypeSpecialReg, 0x1000, 0, 
298     32, 4, 4, 0x00000253, 0x0007, 0, 
299     0, 0 },
300   { /* 0068 */ "ddr", 272, xtRegisterTypeSpecialReg, 0x1000, 0, 
301     32, 4, 4, 0x00000268, 0x0007, 0, 
302     0, 0 },
303   { /* 0069 */ "interrupt", 276, xtRegisterTypeSpecialReg, 0x1000, 0, 
304     17, 4, 4, 0x000002e2, 0x000b, 0, 
305     0, 0 },
306   { /* 0070 */ "intset", 280, xtRegisterTypeSpecialReg, 0x1000, 0, 
307     17, 4, 4, 0x000002e2, 0x000d, 0, 
308     0, 0 },
309   { /* 0071 */ "intclear", 284, xtRegisterTypeSpecialReg, 0x1000, 0, 
310     17, 4, 4, 0x000002e3, 0x000d, 0, 
311     0, 0 },
312   { /* 0072 */ "ccount", 288, xtRegisterTypeSpecialReg, 0x1000, 0, 
313     32, 4, 4, 0x000002ea, 0x000f, 0, 
314     0, 0 },
315   { /* 0073 */ "prid", 292, xtRegisterTypeSpecialReg, 0x1000, 0, 
316     32, 4, 4, 0x000002eb, 0x0003, 0, 
317     0, 0 },
318   { /* 0074 */ "icount", 296, xtRegisterTypeSpecialReg, 0x1000, 0, 
319     32, 4, 4, 0x000002ec, 0x000f, 0, 
320     0, 0 },
321   { /* 0075 */ "ccompare0", 300, xtRegisterTypeSpecialReg, 0x1000, 0, 
322     32, 4, 4, 0x000002f0, 0x000f, 0, 
323     0, 0 },
324   { /* 0076 */ "ccompare1", 304, xtRegisterTypeSpecialReg, 0x1000, 0, 
325     32, 4, 4, 0x000002f1, 0x000f, 0, 
326     0, 0 },
327   { /* 0077 */ "ccompare2", 308, xtRegisterTypeSpecialReg, 0x1000, 0, 
328     32, 4, 4, 0x000002f2, 0x000f, 0, 
329     0, 0 },
330   { /* 0078 */ "epc1", 312, xtRegisterTypeSpecialReg, 0x1000, 0, 
331     32, 4, 4, 0x000002b1, 0x0007, 0, 
332     0, 0 },
333   { /* 0079 */ "epc2", 316, xtRegisterTypeSpecialReg, 0x1000, 0, 
334     32, 4, 4, 0x000002b2, 0x0007, 0, 
335     0, 0 },
336   { /* 0080 */ "epc3", 320, xtRegisterTypeSpecialReg, 0x1000, 0, 
337     32, 4, 4, 0x000002b3, 0x0007, 0, 
338     0, 0 },
339   { /* 0081 */ "epc4", 324, xtRegisterTypeSpecialReg, 0x1000, 0, 
340     32, 4, 4, 0x000002b4, 0x0007, 0, 
341     0, 0 },
342   { /* 0082 */ "excsave1", 328, xtRegisterTypeSpecialReg, 0x1000, 0, 
343     32, 4, 4, 0x000002d1, 0x0007, 0, 
344     0, 0 },
345   { /* 0083 */ "excsave2", 332, xtRegisterTypeSpecialReg, 0x1000, 0, 
346     32, 4, 4, 0x000002d2, 0x0007, 0, 
347     0, 0 },
348   { /* 0084 */ "excsave3", 336, xtRegisterTypeSpecialReg, 0x1000, 0, 
349     32, 4, 4, 0x000002d3, 0x0007, 0, 
350     0, 0 },
351   { /* 0085 */ "excsave4", 340, xtRegisterTypeSpecialReg, 0x1000, 0, 
352     32, 4, 4, 0x000002d4, 0x0007, 0, 
353     0, 0 },
354   { /* 0086 */ "eps2", 344, xtRegisterTypeSpecialReg, 0x1000, 0, 
355     19, 4, 4, 0x000002c2, 0x0007, 0, 
356     0, 0 },
357   { /* 0087 */ "eps3", 348, xtRegisterTypeSpecialReg, 0x1000, 0, 
358     19, 4, 4, 0x000002c3, 0x0007, 0, 
359     0, 0 },
360   { /* 0088 */ "eps4", 352, xtRegisterTypeSpecialReg, 0x1000, 0, 
361     19, 4, 4, 0x000002c4, 0x0007, 0, 
362     0, 0 },
363   { /* 0089 */ "exccause", 356, xtRegisterTypeSpecialReg, 0x1000, 0, 
364     6, 4, 4, 0x000002e8, 0x0007, 0, 
365     0, 0 },
366   { /* 0090 */ "depc", 360, xtRegisterTypeSpecialReg, 0x1000, 0, 
367     32, 4, 4, 0x000002c0, 0x0007, 0, 
368     0, 0 },
369   { /* 0091 */ "excvaddr", 364, xtRegisterTypeSpecialReg, 0x1000, 0, 
370     32, 4, 4, 0x000002ee, 0x0007, 0, 
371     0, 0 },
372   { /* 0092 */ "windowbase", 368, xtRegisterTypeSpecialReg, 0x1002, 0, 
373     4, 4, 4, 0x00000248, 0x0007, 0, 
374     0, 0 },
375   { /* 0093 */ "windowstart", 372, xtRegisterTypeSpecialReg, 0x1002, 0, 
376     16, 4, 4, 0x00000249, 0x0007, 0, 
377     0, 0 },
378   { /* 0094 */ "sar", 376, xtRegisterTypeSpecialReg, 0x1100, 0, 
379     6, 4, 4, 0x00000203, 0x0006, 0, 
380     0, 0 },
381   { /* 0095 */ "litbase", 380, xtRegisterTypeSpecialReg, 0x1100, 0, 
382     32, 4, 4, 0x00000205, 0x0006, 0, 
383     0, 0 },
384   { /* 0096 */ "ps", 384, xtRegisterTypeSpecialReg, 0x1100, 0, 
385     19, 4, 4, 0x000002e6, 0x0007, 0, 
386     0, 0 },
387   { /* 0097 */ "misc0", 388, xtRegisterTypeSpecialReg, 0x1000, 0, 
388     32, 4, 4, 0x000002f4, 0x0007, 0, 
389     0, 0 },
390   { /* 0098 */ "misc1", 392, xtRegisterTypeSpecialReg, 0x1000, 0, 
391     32, 4, 4, 0x000002f5, 0x0007, 0, 
392     0, 0 },
393   { /* 0099 */ "intenable", 396, xtRegisterTypeSpecialReg, 0x1000, 0, 
394     17, 4, 4, 0x000002e4, 0x0007, 0, 
395     0, 0 },
396   { /* 0100 */ "dbreaka0", 400, xtRegisterTypeSpecialReg, 0x1000, 0, 
397     32, 4, 4, 0x00000290, 0x0007, 0, 
398     0, 0 },
399   { /* 0101 */ "dbreakc0", 404, xtRegisterTypeSpecialReg, 0x1000, 0, 
400     32, 4, 4, 0x000002a0, 0x0007, 0, 
401     0, 0 },
402   { /* 0102 */ "dbreaka1", 408, xtRegisterTypeSpecialReg, 0x1000, 0, 
403     32, 4, 4, 0x00000291, 0x0007, 0, 
404     0, 0 },
405   { /* 0103 */ "dbreakc1", 412, xtRegisterTypeSpecialReg, 0x1000, 0, 
406     32, 4, 4, 0x000002a1, 0x0007, 0, 
407     0, 0 },
408   { /* 0104 */ "ibreaka0", 416, xtRegisterTypeSpecialReg, 0x1000, 0, 
409     32, 4, 4, 0x00000280, 0x0007, 0, 
410     0, 0 },
411   { /* 0105 */ "ibreaka1", 420, xtRegisterTypeSpecialReg, 0x1000, 0, 
412     32, 4, 4, 0x00000281, 0x0007, 0, 
413     0, 0 },
414   { /* 0106 */ "ibreakenable", 424, xtRegisterTypeSpecialReg, 0x1000, 0, 
415     2, 4, 4, 0x00000260, 0x0007, 0, 
416     0, 0 },
417   { /* 0107 */ "icountlevel", 428, xtRegisterTypeSpecialReg, 0x1000, 0, 
418     4, 4, 4, 0x000002ed, 0x0007, 0, 
419     0, 0 },
420   { /* 0108 */ "debugcause", 432, xtRegisterTypeSpecialReg, 0x1000, 0, 
421     12, 4, 4, 0x000002e9, 0x0003, 0, 
422     0, 0 },
423   { /* 0109 */ "rasid", 436, xtRegisterTypeSpecialReg, 0x1000, 0, 
424     32, 4, 4, 0x0000025a, 0x0007, 0, 
425     0, 0 },
426   { /* 0110 */ "itlbcfg", 440, xtRegisterTypeSpecialReg, 0x1000, 0, 
427     18, 4, 4, 0x0000025b, 0x0007, 0, 
428     0, 0 },
429   { /* 0111 */ "dtlbcfg", 444, xtRegisterTypeSpecialReg, 0x1000, 0, 
430     18, 4, 4, 0x0000025c, 0x0007, 0, 
431     0, 0 },
432   { /* 0112 */ "threadptr", 448, xtRegisterTypeUserReg, 0x110, 0, 
433     32, 4, 4, 0x000003e7, 0x0006, 0, 
434     0, 0 },
435   { /* 0113 */ "pc", 452, xtRegisterTypeVirtual, 0x100, 0, 
436     32, 4, 4, 0x00000020, 0x0006, 0, 
437     0, 0 },
438   { /* 0114 */ "a0", 456, xtRegisterTypeWindow, 0x100, 0, 
439     32, 4, 4, 0x00000000, 0x0006, 0, 
440     0, 0 },
441   { /* 0115 */ "a1", 460, xtRegisterTypeWindow, 0x100, 0, 
442     32, 4, 4, 0x00000001, 0x0006, 0, 
443     0, 0 },
444   { /* 0116 */ "a2", 464, xtRegisterTypeWindow, 0x100, 0, 
445     32, 4, 4, 0x00000002, 0x0006, 0, 
446     0, 0 },
447   { /* 0117 */ "a3", 468, xtRegisterTypeWindow, 0x100, 0, 
448     32, 4, 4, 0x00000003, 0x0006, 0, 
449     0, 0 },
450   { /* 0118 */ "a4", 472, xtRegisterTypeWindow, 0x100, 0, 
451     32, 4, 4, 0x00000004, 0x0006, 0, 
452     0, 0 },
453   { /* 0119 */ "a5", 476, xtRegisterTypeWindow, 0x100, 0, 
454     32, 4, 4, 0x00000005, 0x0006, 0, 
455     0, 0 },
456   { /* 0120 */ "a6", 480, xtRegisterTypeWindow, 0x100, 0, 
457     32, 4, 4, 0x00000006, 0x0006, 0, 
458     0, 0 },
459   { /* 0121 */ "a7", 484, xtRegisterTypeWindow, 0x100, 0, 
460     32, 4, 4, 0x00000007, 0x0006, 0, 
461     0, 0 },
462   { /* 0122 */ "a8", 488, xtRegisterTypeWindow, 0x100, 0, 
463     32, 4, 4, 0x00000008, 0x0006, 0, 
464     0, 0 },
465   { /* 0123 */ "a9", 492, xtRegisterTypeWindow, 0x100, 0, 
466     32, 4, 4, 0x00000009, 0x0006, 0, 
467     0, 0 },
468   { /* 0124 */ "a10", 496, xtRegisterTypeWindow, 0x100, 0, 
469     32, 4, 4, 0x0000000a, 0x0006, 0, 
470     0, 0 },
471   { /* 0125 */ "a11", 500, xtRegisterTypeWindow, 0x100, 0, 
472     32, 4, 4, 0x0000000b, 0x0006, 0, 
473     0, 0 },
474   { /* 0126 */ "a12", 504, xtRegisterTypeWindow, 0x100, 0, 
475     32, 4, 4, 0x0000000c, 0x0006, 0, 
476     0, 0 },
477   { /* 0127 */ "a13", 508, xtRegisterTypeWindow, 0x100, 0, 
478     32, 4, 4, 0x0000000d, 0x0006, 0, 
479     0, 0 },
480   { /* 0128 */ "a14", 512, xtRegisterTypeWindow, 0x100, 0, 
481     32, 4, 4, 0x0000000e, 0x0006, 0, 
482     0, 0 },
483   { /* 0129 */ "a15", 516, xtRegisterTypeWindow, 0x100, 0, 
484     32, 4, 4, 0x0000000f, 0x0006, 0, 
485     0, 0 },
486   { /* 0130 */ "psintlevel", 520, xtRegisterTypeMapped, 0x1010, 0, 
487     4, 4, 4, 0x00002004, 0x0006, &xtensa_mask0, 
488     0, 0 },
489   { /* 0131 */ "psum", 524, xtRegisterTypeMapped, 0x1010, 0, 
490     1, 4, 4, 0x00002005, 0x0006, &xtensa_mask1, 
491     0, 0 },
492   { /* 0132 */ "pswoe", 528, xtRegisterTypeMapped, 0x1010, 0, 
493     1, 4, 4, 0x00002006, 0x0006, &xtensa_mask2, 
494     0, 0 },
495   { /* 0133 */ "psring", 532, xtRegisterTypeMapped, 0x1010, 0, 
496     2, 4, 4, 0x00002007, 0x0006, &xtensa_mask3, 
497     0, 0 },
498   { /* 0134 */ "psexcm", 536, xtRegisterTypeMapped, 0x1010, 0, 
499     1, 4, 4, 0x00002008, 0x0006, &xtensa_mask4, 
500     0, 0 },
501   { /* 0135 */ "pscallinc", 540, xtRegisterTypeMapped, 0x1010, 0, 
502     2, 4, 4, 0x00002009, 0x0006, &xtensa_mask5, 
503     0, 0 },
504   { /* 0136 */ "psowb", 544, xtRegisterTypeMapped, 0x1010, 0, 
505     4, 4, 4, 0x0000200a, 0x0006, &xtensa_mask6, 
506     0, 0 },
507   { /* 0137 */ "litbaddr", 548, xtRegisterTypeMapped, 0x1010, 0, 
508     20, 4, 4, 0x0000200b, 0x0006, &xtensa_mask7, 
509     0, 0 },
510   { /* 0138 */ "litben", 552, xtRegisterTypeMapped, 0x1010, 0, 
511     1, 4, 4, 0x0000200c, 0x0006, &xtensa_mask8, 
512     0, 0 },
513   { /* 0139 */ "dbnum", 556, xtRegisterTypeMapped, 0x1010, 0, 
514     4, 4, 4, 0x00002011, 0x0006, &xtensa_mask9, 
515     0, 0 },
516   { /* 0140 */ "asid3", 560, xtRegisterTypeMapped, 0x1010, 0, 
517     8, 4, 4, 0x00002012, 0x0006, &xtensa_mask10, 
518     0, 0 },
519   { /* 0141 */ "asid2", 564, xtRegisterTypeMapped, 0x1010, 0, 
520     8, 4, 4, 0x00002013, 0x0006, &xtensa_mask11, 
521     0, 0 },
522   { /* 0142 */ "asid1", 568, xtRegisterTypeMapped, 0x1010, 0, 
523     8, 4, 4, 0x00002014, 0x0006, &xtensa_mask12, 
524     0, 0 },
525   { /* 0143 */ "instpgszid4", 572, xtRegisterTypeMapped, 0x1010, 0, 
526     2, 4, 4, 0x00002015, 0x0006, &xtensa_mask13, 
527     0, 0 },
528   { /* 0144 */ "datapgszid4", 576, xtRegisterTypeMapped, 0x1010, 0, 
529     2, 4, 4, 0x00002016, 0x0006, &xtensa_mask14, 
530     0, 0 },
531   { /* 0145 */ "ptbase", 580, xtRegisterTypeMapped, 0x1010, 0, 
532     10, 4, 4, 0x00002017, 0x0006, &xtensa_mask15, 
533     0, 0 },
534 };
535
536
537 struct gdbarch_tdep xtensa_tdep =
538 {
539   /* target_flags */                    0,
540   /* spill_location */                  -1,
541   /* spill_size */                      0,
542   /* unused */                          0,
543   /* call_abi */                        0,
544   /* debug_interrupt_level */           XCHAL_DEBUGLEVEL,
545   /* icache_line_bytes */               XCHAL_ICACHE_LINESIZE,
546   /* dcache_line_bytes */               XCHAL_DCACHE_LINESIZE,
547   /* dcache_writeback */                XCHAL_DCACHE_IS_WRITEBACK,
548   /* isa_use_windowed_registers */      XCHAL_HAVE_WINDOWED,
549   /* isa_use_density_instructions */    XCHAL_HAVE_DENSITY,
550   /* isa_use_exceptions */              1,
551   /* isa_use_ext_l32r */                0 /* XCHAL_USE_ABSOLUTE_LITERALS */,
552   /* isa_max_insn_size */               3,
553   /* debug_num_ibreaks */               XCHAL_NUM_IBREAK,
554   /* debug_num_dbreaks */               XCHAL_NUM_DBREAK,
555   /* rmap */                            rmap,
556   /* num_regs */                        114,
557   /* num_pseudo_regs */                 32,
558   /* num_aregs */                       64,
559   /* num_contexts */                    0,
560   /* ar_base */                         0,
561   /* a0_base */                         114,
562   /* wb_regnum */                       92,
563   /* ws_regnum */                       93,
564   /* pc_regnum */                       113,
565   /* ps_regnum */                       96,
566   /* lbeg_regnum */                     64,
567   /* lend_regnum */                     65,
568   /* lcount_regnum */                   66,
569   /* sar_regnum */                      94,
570   /* litbase_regnum */                  0,
571   /* debugcause_regnum */               108,
572   /* exccause_regnum */                 89,
573   /* excvaddr_regnum */                 91,
574   /* max_register_raw_size */           4,
575   /* max_register_virtual_size */       4,
576   /* fp_layout */                       0,
577   /* fp_layout_bytes */                 0,
578   /* gregmap */                         0
579 };