]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/config/ia64/tm-ia64.h
9ebe9ae7a9a9b106e9c5cb0eec6de8275dd6926c
[thirdparty/binutils-gdb.git] / gdb / config / ia64 / tm-ia64.h
1 /* Definitions to target GDB to GNU/Linux on an ia64 architecture.
2 Copyright 1992, 1993, 2000 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 #ifndef TM_IA64_H
22 #define TM_IA64_H
23
24 #if !defined(GDBSERVER)
25
26 #define GDB_MULTI_ARCH 1
27
28 #else /* defines needed for GDBSERVER */
29
30 /* Say how long (ordinary) registers are. This is a piece of bogosity
31 used in push_word and a few other places; REGISTER_RAW_SIZE is the
32 real way to know how big a register is. */
33
34 #define REGISTER_SIZE 8
35
36 #undef NUM_REGS
37 #define NUM_REGS 590
38
39 /* Some pseudo register numbers */
40
41 #define PC_REGNUM IA64_IP_REGNUM
42 #define SP_REGNUM IA64_GR12_REGNUM
43 #define FP_REGNUM IA64_VFP_REGNUM
44
45 /* Total amount of space needed to store our copies of the machine's
46 register state, the array `registers'. On the ia64, all registers
47 fit in 64 bits except for the floating point registers which require
48 84 bits. But 84 isn't a nice number, so we'll just allocate 128
49 bits for each of these. The expression below says that we
50 need 8 bytes for each register, plus an additional 8 bytes for each
51 of the 128 floating point registers. */
52
53 #define REGISTER_BYTES (NUM_REGS*8+128*8)
54
55 /* Index within `registers' of the first byte of the space for
56 register N. */
57
58 #define REGISTER_BYTE(N) (((N) * 8) \
59 + ((N) <= IA64_FR0_REGNUM ? 0 : 8 * (((N) > IA64_FR127_REGNUM) ? 128 : (N) - IA64_FR0_REGNUM)))
60
61 /* Number of bytes of storage in the actual machine representation
62 for register N. */
63
64 #define REGISTER_RAW_SIZE(N) \
65 ((IA64_FR0_REGNUM <= (N) && (N) <= IA64_FR127_REGNUM) ? 16 : 8)
66
67 /* Largest value REGISTER_RAW_SIZE can have. */
68
69 #define DEPRECATED_MAX_REGISTER_RAW_SIZE 16
70
71
72 #define GDBSERVER_RESUME_REGS { IA64_IP_REGNUM, IA64_PSR_REGNUM, SP_REGNUM, IA64_BSP_REGNUM, IA64_CFM_REGNUM }
73
74 #endif /* GDBSERVER */
75
76
77 /* Register numbers of various important registers */
78
79 /* General registers; there are 128 of these 64 bit wide registers. The
80 first 32 are static and the last 96 are stacked. */
81 #define IA64_GR0_REGNUM 0
82 #define IA64_GR1_REGNUM (IA64_GR0_REGNUM+1)
83 #define IA64_GR2_REGNUM (IA64_GR0_REGNUM+2)
84 #define IA64_GR3_REGNUM (IA64_GR0_REGNUM+3)
85 #define IA64_GR4_REGNUM (IA64_GR0_REGNUM+4)
86 #define IA64_GR5_REGNUM (IA64_GR0_REGNUM+5)
87 #define IA64_GR6_REGNUM (IA64_GR0_REGNUM+6)
88 #define IA64_GR7_REGNUM (IA64_GR0_REGNUM+7)
89 #define IA64_GR8_REGNUM (IA64_GR0_REGNUM+8)
90 #define IA64_GR9_REGNUM (IA64_GR0_REGNUM+9)
91 #define IA64_GR10_REGNUM (IA64_GR0_REGNUM+10)
92 #define IA64_GR11_REGNUM (IA64_GR0_REGNUM+11)
93 #define IA64_GR12_REGNUM (IA64_GR0_REGNUM+12)
94 #define IA64_GR31_REGNUM (IA64_GR0_REGNUM+31)
95 #define IA64_GR32_REGNUM (IA64_GR0_REGNUM+32)
96 #define IA64_GR127_REGNUM (IA64_GR0_REGNUM+127)
97
98 /* Floating point registers; 128 82-bit wide registers */
99 #define IA64_FR0_REGNUM 128
100 #define IA64_FR1_REGNUM (IA64_FR0_REGNUM+1)
101 #define IA64_FR2_REGNUM (IA64_FR0_REGNUM+2)
102 #define IA64_FR8_REGNUM (IA64_FR0_REGNUM+8)
103 #define IA64_FR9_REGNUM (IA64_FR0_REGNUM+9)
104 #define IA64_FR10_REGNUM (IA64_FR0_REGNUM+10)
105 #define IA64_FR11_REGNUM (IA64_FR0_REGNUM+11)
106 #define IA64_FR12_REGNUM (IA64_FR0_REGNUM+12)
107 #define IA64_FR13_REGNUM (IA64_FR0_REGNUM+13)
108 #define IA64_FR14_REGNUM (IA64_FR0_REGNUM+14)
109 #define IA64_FR15_REGNUM (IA64_FR0_REGNUM+15)
110 #define IA64_FR16_REGNUM (IA64_FR0_REGNUM+16)
111 #define IA64_FR31_REGNUM (IA64_FR0_REGNUM+31)
112 #define IA64_FR32_REGNUM (IA64_FR0_REGNUM+32)
113 #define IA64_FR127_REGNUM (IA64_FR0_REGNUM+127)
114
115 /* Predicate registers; There are 64 of these one bit registers.
116 It'd be more convenient (implementation-wise) to use a single
117 64 bit word with all of these register in them. Note that there's
118 also a IA64_PR_REGNUM below which contains all the bits and is used for
119 communicating the actual values to the target. */
120
121 #define IA64_PR0_REGNUM 256
122 #define IA64_PR1_REGNUM (IA64_PR0_REGNUM+1)
123 #define IA64_PR2_REGNUM (IA64_PR0_REGNUM+2)
124 #define IA64_PR3_REGNUM (IA64_PR0_REGNUM+3)
125 #define IA64_PR4_REGNUM (IA64_PR0_REGNUM+4)
126 #define IA64_PR5_REGNUM (IA64_PR0_REGNUM+5)
127 #define IA64_PR6_REGNUM (IA64_PR0_REGNUM+6)
128 #define IA64_PR7_REGNUM (IA64_PR0_REGNUM+7)
129 #define IA64_PR8_REGNUM (IA64_PR0_REGNUM+8)
130 #define IA64_PR9_REGNUM (IA64_PR0_REGNUM+9)
131 #define IA64_PR10_REGNUM (IA64_PR0_REGNUM+10)
132 #define IA64_PR11_REGNUM (IA64_PR0_REGNUM+11)
133 #define IA64_PR12_REGNUM (IA64_PR0_REGNUM+12)
134 #define IA64_PR13_REGNUM (IA64_PR0_REGNUM+13)
135 #define IA64_PR14_REGNUM (IA64_PR0_REGNUM+14)
136 #define IA64_PR15_REGNUM (IA64_PR0_REGNUM+15)
137 #define IA64_PR16_REGNUM (IA64_PR0_REGNUM+16)
138 #define IA64_PR17_REGNUM (IA64_PR0_REGNUM+17)
139 #define IA64_PR18_REGNUM (IA64_PR0_REGNUM+18)
140 #define IA64_PR19_REGNUM (IA64_PR0_REGNUM+19)
141 #define IA64_PR20_REGNUM (IA64_PR0_REGNUM+20)
142 #define IA64_PR21_REGNUM (IA64_PR0_REGNUM+21)
143 #define IA64_PR22_REGNUM (IA64_PR0_REGNUM+22)
144 #define IA64_PR23_REGNUM (IA64_PR0_REGNUM+23)
145 #define IA64_PR24_REGNUM (IA64_PR0_REGNUM+24)
146 #define IA64_PR25_REGNUM (IA64_PR0_REGNUM+25)
147 #define IA64_PR26_REGNUM (IA64_PR0_REGNUM+26)
148 #define IA64_PR27_REGNUM (IA64_PR0_REGNUM+27)
149 #define IA64_PR28_REGNUM (IA64_PR0_REGNUM+28)
150 #define IA64_PR29_REGNUM (IA64_PR0_REGNUM+29)
151 #define IA64_PR30_REGNUM (IA64_PR0_REGNUM+30)
152 #define IA64_PR31_REGNUM (IA64_PR0_REGNUM+31)
153 #define IA64_PR32_REGNUM (IA64_PR0_REGNUM+32)
154 #define IA64_PR33_REGNUM (IA64_PR0_REGNUM+33)
155 #define IA64_PR34_REGNUM (IA64_PR0_REGNUM+34)
156 #define IA64_PR35_REGNUM (IA64_PR0_REGNUM+35)
157 #define IA64_PR36_REGNUM (IA64_PR0_REGNUM+36)
158 #define IA64_PR37_REGNUM (IA64_PR0_REGNUM+37)
159 #define IA64_PR38_REGNUM (IA64_PR0_REGNUM+38)
160 #define IA64_PR39_REGNUM (IA64_PR0_REGNUM+39)
161 #define IA64_PR40_REGNUM (IA64_PR0_REGNUM+40)
162 #define IA64_PR41_REGNUM (IA64_PR0_REGNUM+41)
163 #define IA64_PR42_REGNUM (IA64_PR0_REGNUM+42)
164 #define IA64_PR43_REGNUM (IA64_PR0_REGNUM+43)
165 #define IA64_PR44_REGNUM (IA64_PR0_REGNUM+44)
166 #define IA64_PR45_REGNUM (IA64_PR0_REGNUM+45)
167 #define IA64_PR46_REGNUM (IA64_PR0_REGNUM+46)
168 #define IA64_PR47_REGNUM (IA64_PR0_REGNUM+47)
169 #define IA64_PR48_REGNUM (IA64_PR0_REGNUM+48)
170 #define IA64_PR49_REGNUM (IA64_PR0_REGNUM+49)
171 #define IA64_PR50_REGNUM (IA64_PR0_REGNUM+50)
172 #define IA64_PR51_REGNUM (IA64_PR0_REGNUM+51)
173 #define IA64_PR52_REGNUM (IA64_PR0_REGNUM+52)
174 #define IA64_PR53_REGNUM (IA64_PR0_REGNUM+53)
175 #define IA64_PR54_REGNUM (IA64_PR0_REGNUM+54)
176 #define IA64_PR55_REGNUM (IA64_PR0_REGNUM+55)
177 #define IA64_PR56_REGNUM (IA64_PR0_REGNUM+56)
178 #define IA64_PR57_REGNUM (IA64_PR0_REGNUM+57)
179 #define IA64_PR58_REGNUM (IA64_PR0_REGNUM+58)
180 #define IA64_PR59_REGNUM (IA64_PR0_REGNUM+59)
181 #define IA64_PR60_REGNUM (IA64_PR0_REGNUM+60)
182 #define IA64_PR61_REGNUM (IA64_PR0_REGNUM+61)
183 #define IA64_PR62_REGNUM (IA64_PR0_REGNUM+62)
184 #define IA64_PR63_REGNUM (IA64_PR0_REGNUM+63)
185
186
187 /* Branch registers: 8 64-bit registers for holding branch targets */
188 #define IA64_BR0_REGNUM 320
189 #define IA64_BR1_REGNUM (IA64_BR0_REGNUM+1)
190 #define IA64_BR2_REGNUM (IA64_BR0_REGNUM+2)
191 #define IA64_BR3_REGNUM (IA64_BR0_REGNUM+3)
192 #define IA64_BR4_REGNUM (IA64_BR0_REGNUM+4)
193 #define IA64_BR5_REGNUM (IA64_BR0_REGNUM+5)
194 #define IA64_BR6_REGNUM (IA64_BR0_REGNUM+6)
195 #define IA64_BR7_REGNUM (IA64_BR0_REGNUM+7)
196
197 /* Virtual frame pointer; this matches IA64_FRAME_POINTER_REGNUM in
198 gcc/config/ia64/ia64.h. */
199 #define IA64_VFP_REGNUM 328
200
201 /* Virtual return address pointer; this matches IA64_RETURN_ADDRESS_POINTER_REGNUM
202 in gcc/config/ia64/ia64.h. */
203 #define IA64_VRAP_REGNUM 329
204
205 /* Predicate registers: There are 64 of these 1-bit registers. We
206 define a single register which is used to communicate these values
207 to/from the target. We will somehow contrive to make it appear that
208 IA64_PR0_REGNUM thru IA64_PR63_REGNUM hold the actual values. */
209 #define IA64_PR_REGNUM 330
210
211 /* Instruction pointer: 64 bits wide */
212 #define IA64_IP_REGNUM 331
213
214 /* Process Status Register */
215 #define IA64_PSR_REGNUM 332
216
217 /* Current Frame Marker (Raw form may be the cr.ifs) */
218 #define IA64_CFM_REGNUM 333
219
220 /* Application registers; 128 64-bit wide registers possible, but some
221 of them are reserved */
222 #define IA64_AR0_REGNUM 334
223 #define IA64_KR0_REGNUM (IA64_AR0_REGNUM+0)
224 #define IA64_KR7_REGNUM (IA64_KR0_REGNUM+7)
225
226 #define IA64_RSC_REGNUM (IA64_AR0_REGNUM+16)
227 #define IA64_BSP_REGNUM (IA64_AR0_REGNUM+17)
228 #define IA64_BSPSTORE_REGNUM (IA64_AR0_REGNUM+18)
229 #define IA64_RNAT_REGNUM (IA64_AR0_REGNUM+19)
230 #define IA64_FCR_REGNUM (IA64_AR0_REGNUM+21)
231 #define IA64_EFLAG_REGNUM (IA64_AR0_REGNUM+24)
232 #define IA64_CSD_REGNUM (IA64_AR0_REGNUM+25)
233 #define IA64_SSD_REGNUM (IA64_AR0_REGNUM+26)
234 #define IA64_CFLG_REGNUM (IA64_AR0_REGNUM+27)
235 #define IA64_FSR_REGNUM (IA64_AR0_REGNUM+28)
236 #define IA64_FIR_REGNUM (IA64_AR0_REGNUM+29)
237 #define IA64_FDR_REGNUM (IA64_AR0_REGNUM+30)
238 #define IA64_CCV_REGNUM (IA64_AR0_REGNUM+32)
239 #define IA64_UNAT_REGNUM (IA64_AR0_REGNUM+36)
240 #define IA64_FPSR_REGNUM (IA64_AR0_REGNUM+40)
241 #define IA64_ITC_REGNUM (IA64_AR0_REGNUM+44)
242 #define IA64_PFS_REGNUM (IA64_AR0_REGNUM+64)
243 #define IA64_LC_REGNUM (IA64_AR0_REGNUM+65)
244 #define IA64_EC_REGNUM (IA64_AR0_REGNUM+66)
245
246 /* NAT (Not A Thing) Bits for the general registers; there are 128 of these */
247 #define IA64_NAT0_REGNUM 462
248 #define IA64_NAT31_REGNUM (IA64_NAT0_REGNUM+31)
249 #define IA64_NAT32_REGNUM (IA64_NAT0_REGNUM+32)
250 #define IA64_NAT127_REGNUM (IA64_NAT0_REGNUM+127)
251
252 #endif /* TM_IA64_H */