1 /* Native-dependent code for GNU/Linux UltraSPARC.
3 Copyright (C) 2003, 2007, 2008, 2009, 2010, 2011
4 Free Software Foundation, Inc.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
24 #include "sparc64-tdep.h"
25 #include "sparc-nat.h"
27 /* Determine whether `gregset_t' contains register REGNUM. */
30 sparc64_gregset_supplies_p (struct gdbarch *gdbarch, int regnum)
32 if (gdbarch_ptr_bit (gdbarch) == 32)
33 return sparc32_gregset_supplies_p (gdbarch, regnum);
35 /* Integer registers. */
36 if ((regnum >= SPARC_G1_REGNUM && regnum <= SPARC_G7_REGNUM)
37 || (regnum >= SPARC_O0_REGNUM && regnum <= SPARC_O7_REGNUM)
38 || (regnum >= SPARC_L0_REGNUM && regnum <= SPARC_L7_REGNUM)
39 || (regnum >= SPARC_I0_REGNUM && regnum <= SPARC_I7_REGNUM))
42 /* Control registers. */
43 if (regnum == SPARC64_PC_REGNUM
44 || regnum == SPARC64_NPC_REGNUM
45 || regnum == SPARC64_STATE_REGNUM
46 || regnum == SPARC64_Y_REGNUM
47 || regnum == SPARC64_FPRS_REGNUM)
53 /* Determine whether `fpregset_t' contains register REGNUM. */
56 sparc64_fpregset_supplies_p (struct gdbarch *gdbarch, int regnum)
58 if (gdbarch_ptr_bit (gdbarch) == 32)
59 return sparc32_fpregset_supplies_p (gdbarch, regnum);
61 /* Floating-point registers. */
62 if ((regnum >= SPARC_F0_REGNUM && regnum <= SPARC_F31_REGNUM)
63 || (regnum >= SPARC64_F32_REGNUM && regnum <= SPARC64_F62_REGNUM))
66 /* Control registers. */
67 if (regnum == SPARC64_FSR_REGNUM)
74 /* Provide a prototype to silence -Wmissing-prototypes. */
75 void _initialize_sparc64_nat (void);
78 _initialize_sparc64_nat (void)
80 sparc_supply_gregset = sparc64_supply_gregset;
81 sparc_collect_gregset = sparc64_collect_gregset;
82 sparc_supply_fpregset = sparc64_supply_fpregset;
83 sparc_collect_fpregset = sparc64_collect_fpregset;
84 sparc_gregset_supplies_p = sparc64_gregset_supplies_p;
85 sparc_fpregset_supplies_p = sparc64_fpregset_supplies_p;