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);
29 #define ia64_num_regs 462
31 #include <asm/ptrace_offsets.h>
33 static int ia64_regmap
[] =
35 /* general registers */
36 -1, /* gr0 not available; i.e, it's always zero */
68 /* gr32 through gr127 not directly available via the ptrace interface */
69 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
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 /* Floating point registers */
76 -1, -1, /* f0 and f1 not available (f0 is +0.0 and f1 is +1.0) */
203 /* predicate registers - we don't fetch these individually */
204 -1, -1, -1, -1, -1, -1, -1, -1,
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 /* branch registers */
221 /* virtual frame pointer and virtual return address pointer */
223 /* other registers */
226 PT_CR_IPSR
, /* psr */
228 /* kernel registers not visible via ptrace interface (?) */
229 -1, -1, -1, -1, -1, -1, -1, -1,
231 -1, -1, -1, -1, -1, -1, -1, -1,
237 -1, /* Not available: FCR, IA32 floating control register */
239 -1, /* Not available: EFLAG */
240 -1, /* Not available: CSD */
241 -1, /* Not available: SSD */
242 -1, /* Not available: CFLG */
243 -1, /* Not available: FSR */
244 -1, /* Not available: FIR */
245 -1, /* Not available: FDR */
253 -1, /* Not available: ITC */
254 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
255 -1, -1, -1, -1, -1, -1, -1, -1, -1,
259 -1, -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,
269 ia64_cannot_store_register (int regno
)
275 ia64_cannot_fetch_register (int regno
)
280 /* GDB register numbers. */
281 #define IA64_GR0_REGNUM 0
282 #define IA64_FR0_REGNUM 128
283 #define IA64_FR1_REGNUM 129
286 ia64_fetch_register (struct regcache
*regcache
, int regnum
)
288 /* r0 cannot be fetched but is always zero. */
289 if (regnum
== IA64_GR0_REGNUM
)
291 const gdb_byte zero
[8] = { 0 };
293 gdb_assert (sizeof (zero
) == register_size (regnum
));
294 supply_register (regcache
, regnum
, zero
);
298 /* fr0 cannot be fetched but is always zero. */
299 if (regnum
== IA64_FR0_REGNUM
)
301 const gdb_byte f_zero
[16] = { 0 };
303 gdb_assert (sizeof (f_zero
) == register_size (regnum
));
304 supply_register (regcache
, regnum
, f_zero
);
308 /* fr1 cannot be fetched but is always one (1.0). */
309 if (regnum
== IA64_FR1_REGNUM
)
311 const gdb_byte f_one
[16] =
312 { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
314 gdb_assert (sizeof (f_one
) == register_size (regnum
));
315 supply_register (regcache
, regnum
, f_one
);
322 struct linux_target_ops the_low_target
= {
327 ia64_cannot_fetch_register
,
328 ia64_cannot_store_register
,