Add ChangeLog entries
[deliverable/binutils-gdb.git] / gdb / sparc-tdep.h
CommitLineData
386c036b 1/* Target-dependent code for SPARC.
c139e7d9 2
618f726f 3 Copyright (C) 2003-2016 Free Software Foundation, Inc.
c139e7d9
DJ
4
5 This file is part of GDB.
6
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
a9762ec7 9 the Free Software Foundation; either version 3 of the License, or
c139e7d9
DJ
10 (at your option) any later version.
11
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.
16
17 You should have received a copy of the GNU General Public License
a9762ec7 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
c139e7d9 19
386c036b
MK
20#ifndef SPARC_TDEP_H
21#define SPARC_TDEP_H 1
22
566626fa 23struct frame_info;
386c036b
MK
24struct gdbarch;
25struct regcache;
a54124c5 26struct regset;
386c036b
MK
27struct trad_frame_saved_reg;
28
29/* Register offsets for the general-purpose register set. */
30
b4fd25c9 31struct sparc_gregmap
386c036b
MK
32{
33 int r_psr_offset;
34 int r_pc_offset;
35 int r_npc_offset;
36 int r_y_offset;
37 int r_wim_offset;
38 int r_tbr_offset;
39 int r_g1_offset;
40 int r_l0_offset;
41 int r_y_size;
42};
43
b4fd25c9 44struct sparc_fpregmap
db75c717
DM
45{
46 int r_f0_offset;
47 int r_fsr_offset;
48};
49
386c036b
MK
50/* SPARC architecture-specific information. */
51
52struct gdbarch_tdep
53{
54 /* Register numbers for the PN and nPC registers. The definitions
55 for (64-bit) UltraSPARC differ from the (32-bit) SPARC
56 definitions. */
57 int pc_regnum;
58 int npc_regnum;
59
a54124c5 60 /* Register sets. */
b13feb94 61 const struct regset *gregset;
a54124c5 62 size_t sizeof_gregset;
b13feb94 63 const struct regset *fpregset;
a54124c5
MK
64 size_t sizeof_fpregset;
65
386c036b
MK
66 /* Offset of saved PC in jmp_buf. */
67 int jb_pc_offset;
68
69 /* Size of an Procedure Linkage Table (PLT) entry, 0 if we shouldn't
70 treat the PLT special when doing prologue analysis. */
71 size_t plt_entry_size;
c893be75
MK
72
73 /* Alternative location for trap return. Used for single-stepping. */
0b1b3e42 74 CORE_ADDR (*step_trap) (struct frame_info *frame, unsigned long insn);
209bd28e
UW
75
76 /* ISA-specific data types. */
77 struct type *sparc_psr_type;
78 struct type *sparc_fsr_type;
79 struct type *sparc64_pstate_type;
80 struct type *sparc64_fsr_type;
81 struct type *sparc64_fprs_type;
386c036b
MK
82};
83
84/* Register numbers of various important registers. */
85
86enum sparc_regnum
87{
88 SPARC_G0_REGNUM, /* %g0 */
89 SPARC_G1_REGNUM,
90 SPARC_G2_REGNUM,
91 SPARC_G3_REGNUM,
92 SPARC_G4_REGNUM,
93 SPARC_G5_REGNUM,
94 SPARC_G6_REGNUM,
95 SPARC_G7_REGNUM, /* %g7 */
96 SPARC_O0_REGNUM, /* %o0 */
97 SPARC_O1_REGNUM,
98 SPARC_O2_REGNUM,
99 SPARC_O3_REGNUM,
100 SPARC_O4_REGNUM,
101 SPARC_O5_REGNUM,
102 SPARC_SP_REGNUM, /* %sp (%o6) */
103 SPARC_O7_REGNUM, /* %o7 */
104 SPARC_L0_REGNUM, /* %l0 */
105 SPARC_L1_REGNUM,
106 SPARC_L2_REGNUM,
107 SPARC_L3_REGNUM,
108 SPARC_L4_REGNUM,
109 SPARC_L5_REGNUM,
110 SPARC_L6_REGNUM,
111 SPARC_L7_REGNUM, /* %l7 */
112 SPARC_I0_REGNUM, /* %i0 */
113 SPARC_I1_REGNUM,
114 SPARC_I2_REGNUM,
115 SPARC_I3_REGNUM,
116 SPARC_I4_REGNUM,
117 SPARC_I5_REGNUM,
118 SPARC_FP_REGNUM, /* %fp (%i6) */
119 SPARC_I7_REGNUM, /* %i7 */
120 SPARC_F0_REGNUM, /* %f0 */
121 SPARC_F1_REGNUM,
fe10a582
DM
122 SPARC_F2_REGNUM,
123 SPARC_F3_REGNUM,
124 SPARC_F4_REGNUM,
125 SPARC_F5_REGNUM,
126 SPARC_F6_REGNUM,
127 SPARC_F7_REGNUM,
386c036b
MK
128 SPARC_F31_REGNUM /* %f31 */
129 = SPARC_F0_REGNUM + 31
130};
131
132enum sparc32_regnum
133{
134 SPARC32_Y_REGNUM /* %y */
135 = SPARC_F31_REGNUM + 1,
136 SPARC32_PSR_REGNUM, /* %psr */
137 SPARC32_WIM_REGNUM, /* %wim */
138 SPARC32_TBR_REGNUM, /* %tbr */
139 SPARC32_PC_REGNUM, /* %pc */
140 SPARC32_NPC_REGNUM, /* %npc */
141 SPARC32_FSR_REGNUM, /* %fsr */
142 SPARC32_CSR_REGNUM, /* %csr */
143
144 /* Pseudo registers. */
145 SPARC32_D0_REGNUM, /* %d0 */
146 SPARC32_D30_REGNUM /* %d30 */
147 = SPARC32_D0_REGNUM + 15
148};
149\f
150
151struct sparc_frame_cache
152{
153 /* Base address. */
154 CORE_ADDR base;
155 CORE_ADDR pc;
156
157 /* Do we have a frame? */
158 int frameless_p;
159
369c397b
JB
160 /* The offset from the base register to the CFA. */
161 int frame_offset;
162
163 /* Mask of `local' and `in' registers saved in the register save area. */
164 unsigned short int saved_regs_mask;
165
166 /* Mask of `out' registers copied or renamed to their `in' sibling. */
167 unsigned char copied_regs_mask;
168
c378eb4e 169 /* Do we have a Structure, Union or Quad-Precision return value? */
386c036b
MK
170 int struct_return_p;
171
172 /* Table of saved registers. */
173 struct trad_frame_saved_reg *saved_regs;
174};
175
176/* Fetch the instruction at PC. */
177extern unsigned long sparc_fetch_instruction (CORE_ADDR pc);
178
1c800673 179/* Fetch StackGhost Per-Process XOR cookie. */
e17a4113 180extern ULONGEST sparc_fetch_wcookie (struct gdbarch *gdbarch);
1c800673 181
369c397b
JB
182/* Record the effect of a SAVE instruction on CACHE. */
183extern void sparc_record_save_insn (struct sparc_frame_cache *cache);
184
185/* Do a full analysis of the prologue at PC and update CACHE accordingly. */
be8626e0
MD
186extern CORE_ADDR sparc_analyze_prologue (struct gdbarch *gdbarch,
187 CORE_ADDR pc, CORE_ADDR current_pc,
386c036b
MK
188 struct sparc_frame_cache *cache);
189
190extern struct sparc_frame_cache *
236369e7 191 sparc_frame_cache (struct frame_info *this_frame, void **this_cache);
386c036b
MK
192
193extern struct sparc_frame_cache *
236369e7 194 sparc32_frame_cache (struct frame_info *this_frame, void **this_cache);
386c036b 195
961842b2 196extern int
c9cf6e20 197 sparc_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc);
961842b2 198
386c036b
MK
199\f
200
386c036b
MK
201extern void sparc_supply_rwindow (struct regcache *regcache,
202 CORE_ADDR sp, int regnum);
203extern void sparc_collect_rwindow (const struct regcache *regcache,
204 CORE_ADDR sp, int regnum);
205
206/* Register offsets for SunOS 4. */
b4fd25c9
AA
207extern const struct sparc_gregmap sparc32_sunos4_gregmap;
208extern const struct sparc_fpregmap sparc32_sunos4_fpregmap;
209extern const struct sparc_fpregmap sparc32_bsd_fpregmap;
386c036b 210
b4fd25c9 211extern void sparc32_supply_gregset (const struct sparc_gregmap *gregmap,
386c036b
MK
212 struct regcache *regcache,
213 int regnum, const void *gregs);
b4fd25c9 214extern void sparc32_collect_gregset (const struct sparc_gregmap *gregmap,
386c036b
MK
215 const struct regcache *regcache,
216 int regnum, void *gregs);
b4fd25c9 217extern void sparc32_supply_fpregset (const struct sparc_fpregmap *fpregmap,
db75c717 218 struct regcache *regcache,
386c036b 219 int regnum, const void *fpregs);
b4fd25c9 220extern void sparc32_collect_fpregset (const struct sparc_fpregmap *fpregmap,
db75c717 221 const struct regcache *regcache,
386c036b 222 int regnum, void *fpregs);
d0b5971a
JM
223
224extern int sparc_is_annulled_branch_insn (CORE_ADDR pc);
386c036b
MK
225
226/* Functions and variables exported from sparc-sol2-tdep.c. */
227
228/* Register offsets for Solaris 2. */
b4fd25c9
AA
229extern const struct sparc_gregmap sparc32_sol2_gregmap;
230extern const struct sparc_fpregmap sparc32_sol2_fpregmap;
386c036b 231
2c02bd72 232extern int sparc_sol2_pc_in_sigtramp (CORE_ADDR pc, const char *name);
386c036b 233
0d5cff50 234extern const char *sparc_sol2_static_transform_name (const char *name);
149ad273 235
386c036b
MK
236extern void sparc32_sol2_init_abi (struct gdbarch_info info,
237 struct gdbarch *gdbarch);
238
239/* Functions and variables exported from sparcnbsd-tdep.c. */
240
241/* Register offsets for NetBSD. */
b4fd25c9 242extern const struct sparc_gregmap sparc32nbsd_gregmap;
386c036b 243
c893be75
MK
244/* Return the address of a system call's alternative return
245 address. */
0b1b3e42
UW
246extern CORE_ADDR sparcnbsd_step_trap (struct frame_info *frame,
247 unsigned long insn);
c893be75 248
19671c2b
MK
249extern void sparc32nbsd_elf_init_abi (struct gdbarch_info info,
250 struct gdbarch *gdbarch);
251
566626fa
MK
252extern struct trad_frame_saved_reg *
253 sparc32nbsd_sigcontext_saved_regs (struct frame_info *next_frame);
254
386c036b 255#endif /* sparc-tdep.h */
This page took 2.173451 seconds and 4 git commands to generate.