* rs6000-tdep.c (registers_860): Correct register name. (No PPC
[deliverable/binutils-gdb.git] / gdb / ppc-tdep.h
CommitLineData
9aa1e687 1/* Target-dependent code for GDB, the GNU debugger.
f9be684a
AC
2
3 Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation,
4 Inc.
9aa1e687
KB
5
6 This file is part of GDB.
7
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 2 of the License, or
11 (at your option) any later version.
12
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.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
22
3a1c5313
AC
23#ifndef PPC_TDEP_H
24#define PPC_TDEP_H
25
da3331ec 26struct gdbarch;
3a1c5313
AC
27struct frame_info;
28struct value;
4a4b3fed 29struct regcache;
221c12ff 30struct type;
3a1c5313 31
9aa1e687 32/* From ppc-linux-tdep.c... */
05580c65
AC
33enum return_value_convention ppc_sysv_abi_return_value (struct gdbarch *gdbarch,
34 struct type *valtype,
35 struct regcache *regcache,
963e2bb7
AC
36 void *readbuf,
37 const void *writebuf);
05580c65
AC
38enum return_value_convention ppc_sysv_abi_broken_return_value (struct gdbarch *gdbarch,
39 struct type *valtype,
40 struct regcache *regcache,
963e2bb7
AC
41 void *readbuf,
42 const void *writebuf);
77b2b6d4 43CORE_ADDR ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch,
7d9b040b 44 struct value *function,
77b2b6d4
AC
45 struct regcache *regcache,
46 CORE_ADDR bp_addr, int nargs,
47 struct value **args, CORE_ADDR sp,
48 int struct_return,
49 CORE_ADDR struct_addr);
8be9034a 50CORE_ADDR ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch,
7d9b040b 51 struct value *function,
8be9034a
AC
52 struct regcache *regcache,
53 CORE_ADDR bp_addr, int nargs,
54 struct value **args, CORE_ADDR sp,
55 int struct_return,
56 CORE_ADDR struct_addr);
6066c3de
AC
57CORE_ADDR ppc64_sysv_abi_adjust_breakpoint_address (struct gdbarch *gdbarch,
58 CORE_ADDR bpaddr);
9aa1e687 59int ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache);
6ded7999 60struct link_map_offsets *ppc_linux_svr4_fetch_link_map_offsets (void);
f9be684a
AC
61void ppc_linux_supply_gregset (struct regcache *regcache,
62 int regnum, const void *gregs, size_t size,
63 int wordsize);
64void ppc_linux_supply_fpregset (const struct regset *regset,
65 struct regcache *regcache,
66 int regnum, const void *gregs, size_t size);
9aa1e687 67
05580c65
AC
68enum return_value_convention ppc64_sysv_abi_return_value (struct gdbarch *gdbarch,
69 struct type *valtype,
70 struct regcache *regcache,
963e2bb7
AC
71 void *readbuf,
72 const void *writebuf);
9aa1e687
KB
73
74/* From rs6000-tdep.c... */
1fcc0bb8 75int altivec_register_p (int regno);
867e2dc5 76int spe_register_p (int regno);
9aa1e687 77
383f0f5b
JB
78/* Return non-zero if the architecture described by GDBARCH has
79 floating-point registers (f0 --- f31 and fpscr). */
0a613259
AC
80int ppc_floating_point_unit_p (struct gdbarch *gdbarch);
81
d195bc9f
MK
82/* Register set description. */
83
84struct ppc_reg_offsets
85{
86 /* General-purpose registers. */
87 int r0_offset;
88 int pc_offset;
89 int ps_offset;
90 int cr_offset;
91 int lr_offset;
92 int ctr_offset;
93 int xer_offset;
94 int mq_offset;
95
96 /* Floating-point registers. */
97 int f0_offset;
98 int fpscr_offset;
99
100 /* AltiVec registers. */
101 int vr0_offset;
102 int vscr_offset;
103 int vrsave_offset;
104};
105
106/* Supply register REGNUM in the general-purpose register set REGSET
107 from the buffer specified by GREGS and LEN to register cache
108 REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */
109
110extern void ppc_supply_gregset (const struct regset *regset,
111 struct regcache *regcache,
112 int regnum, const void *gregs, size_t len);
113
114/* Supply register REGNUM in the floating-point register set REGSET
115 from the buffer specified by FPREGS and LEN to register cache
116 REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */
117
118extern void ppc_supply_fpregset (const struct regset *regset,
119 struct regcache *regcache,
120 int regnum, const void *fpregs, size_t len);
121
122/* Collect register REGNUM in the general-purpose register set
123 REGSET. from register cache REGCACHE into the buffer specified by
124 GREGS and LEN. If REGNUM is -1, do this for all registers in
125 REGSET. */
126
127extern void ppc_collect_gregset (const struct regset *regset,
128 const struct regcache *regcache,
129 int regnum, void *gregs, size_t len);
130
131/* Collect register REGNUM in the floating-point register set
132 REGSET. from register cache REGCACHE into the buffer specified by
133 FPREGS and LEN. If REGNUM is -1, do this for all registers in
134 REGSET. */
135
136extern void ppc_collect_fpregset (const struct regset *regset,
137 const struct regcache *regcache,
138 int regnum, void *fpregs, size_t len);
139
2188cbdd
EZ
140/* Private data that this module attaches to struct gdbarch. */
141
142struct gdbarch_tdep
143 {
144 int wordsize; /* size in bytes of fixed-point word */
2188cbdd
EZ
145 const struct reg *regs; /* from current variant */
146 int ppc_gp0_regnum; /* GPR register 0 */
01904826 147 int ppc_gprs_pseudo_p; /* non-zero if GPRs are pseudo-registers */
2188cbdd
EZ
148 int ppc_toc_regnum; /* TOC register */
149 int ppc_ps_regnum; /* Processor (or machine) status (%msr) */
150 int ppc_cr_regnum; /* Condition register */
151 int ppc_lr_regnum; /* Link register */
152 int ppc_ctr_regnum; /* Count register */
153 int ppc_xer_regnum; /* Integer exception register */
383f0f5b
JB
154
155 /* On PPC and RS6000 variants that have no floating-point
156 registers, the next two members will be -1. */
366f009f 157 int ppc_fp0_regnum; /* floating-point register 0 */
e3f36dbd
KB
158 int ppc_fpscr_regnum; /* Floating point status and condition
159 register */
383f0f5b 160
2188cbdd 161 int ppc_mq_regnum; /* Multiply/Divide extension register */
1fcc0bb8
EZ
162 int ppc_vr0_regnum; /* First AltiVec register */
163 int ppc_vrsave_regnum; /* Last AltiVec register */
c8001721
EZ
164 int ppc_ev0_regnum; /* First ev register */
165 int ppc_ev31_regnum; /* Last ev register */
867e2dc5
JB
166 int ppc_acc_regnum; /* SPE 'acc' register */
167 int ppc_spefscr_regnum; /* SPE 'spefscr' register */
a88376a3
KB
168 int lr_frame_offset; /* Offset to ABI specific location where
169 link register is saved. */
2188cbdd 170};
3a1c5313 171
b967e06f
JB
172
173/* Constants for register set sizes. */
174enum
175 {
8bf659e8 176 ppc_num_gprs = 32, /* 32 general-purpose registers */
b967e06f
JB
177 ppc_num_fprs = 32 /* 32 floating-point registers */
178 };
179
3a1c5313 180#endif
This page took 0.388418 seconds and 4 git commands to generate.