* ppc-opc.c (powerpc_opcodes) <"lswx">: Use RAX for the second and
[binutils-gdb.git] / gdb / sparc-tdep.h
blobdb949945e673d1c7551e7b2431114443bcfc03bf
1 /* Target-dependent code for SPARC.
3 Copyright (C) 2003-2004, 2006-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/>. */
20 #ifndef SPARC_TDEP_H
21 #define SPARC_TDEP_H 1
23 struct frame_info;
24 struct gdbarch;
25 struct regcache;
26 struct regset;
27 struct trad_frame_saved_reg;
29 /* Register offsets for the general-purpose register set. */
31 struct sparc_gregset
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;
44 /* SPARC architecture-specific information. */
46 struct gdbarch_tdep
48 /* Register numbers for the PN and nPC registers. The definitions
49 for (64-bit) UltraSPARC differ from the (32-bit) SPARC
50 definitions. */
51 int pc_regnum;
52 int npc_regnum;
54 /* Register sets. */
55 struct regset *gregset;
56 size_t sizeof_gregset;
57 struct regset *fpregset;
58 size_t sizeof_fpregset;
60 /* Offset of saved PC in jmp_buf. */
61 int jb_pc_offset;
63 /* Size of an Procedure Linkage Table (PLT) entry, 0 if we shouldn't
64 treat the PLT special when doing prologue analysis. */
65 size_t plt_entry_size;
67 /* Alternative location for trap return. Used for single-stepping. */
68 CORE_ADDR (*step_trap) (struct frame_info *frame, unsigned long insn);
70 /* ISA-specific data types. */
71 struct type *sparc_psr_type;
72 struct type *sparc_fsr_type;
73 struct type *sparc64_pstate_type;
74 struct type *sparc64_fsr_type;
75 struct type *sparc64_fprs_type;
78 /* Register numbers of various important registers. */
80 enum sparc_regnum
82 SPARC_G0_REGNUM, /* %g0 */
83 SPARC_G1_REGNUM,
84 SPARC_G2_REGNUM,
85 SPARC_G3_REGNUM,
86 SPARC_G4_REGNUM,
87 SPARC_G5_REGNUM,
88 SPARC_G6_REGNUM,
89 SPARC_G7_REGNUM, /* %g7 */
90 SPARC_O0_REGNUM, /* %o0 */
91 SPARC_O1_REGNUM,
92 SPARC_O2_REGNUM,
93 SPARC_O3_REGNUM,
94 SPARC_O4_REGNUM,
95 SPARC_O5_REGNUM,
96 SPARC_SP_REGNUM, /* %sp (%o6) */
97 SPARC_O7_REGNUM, /* %o7 */
98 SPARC_L0_REGNUM, /* %l0 */
99 SPARC_L1_REGNUM,
100 SPARC_L2_REGNUM,
101 SPARC_L3_REGNUM,
102 SPARC_L4_REGNUM,
103 SPARC_L5_REGNUM,
104 SPARC_L6_REGNUM,
105 SPARC_L7_REGNUM, /* %l7 */
106 SPARC_I0_REGNUM, /* %i0 */
107 SPARC_I1_REGNUM,
108 SPARC_I2_REGNUM,
109 SPARC_I3_REGNUM,
110 SPARC_I4_REGNUM,
111 SPARC_I5_REGNUM,
112 SPARC_FP_REGNUM, /* %fp (%i6) */
113 SPARC_I7_REGNUM, /* %i7 */
114 SPARC_F0_REGNUM, /* %f0 */
115 SPARC_F1_REGNUM,
116 SPARC_F2_REGNUM,
117 SPARC_F3_REGNUM,
118 SPARC_F4_REGNUM,
119 SPARC_F5_REGNUM,
120 SPARC_F6_REGNUM,
121 SPARC_F7_REGNUM,
122 SPARC_F31_REGNUM /* %f31 */
123 = SPARC_F0_REGNUM + 31
126 enum sparc32_regnum
128 SPARC32_Y_REGNUM /* %y */
129 = SPARC_F31_REGNUM + 1,
130 SPARC32_PSR_REGNUM, /* %psr */
131 SPARC32_WIM_REGNUM, /* %wim */
132 SPARC32_TBR_REGNUM, /* %tbr */
133 SPARC32_PC_REGNUM, /* %pc */
134 SPARC32_NPC_REGNUM, /* %npc */
135 SPARC32_FSR_REGNUM, /* %fsr */
136 SPARC32_CSR_REGNUM, /* %csr */
138 /* Pseudo registers. */
139 SPARC32_D0_REGNUM, /* %d0 */
140 SPARC32_D30_REGNUM /* %d30 */
141 = SPARC32_D0_REGNUM + 15
145 struct sparc_frame_cache
147 /* Base address. */
148 CORE_ADDR base;
149 CORE_ADDR pc;
151 /* Do we have a frame? */
152 int frameless_p;
154 /* The offset from the base register to the CFA. */
155 int frame_offset;
157 /* Mask of `local' and `in' registers saved in the register save area. */
158 unsigned short int saved_regs_mask;
160 /* Mask of `out' registers copied or renamed to their `in' sibling. */
161 unsigned char copied_regs_mask;
163 /* Do we have a Structure, Union or Quad-Precision return value? */
164 int struct_return_p;
166 /* Table of saved registers. */
167 struct trad_frame_saved_reg *saved_regs;
170 /* Fetch the instruction at PC. */
171 extern unsigned long sparc_fetch_instruction (CORE_ADDR pc);
173 /* Fetch StackGhost Per-Process XOR cookie. */
174 extern ULONGEST sparc_fetch_wcookie (struct gdbarch *gdbarch);
176 /* Record the effect of a SAVE instruction on CACHE. */
177 extern void sparc_record_save_insn (struct sparc_frame_cache *cache);
179 /* Do a full analysis of the prologue at PC and update CACHE accordingly. */
180 extern CORE_ADDR sparc_analyze_prologue (struct gdbarch *gdbarch,
181 CORE_ADDR pc, CORE_ADDR current_pc,
182 struct sparc_frame_cache *cache);
184 extern struct sparc_frame_cache *
185 sparc_frame_cache (struct frame_info *this_frame, void **this_cache);
187 extern struct sparc_frame_cache *
188 sparc32_frame_cache (struct frame_info *this_frame, void **this_cache);
192 extern int sparc_software_single_step (struct frame_info *frame);
194 extern void sparc_supply_rwindow (struct regcache *regcache,
195 CORE_ADDR sp, int regnum);
196 extern void sparc_collect_rwindow (const struct regcache *regcache,
197 CORE_ADDR sp, int regnum);
199 /* Register offsets for SunOS 4. */
200 extern const struct sparc_gregset sparc32_sunos4_gregset;
202 extern void sparc32_supply_gregset (const struct sparc_gregset *gregset,
203 struct regcache *regcache,
204 int regnum, const void *gregs);
205 extern void sparc32_collect_gregset (const struct sparc_gregset *gregset,
206 const struct regcache *regcache,
207 int regnum, void *gregs);
208 extern void sparc32_supply_fpregset (struct regcache *regcache,
209 int regnum, const void *fpregs);
210 extern void sparc32_collect_fpregset (const struct regcache *regcache,
211 int regnum, void *fpregs);
213 /* Functions and variables exported from sparc-sol2-tdep.c. */
215 /* Register offsets for Solaris 2. */
216 extern const struct sparc_gregset sparc32_sol2_gregset;
218 extern int sparc_sol2_pc_in_sigtramp (CORE_ADDR pc, const char *name);
220 extern const char *sparc_sol2_static_transform_name (const char *name);
222 extern void sparc32_sol2_init_abi (struct gdbarch_info info,
223 struct gdbarch *gdbarch);
225 /* Functions and variables exported from sparcnbsd-tdep.c. */
227 /* Register offsets for NetBSD. */
228 extern const struct sparc_gregset sparc32nbsd_gregset;
230 /* Return the address of a system call's alternative return
231 address. */
232 extern CORE_ADDR sparcnbsd_step_trap (struct frame_info *frame,
233 unsigned long insn);
235 extern void sparc32nbsd_elf_init_abi (struct gdbarch_info info,
236 struct gdbarch *gdbarch);
238 extern struct trad_frame_saved_reg *
239 sparc32nbsd_sigcontext_saved_regs (struct frame_info *next_frame);
241 #endif /* sparc-tdep.h */