1/* Target-dependent code for GDB, the GNU debugger.
2   Copyright 2000, 2001, 2002, 2003
3   Free Software Foundation, Inc.
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
9   the Free Software Foundation; either version 2 of the License, or
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
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.  */
21
22#ifndef PPC_TDEP_H
23#define PPC_TDEP_H
24
25struct gdbarch;
26struct frame_info;
27struct value;
28struct regcache;
29struct type;
30
31/* From ppc-linux-tdep.c... */
32CORE_ADDR ppc_linux_frame_saved_pc (struct frame_info *fi);
33void ppc_linux_init_extra_frame_info (int fromleaf, struct frame_info *);
34int ppc_linux_frameless_function_invocation (struct frame_info *);
35void ppc_linux_frame_init_saved_regs (struct frame_info *);
36CORE_ADDR ppc_linux_frame_chain (struct frame_info *);
37enum return_value_convention ppc_sysv_abi_return_value (struct gdbarch *gdbarch,
38							struct type *valtype,
39							struct regcache *regcache,
40							void *readbuf,
41							const void *writebuf);
42enum return_value_convention ppc_sysv_abi_broken_return_value (struct gdbarch *gdbarch,
43							       struct type *valtype,
44							       struct regcache *regcache,
45							       void *readbuf,
46							       const void *writebuf);
47CORE_ADDR ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch,
48					CORE_ADDR func_addr,
49					struct regcache *regcache,
50					CORE_ADDR bp_addr, int nargs,
51					struct value **args, CORE_ADDR sp,
52					int struct_return,
53					CORE_ADDR struct_addr);
54CORE_ADDR ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch,
55					  CORE_ADDR func_addr,
56					  struct regcache *regcache,
57					  CORE_ADDR bp_addr, int nargs,
58					  struct value **args, CORE_ADDR sp,
59					  int struct_return,
60					  CORE_ADDR struct_addr);
61CORE_ADDR ppc64_sysv_abi_adjust_breakpoint_address (struct gdbarch *gdbarch,
62						    CORE_ADDR bpaddr);
63int ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache);
64struct link_map_offsets *ppc_linux_svr4_fetch_link_map_offsets (void);
65void ppc_linux_supply_gregset (char *buf);
66void ppc_linux_supply_fpregset (char *buf);
67
68enum return_value_convention ppc64_sysv_abi_return_value (struct gdbarch *gdbarch,
69							  struct type *valtype,
70							  struct regcache *regcache,
71							  void *readbuf,
72							  const void *writebuf);
73
74/* From rs6000-tdep.c... */
75CORE_ADDR rs6000_frame_saved_pc (struct frame_info *fi);
76void rs6000_init_extra_frame_info (int fromleaf, struct frame_info *);
77int rs6000_frameless_function_invocation (struct frame_info *);
78void rs6000_frame_init_saved_regs (struct frame_info *);
79CORE_ADDR rs6000_frame_chain (struct frame_info *);
80int altivec_register_p (int regno);
81
82
83/* Return non-zero when the architecture has an FPU (or at least when
84   the ABI is using the FPU).  */
85int ppc_floating_point_unit_p (struct gdbarch *gdbarch);
86
87/* Private data that this module attaches to struct gdbarch. */
88
89struct gdbarch_tdep
90  {
91    int wordsize;              /* size in bytes of fixed-point word */
92    int *regoff;               /* byte offsets in register arrays */
93    const struct reg *regs;    /* from current variant */
94    int ppc_gp0_regnum;		/* GPR register 0 */
95    int ppc_gplast_regnum;	/* GPR register 31 */
96    int ppc_toc_regnum;		/* TOC register */
97    int ppc_ps_regnum;	        /* Processor (or machine) status (%msr) */
98    int ppc_cr_regnum;		/* Condition register */
99    int ppc_lr_regnum;		/* Link register */
100    int ppc_ctr_regnum;		/* Count register */
101    int ppc_xer_regnum;		/* Integer exception register */
102    int ppc_fpscr_regnum;	/* Floating point status and condition
103    				   register */
104    int ppc_mq_regnum;		/* Multiply/Divide extension register */
105    int ppc_vr0_regnum;		/* First AltiVec register */
106    int ppc_vrsave_regnum;	/* Last AltiVec register */
107    int ppc_ev0_regnum;         /* First ev register */
108    int ppc_ev31_regnum;        /* Last ev register */
109    int lr_frame_offset;	/* Offset to ABI specific location where
110                                   link register is saved.  */
111};
112
113#endif
114