1 /* Native-dependent code for GNU/Linux UltraSPARC.
3 Copyright (C) 2003, 2007-2012 Free Software Foundation, Inc.
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/>. */
23 #include "sparc64-tdep.h"
24 #include "sparc-nat.h"
26 /* Determine whether `gregset_t' contains register REGNUM. */
29 sparc64_gregset_supplies_p (struct gdbarch
*gdbarch
, int regnum
)
31 if (gdbarch_ptr_bit (gdbarch
) == 32)
32 return sparc32_gregset_supplies_p (gdbarch
, regnum
);
34 /* Integer registers. */
35 if ((regnum
>= SPARC_G1_REGNUM
&& regnum
<= SPARC_G7_REGNUM
)
36 || (regnum
>= SPARC_O0_REGNUM
&& regnum
<= SPARC_O7_REGNUM
)
37 || (regnum
>= SPARC_L0_REGNUM
&& regnum
<= SPARC_L7_REGNUM
)
38 || (regnum
>= SPARC_I0_REGNUM
&& regnum
<= SPARC_I7_REGNUM
))
41 /* Control registers. */
42 if (regnum
== SPARC64_PC_REGNUM
43 || regnum
== SPARC64_NPC_REGNUM
44 || regnum
== SPARC64_STATE_REGNUM
45 || regnum
== SPARC64_Y_REGNUM
46 || regnum
== SPARC64_FPRS_REGNUM
)
52 /* Determine whether `fpregset_t' contains register REGNUM. */
55 sparc64_fpregset_supplies_p (struct gdbarch
*gdbarch
, int regnum
)
57 if (gdbarch_ptr_bit (gdbarch
) == 32)
58 return sparc32_fpregset_supplies_p (gdbarch
, regnum
);
60 /* Floating-point registers. */
61 if ((regnum
>= SPARC_F0_REGNUM
&& regnum
<= SPARC_F31_REGNUM
)
62 || (regnum
>= SPARC64_F32_REGNUM
&& regnum
<= SPARC64_F62_REGNUM
))
65 /* Control registers. */
66 if (regnum
== SPARC64_FSR_REGNUM
)
73 /* Provide a prototype to silence -Wmissing-prototypes. */
74 void _initialize_sparc64_nat (void);
77 _initialize_sparc64_nat (void)
79 sparc_supply_gregset
= sparc64_supply_gregset
;
80 sparc_collect_gregset
= sparc64_collect_gregset
;
81 sparc_supply_fpregset
= sparc64_supply_fpregset
;
82 sparc_collect_fpregset
= sparc64_collect_fpregset
;
83 sparc_gregset_supplies_p
= sparc64_gregset_supplies_p
;
84 sparc_fpregset_supplies_p
= sparc64_fpregset_supplies_p
;