1 /* GNU/Linux/IA64 specific low level interface, for the remote server for GDB.
2 Copyright (C) 1995-2020 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 /* Linux target op definitions for the IA64 architecture. */
28 class ia64_target
: public linux_process_target
34 /* The singleton target ops object. */
36 static ia64_target the_ia64_target
;
38 /* Defined in auto-generated file reg-ia64.c. */
39 void init_registers_ia64 (void);
40 extern const struct target_desc
*tdesc_ia64
;
42 #define ia64_num_regs 462
44 #include <asm/ptrace_offsets.h>
46 static int ia64_regmap
[] =
48 /* general registers */
49 -1, /* gr0 not available; i.e, it's always zero */
81 /* gr32 through gr127 not directly available via the ptrace interface */
82 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
83 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
84 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
85 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
86 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
87 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
88 /* Floating point registers */
89 -1, -1, /* f0 and f1 not available (f0 is +0.0 and f1 is +1.0) */
216 /* predicate registers - we don't fetch these individually */
217 -1, -1, -1, -1, -1, -1, -1, -1,
218 -1, -1, -1, -1, -1, -1, -1, -1,
219 -1, -1, -1, -1, -1, -1, -1, -1,
220 -1, -1, -1, -1, -1, -1, -1, -1,
221 -1, -1, -1, -1, -1, -1, -1, -1,
222 -1, -1, -1, -1, -1, -1, -1, -1,
223 -1, -1, -1, -1, -1, -1, -1, -1,
224 -1, -1, -1, -1, -1, -1, -1, -1,
225 /* branch registers */
234 /* virtual frame pointer and virtual return address pointer */
236 /* other registers */
239 PT_CR_IPSR
, /* psr */
241 /* kernel registers not visible via ptrace interface (?) */
242 -1, -1, -1, -1, -1, -1, -1, -1,
244 -1, -1, -1, -1, -1, -1, -1, -1,
250 -1, /* Not available: FCR, IA32 floating control register */
252 -1, /* Not available: EFLAG */
253 -1, /* Not available: CSD */
254 -1, /* Not available: SSD */
255 -1, /* Not available: CFLG */
256 -1, /* Not available: FSR */
257 -1, /* Not available: FIR */
258 -1, /* Not available: FDR */
266 -1, /* Not available: ITC */
267 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
268 -1, -1, -1, -1, -1, -1, -1, -1, -1,
272 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
273 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
274 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
275 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
276 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
277 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
282 ia64_cannot_store_register (int regno
)
288 ia64_cannot_fetch_register (int regno
)
293 /* GDB register numbers. */
294 #define IA64_GR0_REGNUM 0
295 #define IA64_FR0_REGNUM 128
296 #define IA64_FR1_REGNUM 129
299 ia64_fetch_register (struct regcache
*regcache
, int regnum
)
301 /* r0 cannot be fetched but is always zero. */
302 if (regnum
== IA64_GR0_REGNUM
)
304 const gdb_byte zero
[8] = { 0 };
306 gdb_assert (sizeof (zero
) == register_size (regcache
->tdesc
, regnum
));
307 supply_register (regcache
, regnum
, zero
);
311 /* fr0 cannot be fetched but is always zero. */
312 if (regnum
== IA64_FR0_REGNUM
)
314 const gdb_byte f_zero
[16] = { 0 };
316 gdb_assert (sizeof (f_zero
) == register_size (regcache
->tdesc
, regnum
));
317 supply_register (regcache
, regnum
, f_zero
);
321 /* fr1 cannot be fetched but is always one (1.0). */
322 if (regnum
== IA64_FR1_REGNUM
)
324 const gdb_byte f_one
[16] =
325 { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
327 gdb_assert (sizeof (f_one
) == register_size (regcache
->tdesc
, regnum
));
328 supply_register (regcache
, regnum
, f_one
);
335 static struct usrregs_info ia64_usrregs_info
=
341 static struct regs_info regs_info
=
343 NULL
, /* regset_bitmap */
347 static const struct regs_info
*
348 ia64_regs_info (void)
354 ia64_arch_setup (void)
356 current_process ()->tdesc
= tdesc_ia64
;
360 struct linux_target_ops the_low_target
= {
363 ia64_cannot_fetch_register
,
364 ia64_cannot_store_register
,
368 /* The linux target ops object. */
370 linux_process_target
*the_linux_target
= &the_ia64_target
;
373 initialize_low_arch (void)
375 init_registers_ia64 ();