1 /* GNU/Linux/IA64 specific low level interface, for the remote server for GDB.
2 Copyright (C) 1995-1996, 1998-2002, 2007-2012 Free Software
5 This file is part of GDB.
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 3 of the License, or
10 (at your option) any later version.
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
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 #include "linux-low.h"
27 /* Defined in auto-generated file reg-ia64.c. */
28 void init_registers_ia64 (void);
30 #define ia64_num_regs 462
32 #include <asm/ptrace_offsets.h>
34 static int ia64_regmap
[] =
36 /* general registers */
37 -1, /* gr0 not available; i.e, it's always zero */
69 /* gr32 through gr127 not directly available via the ptrace interface */
70 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
71 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
72 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
73 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
74 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
75 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
76 /* Floating point registers */
77 -1, -1, /* f0 and f1 not available (f0 is +0.0 and f1 is +1.0) */
204 /* predicate registers - we don't fetch these individually */
205 -1, -1, -1, -1, -1, -1, -1, -1,
206 -1, -1, -1, -1, -1, -1, -1, -1,
207 -1, -1, -1, -1, -1, -1, -1, -1,
208 -1, -1, -1, -1, -1, -1, -1, -1,
209 -1, -1, -1, -1, -1, -1, -1, -1,
210 -1, -1, -1, -1, -1, -1, -1, -1,
211 -1, -1, -1, -1, -1, -1, -1, -1,
212 -1, -1, -1, -1, -1, -1, -1, -1,
213 /* branch registers */
222 /* virtual frame pointer and virtual return address pointer */
224 /* other registers */
227 PT_CR_IPSR
, /* psr */
229 /* kernel registers not visible via ptrace interface (?) */
230 -1, -1, -1, -1, -1, -1, -1, -1,
232 -1, -1, -1, -1, -1, -1, -1, -1,
238 -1, /* Not available: FCR, IA32 floating control register */
240 -1, /* Not available: EFLAG */
241 -1, /* Not available: CSD */
242 -1, /* Not available: SSD */
243 -1, /* Not available: CFLG */
244 -1, /* Not available: FSR */
245 -1, /* Not available: FIR */
246 -1, /* Not available: FDR */
254 -1, /* Not available: ITC */
255 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
256 -1, -1, -1, -1, -1, -1, -1, -1, -1,
260 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
261 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
262 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
263 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
264 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
265 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
270 ia64_cannot_store_register (int regno
)
276 ia64_cannot_fetch_register (int regno
)
281 /* GDB register numbers. */
282 #define IA64_GR0_REGNUM 0
283 #define IA64_FR0_REGNUM 128
284 #define IA64_FR1_REGNUM 129
287 ia64_fetch_register (struct regcache
*regcache
, int regnum
)
289 /* r0 cannot be fetched but is always zero. */
290 if (regnum
== IA64_GR0_REGNUM
)
292 const gdb_byte zero
[8] = { 0 };
294 gdb_assert (sizeof (zero
) == register_size (regnum
));
295 supply_register (regcache
, regnum
, zero
);
299 /* fr0 cannot be fetched but is always zero. */
300 if (regnum
== IA64_FR0_REGNUM
)
302 const gdb_byte f_zero
[16] = { 0 };
304 gdb_assert (sizeof (f_zero
) == register_size (regnum
));
305 supply_register (regcache
, regnum
, f_zero
);
309 /* fr1 cannot be fetched but is always one (1.0). */
310 if (regnum
== IA64_FR1_REGNUM
)
312 const gdb_byte f_one
[16] =
313 { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
315 gdb_assert (sizeof (f_one
) == register_size (regnum
));
316 supply_register (regcache
, regnum
, f_one
);
323 struct linux_target_ops the_low_target
= {
328 ia64_cannot_fetch_register
,
329 ia64_cannot_store_register
,