1 /* Target-dependent code for SPARC.
3 Copyright (C) 2003, 2004, 2006, 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/>. */
22 #define SPARC_TDEP_H 1
28 struct trad_frame_saved_reg;
30 /* Register offsets for the general-purpose register set. */
45 /* SPARC architecture-specific information. */
49 /* Register numbers for the PN and nPC registers. The definitions
50 for (64-bit) UltraSPARC differ from the (32-bit) SPARC
56 struct regset *gregset;
57 size_t sizeof_gregset;
58 struct regset *fpregset;
59 size_t sizeof_fpregset;
61 /* Offset of saved PC in jmp_buf. */
64 /* Size of an Procedure Linkage Table (PLT) entry, 0 if we shouldn't
65 treat the PLT special when doing prologue analysis. */
66 size_t plt_entry_size;
68 /* Alternative location for trap return. Used for single-stepping. */
69 CORE_ADDR (*step_trap) (struct frame_info *frame, unsigned long insn);
71 /* ISA-specific data types. */
72 struct type *sparc_psr_type;
73 struct type *sparc_fsr_type;
74 struct type *sparc64_pstate_type;
75 struct type *sparc64_fsr_type;
76 struct type *sparc64_fprs_type;
79 /* Register numbers of various important registers. */
83 SPARC_G0_REGNUM, /* %g0 */
90 SPARC_G7_REGNUM, /* %g7 */
91 SPARC_O0_REGNUM, /* %o0 */
97 SPARC_SP_REGNUM, /* %sp (%o6) */
98 SPARC_O7_REGNUM, /* %o7 */
99 SPARC_L0_REGNUM, /* %l0 */
106 SPARC_L7_REGNUM, /* %l7 */
107 SPARC_I0_REGNUM, /* %i0 */
113 SPARC_FP_REGNUM, /* %fp (%i6) */
114 SPARC_I7_REGNUM, /* %i7 */
115 SPARC_F0_REGNUM, /* %f0 */
117 SPARC_F31_REGNUM /* %f31 */
118 = SPARC_F0_REGNUM + 31
123 SPARC32_Y_REGNUM /* %y */
124 = SPARC_F31_REGNUM + 1,
125 SPARC32_PSR_REGNUM, /* %psr */
126 SPARC32_WIM_REGNUM, /* %wim */
127 SPARC32_TBR_REGNUM, /* %tbr */
128 SPARC32_PC_REGNUM, /* %pc */
129 SPARC32_NPC_REGNUM, /* %npc */
130 SPARC32_FSR_REGNUM, /* %fsr */
131 SPARC32_CSR_REGNUM, /* %csr */
133 /* Pseudo registers. */
134 SPARC32_D0_REGNUM, /* %d0 */
135 SPARC32_D30_REGNUM /* %d30 */
136 = SPARC32_D0_REGNUM + 15
140 struct sparc_frame_cache
146 /* Do we have a frame? */
149 /* Do we have a Structure, Union or Quad-Precision return value? */
152 /* Table of saved registers. */
153 struct trad_frame_saved_reg *saved_regs;
156 /* Fetch the instruction at PC. */
157 extern unsigned long sparc_fetch_instruction (CORE_ADDR pc);
159 /* Fetch StackGhost Per-Process XOR cookie. */
160 extern ULONGEST sparc_fetch_wcookie (struct gdbarch *gdbarch);
162 extern CORE_ADDR sparc_analyze_prologue (struct gdbarch *gdbarch,
163 CORE_ADDR pc, CORE_ADDR current_pc,
164 struct sparc_frame_cache *cache);
166 extern struct sparc_frame_cache *
167 sparc_frame_cache (struct frame_info *this_frame, void **this_cache);
169 extern struct sparc_frame_cache *
170 sparc32_frame_cache (struct frame_info *this_frame, void **this_cache);
174 extern int sparc_software_single_step (struct frame_info *frame);
176 extern void sparc_supply_rwindow (struct regcache *regcache,
177 CORE_ADDR sp, int regnum);
178 extern void sparc_collect_rwindow (const struct regcache *regcache,
179 CORE_ADDR sp, int regnum);
181 /* Register offsets for SunOS 4. */
182 extern const struct sparc_gregset sparc32_sunos4_gregset;
184 extern void sparc32_supply_gregset (const struct sparc_gregset *gregset,
185 struct regcache *regcache,
186 int regnum, const void *gregs);
187 extern void sparc32_collect_gregset (const struct sparc_gregset *gregset,
188 const struct regcache *regcache,
189 int regnum, void *gregs);
190 extern void sparc32_supply_fpregset (struct regcache *regcache,
191 int regnum, const void *fpregs);
192 extern void sparc32_collect_fpregset (const struct regcache *regcache,
193 int regnum, void *fpregs);
195 /* Functions and variables exported from sparc-sol2-tdep.c. */
197 /* Register offsets for Solaris 2. */
198 extern const struct sparc_gregset sparc32_sol2_gregset;
200 extern int sparc_sol2_pc_in_sigtramp (CORE_ADDR pc, char *name);
202 extern char *sparc_sol2_static_transform_name (char *name);
204 extern void sparc32_sol2_init_abi (struct gdbarch_info info,
205 struct gdbarch *gdbarch);
207 /* Functions and variables exported from sparcnbsd-tdep.c. */
209 /* Register offsets for NetBSD. */
210 extern const struct sparc_gregset sparc32nbsd_gregset;
212 /* Return the address of a system call's alternative return
214 extern CORE_ADDR sparcnbsd_step_trap (struct frame_info *frame,
217 extern void sparc32nbsd_elf_init_abi (struct gdbarch_info info,
218 struct gdbarch *gdbarch);
220 extern struct trad_frame_saved_reg *
221 sparc32nbsd_sigcontext_saved_regs (struct frame_info *next_frame);
223 #endif /* sparc-tdep.h */