1 /* Target-dependent code for SPARC.
3 Copyright 2003, 2004 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 2 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, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
23 #define SPARC_TDEP_H 1
29 struct trad_frame_saved_reg
;
31 /* Register offsets for the general-purpose register set. */
46 /* SPARC architecture-specific information. */
50 /* Register numbers for the PN and nPC registers. The definitions
51 for (64-bit) UltraSPARC differ from the (32-bit) SPARC
57 struct regset
*gregset
;
58 size_t sizeof_gregset
;
59 struct regset
*fpregset
;
60 size_t sizeof_fpregset
;
62 /* Offset of saved PC in jmp_buf. */
65 /* Size of an Procedure Linkage Table (PLT) entry, 0 if we shouldn't
66 treat the PLT special when doing prologue analysis. */
67 size_t plt_entry_size
;
70 /* Register numbers of various important registers. */
74 SPARC_G0_REGNUM
, /* %g0 */
81 SPARC_G7_REGNUM
, /* %g7 */
82 SPARC_O0_REGNUM
, /* %o0 */
88 SPARC_SP_REGNUM
, /* %sp (%o6) */
89 SPARC_O7_REGNUM
, /* %o7 */
90 SPARC_L0_REGNUM
, /* %l0 */
97 SPARC_L7_REGNUM
, /* %l7 */
98 SPARC_I0_REGNUM
, /* %i0 */
104 SPARC_FP_REGNUM
, /* %fp (%i6) */
105 SPARC_I7_REGNUM
, /* %i7 */
106 SPARC_F0_REGNUM
, /* %f0 */
108 SPARC_F31_REGNUM
/* %f31 */
109 = SPARC_F0_REGNUM
+ 31
114 SPARC32_Y_REGNUM
/* %y */
115 = SPARC_F31_REGNUM
+ 1,
116 SPARC32_PSR_REGNUM
, /* %psr */
117 SPARC32_WIM_REGNUM
, /* %wim */
118 SPARC32_TBR_REGNUM
, /* %tbr */
119 SPARC32_PC_REGNUM
, /* %pc */
120 SPARC32_NPC_REGNUM
, /* %npc */
121 SPARC32_FSR_REGNUM
, /* %fsr */
122 SPARC32_CSR_REGNUM
, /* %csr */
124 /* Pseudo registers. */
125 SPARC32_D0_REGNUM
, /* %d0 */
126 SPARC32_D30_REGNUM
/* %d30 */
127 = SPARC32_D0_REGNUM
+ 15
131 struct sparc_frame_cache
137 /* Do we have a frame? */
140 /* Do we have a Structure, Union or Quad-Precision return value?. */
143 /* Table of saved registers. */
144 struct trad_frame_saved_reg
*saved_regs
;
147 /* Fetch the instruction at PC. */
148 extern unsigned long sparc_fetch_instruction (CORE_ADDR pc
);
150 /* Fetch StackGhost Per-Process XOR cookie. */
151 extern ULONGEST
sparc_fetch_wcookie (void);
153 extern CORE_ADDR
sparc_analyze_prologue (CORE_ADDR pc
, CORE_ADDR current_pc
,
154 struct sparc_frame_cache
*cache
);
156 extern struct sparc_frame_cache
*
157 sparc_frame_cache (struct frame_info
*next_frame
, void **this_cache
);
159 extern struct sparc_frame_cache
*
160 sparc32_frame_cache (struct frame_info
*next_frame
, void **this_cache
);
164 extern void sparc_software_single_step (enum target_signal sig
,
165 int insert_breakpoints_p
);
167 extern void sparc_supply_rwindow (struct regcache
*regcache
,
168 CORE_ADDR sp
, int regnum
);
169 extern void sparc_collect_rwindow (const struct regcache
*regcache
,
170 CORE_ADDR sp
, int regnum
);
172 /* Register offsets for SunOS 4. */
173 extern const struct sparc_gregset sparc32_sunos4_gregset
;
175 extern void sparc32_supply_gregset (const struct sparc_gregset
*gregset
,
176 struct regcache
*regcache
,
177 int regnum
, const void *gregs
);
178 extern void sparc32_collect_gregset (const struct sparc_gregset
*gregset
,
179 const struct regcache
*regcache
,
180 int regnum
, void *gregs
);
181 extern void sparc32_supply_fpregset (struct regcache
*regcache
,
182 int regnum
, const void *fpregs
);
183 extern void sparc32_collect_fpregset (const struct regcache
*regcache
,
184 int regnum
, void *fpregs
);
186 /* Functions and variables exported from sparc-sol2-tdep.c. */
188 /* Register offsets for Solaris 2. */
189 extern const struct sparc_gregset sparc32_sol2_gregset
;
191 extern int sparc_sol2_pc_in_sigtramp (CORE_ADDR pc
, char *name
);
193 extern void sparc32_sol2_init_abi (struct gdbarch_info info
,
194 struct gdbarch
*gdbarch
);
196 /* Functions and variables exported from sparcnbsd-tdep.c. */
198 /* Register offsets for NetBSD. */
199 extern const struct sparc_gregset sparc32nbsd_gregset
;
201 extern void sparc32nbsd_elf_init_abi (struct gdbarch_info info
,
202 struct gdbarch
*gdbarch
);
204 extern struct trad_frame_saved_reg
*
205 sparc32nbsd_sigcontext_saved_regs (struct frame_info
*next_frame
);
207 #endif /* sparc-tdep.h */