1 /* GNU/Linux/IA64 specific low level interface, for the remote server for GDB.
2 Copyright (C) 1995-2013 Free Software Foundation, Inc.
4 This file is part of GDB.
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 3 of the License, or
9 (at your option) any later version.
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.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 #include "linux-low.h"
26 /* Defined in auto-generated file reg-ia64.c. */
27 void init_registers_ia64 (void);
28 extern const struct target_desc
*tdesc_ia64
;
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 (regcache
->tdesc
, 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 (regcache
->tdesc
, 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 (regcache
->tdesc
, regnum
));
316 supply_register (regcache
, regnum
, f_one
);
323 static struct usrregs_info ia64_usrregs_info
=
329 static struct regs_info regs_info
=
331 NULL
, /* regset_bitmap */
335 static const struct regs_info
*
336 ia64_regs_info (void)
342 ia64_arch_setup (void)
344 current_process ()->tdesc
= tdesc_ia64
;
348 struct linux_target_ops the_low_target
= {
351 ia64_cannot_fetch_register
,
352 ia64_cannot_store_register
,
357 initialize_low_arch (void)
359 init_registers_ia64 ();