2002-12-05 06:17:39 +01:00
|
|
|
/* Target-dependent header for the MIPS architecture, for GDB, the GNU Debugger.
|
|
|
|
|
2009-01-03 06:58:08 +01:00
|
|
|
Copyright (C) 2002, 2003, 2007, 2008, 2009 Free Software Foundation, Inc.
|
2002-12-05 06:17:39 +01:00
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-08-23 20:08:50 +02:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2002-12-05 06:17:39 +01:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-08-23 20:08:50 +02:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2002-12-05 06:17:39 +01:00
|
|
|
|
|
|
|
#ifndef MIPS_TDEP_H
|
|
|
|
#define MIPS_TDEP_H
|
|
|
|
|
2003-04-12 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh: Add missing opaque declarations.
* gdbarch.h: Regnerate.
* symtab.h: Add missing opaque declarations.
* value.h, target.h, symfile.h, stabsread.h: Ditto.
* x86-64-tdep.h, xmodem.h, monitor.h, typeprint.h: Ditto.
* srec.h, solib-svr4.h, source.h, inferior.h: Ditto.
* ser-unix.h, serial.h, remote-utils.h, gdbcore.h: Ditto.
* ppc-tdep.h, ocd.h, mips-tdep.h, gdbtypes.h: Ditto.
* buildsym.h, builtin-regs.h, linespec.h, language.h: Ditto.
* i387-tdep.h, gdbthread.h, event-top.h, gdb.h: Ditto.
* dwarf2cfi.h, doublest.h, disasm.h, cp-abi.h: Ditto.
* cli-out.h, c-lang.h, ax-gdb.h, arch-utils.h: Ditto.
* ada-lang.h, config/nm-lynx.h, config/nm-linux.h: Ditto.
* config/sparc/tm-sp64.h, config/rs6000/tm-rs6000.h: Ditto.
* config/pa/tm-hppah.h, config/m68k/tm-delta68.h: Ditto.
* cli/cli-setshow.h, cli/cli-script.h: Ditto.
2003-04-12 19:41:26 +02:00
|
|
|
struct gdbarch;
|
|
|
|
|
2002-12-05 06:17:39 +01:00
|
|
|
/* All the possible MIPS ABIs. */
|
|
|
|
enum mips_abi
|
|
|
|
{
|
|
|
|
MIPS_ABI_UNKNOWN = 0,
|
|
|
|
MIPS_ABI_N32,
|
|
|
|
MIPS_ABI_O32,
|
|
|
|
MIPS_ABI_N64,
|
|
|
|
MIPS_ABI_O64,
|
|
|
|
MIPS_ABI_EABI32,
|
|
|
|
MIPS_ABI_EABI64,
|
|
|
|
MIPS_ABI_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Return the MIPS ABI associated with GDBARCH. */
|
|
|
|
enum mips_abi mips_abi (struct gdbarch *gdbarch);
|
|
|
|
|
2004-04-29 20:28:43 +02:00
|
|
|
/* Return the MIPS ISA's register size. Just a short cut to the BFD
|
2003-11-15 23:09:07 +01:00
|
|
|
architecture's word size. */
|
2004-04-29 20:28:43 +02:00
|
|
|
extern int mips_isa_regsize (struct gdbarch *gdbarch);
|
2003-11-15 23:09:07 +01:00
|
|
|
|
2003-11-16 Andrew Cagney <cagney@redhat.com>
* mips-tdep.c (struct gdbarch_tdep): Add field "regnum".
(mips_fpa0_regnum, mips_regnum): New function.
(mips_gdbarch_init): Fill in the "regnum" fields.
* mips-tdep.h (struct mips_regnum): Define.
(mips_regnum): Declare.
* config/mips/tm-mips.h (BADVADDR_REGNUM): Delete macro.
(LO_REGNUM, HI_REGNUM, BADVADDR_REGNUM): Ditto.
(CAUSE_REGNUM, PC_REGNUM, FP0_REGNUM): Ditto.
(FCRCS_REGNUM, FCRIR_REGNUM, FPA0_REGNUM): Ditto.
* config/mips/tm-irix6.h (FP0_REGNUM): Delete macro.
(PC_REGNUM, CAUSE_REGNUM, BADVADDR_REGNUM): Ditto.
(HI_REGNUM, LO_REGNUM, FCRCS_REGNUM, FCRIR_REGNUM): Ditto.
* config/mips/tm-irix5.h (FP0_REGNUM): Delete macro.
(PC_REGNUM, CAUSE_REGNUM, BADVADDR_REGNUM): Ditto.
(HI_REGNUM, LO_REGNUM, FCRCS_REGNUM, FCRIR_REGNUM): Ditto.
* remote-mips.c: Include "mips-tdep.h". Update.
* mipsnbsd-tdep.c: Update.
* mipsv4-nat.c: Update.
* mips-tdep.c: Update.
* mips-nat.c: Update.
* mips-linux-tdep.c: Update.
* mips-linux-nat.c: Update.
* irix5-nat.c: Update.
* dve3900-rom.c: Include "mips-tdep.h". Update.
(ignore_packet): Supress GCC warning.
* config/mips/nm-riscos.h: Update.
* Makefile.in (dve3900-rom.o, remote-mips.o): Update dependencies.
2003-11-16 20:24:05 +01:00
|
|
|
/* Return the current index for various MIPS registers. */
|
|
|
|
struct mips_regnum
|
|
|
|
{
|
|
|
|
int pc;
|
|
|
|
int fp0;
|
|
|
|
int fp_implementation_revision;
|
|
|
|
int fp_control_status;
|
|
|
|
int badvaddr; /* Bad vaddr for addressing exception. */
|
|
|
|
int cause; /* Describes last exception. */
|
|
|
|
int hi; /* Multiply/divide temp. */
|
|
|
|
int lo; /* ... */
|
|
|
|
};
|
|
|
|
extern const struct mips_regnum *mips_regnum (struct gdbarch *gdbarch);
|
|
|
|
|
2008-07-27 22:52:42 +02:00
|
|
|
/* Some MIPS boards don't support floating point while others only
|
|
|
|
support single-precision floating-point operations. */
|
|
|
|
|
|
|
|
enum mips_fpu_type
|
|
|
|
{
|
|
|
|
MIPS_FPU_DOUBLE, /* Full double precision floating point. */
|
|
|
|
MIPS_FPU_SINGLE, /* Single precision floating point (R4650). */
|
|
|
|
MIPS_FPU_NONE /* No floating point. */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* MIPS specific per-architecture information */
|
|
|
|
struct gdbarch_tdep
|
|
|
|
{
|
|
|
|
/* from the elf header */
|
|
|
|
int elf_flags;
|
|
|
|
|
|
|
|
/* mips options */
|
|
|
|
enum mips_abi mips_abi;
|
|
|
|
enum mips_abi found_abi;
|
|
|
|
enum mips_fpu_type mips_fpu_type;
|
|
|
|
int mips_last_arg_regnum;
|
|
|
|
int mips_last_fp_arg_regnum;
|
|
|
|
int default_mask_address_p;
|
|
|
|
/* Is the target using 64-bit raw integer registers but only
|
|
|
|
storing a left-aligned 32-bit value in each? */
|
|
|
|
int mips64_transfers_32bit_regs_p;
|
|
|
|
/* Indexes for various registers. IRIX and embedded have
|
|
|
|
different values. This contains the "public" fields. Don't
|
|
|
|
add any that do not need to be public. */
|
|
|
|
const struct mips_regnum *regnum;
|
|
|
|
/* Register names table for the current register set. */
|
|
|
|
const char **mips_processor_reg_names;
|
|
|
|
|
|
|
|
/* The size of register data available from the target, if known.
|
|
|
|
This doesn't quite obsolete the manual
|
|
|
|
mips64_transfers_32bit_regs_p, since that is documented to force
|
|
|
|
left alignment even for big endian (very strange). */
|
|
|
|
int register_size_valid_p;
|
|
|
|
int register_size;
|
|
|
|
|
|
|
|
/* Return the expected next PC if FRAME is stopped at a syscall
|
|
|
|
instruction. */
|
|
|
|
CORE_ADDR (*syscall_next_pc) (struct frame_info *frame);
|
|
|
|
};
|
|
|
|
|
2007-05-13 14:48:40 +02:00
|
|
|
/* Register numbers of various important registers. */
|
2004-10-31 00:36:34 +02:00
|
|
|
|
2004-10-26 21:40:39 +02:00
|
|
|
enum
|
|
|
|
{
|
2004-10-31 00:36:34 +02:00
|
|
|
MIPS_ZERO_REGNUM = 0, /* Read-only register, always 0. */
|
2004-10-26 21:40:39 +02:00
|
|
|
MIPS_AT_REGNUM = 1,
|
2004-10-31 00:36:34 +02:00
|
|
|
MIPS_V0_REGNUM = 2, /* Function integer return value. */
|
|
|
|
MIPS_A0_REGNUM = 4, /* Loc of first arg during a subr call */
|
|
|
|
MIPS_T9_REGNUM = 25, /* Contains address of callee in PIC. */
|
2004-06-22 02:01:04 +02:00
|
|
|
MIPS_SP_REGNUM = 29,
|
2004-10-26 21:40:39 +02:00
|
|
|
MIPS_RA_REGNUM = 31,
|
2004-10-31 00:54:40 +02:00
|
|
|
MIPS_PS_REGNUM = 32, /* Contains processor status. */
|
2003-11-16 Andrew Cagney <cagney@redhat.com>
* mips-tdep.c (struct gdbarch_tdep): Add field "regnum".
(mips_fpa0_regnum, mips_regnum): New function.
(mips_gdbarch_init): Fill in the "regnum" fields.
* mips-tdep.h (struct mips_regnum): Define.
(mips_regnum): Declare.
* config/mips/tm-mips.h (BADVADDR_REGNUM): Delete macro.
(LO_REGNUM, HI_REGNUM, BADVADDR_REGNUM): Ditto.
(CAUSE_REGNUM, PC_REGNUM, FP0_REGNUM): Ditto.
(FCRCS_REGNUM, FCRIR_REGNUM, FPA0_REGNUM): Ditto.
* config/mips/tm-irix6.h (FP0_REGNUM): Delete macro.
(PC_REGNUM, CAUSE_REGNUM, BADVADDR_REGNUM): Ditto.
(HI_REGNUM, LO_REGNUM, FCRCS_REGNUM, FCRIR_REGNUM): Ditto.
* config/mips/tm-irix5.h (FP0_REGNUM): Delete macro.
(PC_REGNUM, CAUSE_REGNUM, BADVADDR_REGNUM): Ditto.
(HI_REGNUM, LO_REGNUM, FCRCS_REGNUM, FCRIR_REGNUM): Ditto.
* remote-mips.c: Include "mips-tdep.h". Update.
* mipsnbsd-tdep.c: Update.
* mipsv4-nat.c: Update.
* mips-tdep.c: Update.
* mips-nat.c: Update.
* mips-linux-tdep.c: Update.
* mips-linux-nat.c: Update.
* irix5-nat.c: Update.
* dve3900-rom.c: Include "mips-tdep.h". Update.
(ignore_packet): Supress GCC warning.
* config/mips/nm-riscos.h: Update.
* Makefile.in (dve3900-rom.o, remote-mips.o): Update dependencies.
2003-11-16 20:24:05 +01:00
|
|
|
MIPS_EMBED_LO_REGNUM = 33,
|
|
|
|
MIPS_EMBED_HI_REGNUM = 34,
|
|
|
|
MIPS_EMBED_BADVADDR_REGNUM = 35,
|
|
|
|
MIPS_EMBED_CAUSE_REGNUM = 36,
|
|
|
|
MIPS_EMBED_PC_REGNUM = 37,
|
2004-10-31 00:36:34 +02:00
|
|
|
MIPS_EMBED_FP0_REGNUM = 38,
|
2004-10-31 01:08:18 +02:00
|
|
|
MIPS_UNUSED_REGNUM = 73, /* Never used, FIXME */
|
|
|
|
MIPS_FIRST_EMBED_REGNUM = 74, /* First CP0 register for embedded use. */
|
2004-10-31 01:22:54 +02:00
|
|
|
MIPS_PRID_REGNUM = 89, /* Processor ID. */
|
2004-10-31 01:08:18 +02:00
|
|
|
MIPS_LAST_EMBED_REGNUM = 89 /* Last one. */
|
2003-11-16 Andrew Cagney <cagney@redhat.com>
* mips-tdep.c (struct gdbarch_tdep): Add field "regnum".
(mips_fpa0_regnum, mips_regnum): New function.
(mips_gdbarch_init): Fill in the "regnum" fields.
* mips-tdep.h (struct mips_regnum): Define.
(mips_regnum): Declare.
* config/mips/tm-mips.h (BADVADDR_REGNUM): Delete macro.
(LO_REGNUM, HI_REGNUM, BADVADDR_REGNUM): Ditto.
(CAUSE_REGNUM, PC_REGNUM, FP0_REGNUM): Ditto.
(FCRCS_REGNUM, FCRIR_REGNUM, FPA0_REGNUM): Ditto.
* config/mips/tm-irix6.h (FP0_REGNUM): Delete macro.
(PC_REGNUM, CAUSE_REGNUM, BADVADDR_REGNUM): Ditto.
(HI_REGNUM, LO_REGNUM, FCRCS_REGNUM, FCRIR_REGNUM): Ditto.
* config/mips/tm-irix5.h (FP0_REGNUM): Delete macro.
(PC_REGNUM, CAUSE_REGNUM, BADVADDR_REGNUM): Ditto.
(HI_REGNUM, LO_REGNUM, FCRCS_REGNUM, FCRIR_REGNUM): Ditto.
* remote-mips.c: Include "mips-tdep.h". Update.
* mipsnbsd-tdep.c: Update.
* mipsv4-nat.c: Update.
* mips-tdep.c: Update.
* mips-nat.c: Update.
* mips-linux-tdep.c: Update.
* mips-linux-nat.c: Update.
* irix5-nat.c: Update.
* dve3900-rom.c: Include "mips-tdep.h". Update.
(ignore_packet): Supress GCC warning.
* config/mips/nm-riscos.h: Update.
* Makefile.in (dve3900-rom.o, remote-mips.o): Update dependencies.
2003-11-16 20:24:05 +01:00
|
|
|
};
|
|
|
|
|
2003-11-16 23:46:49 +01:00
|
|
|
/* Defined in mips-tdep.c and used in remote-mips.c */
|
|
|
|
extern void deprecated_mips_set_processor_regs_hack (void);
|
|
|
|
|
2004-10-30 22:54:54 +02:00
|
|
|
/* Instruction sizes and other useful constants. */
|
|
|
|
enum
|
2004-10-26 21:40:39 +02:00
|
|
|
{
|
2004-10-30 22:54:54 +02:00
|
|
|
MIPS_INSN16_SIZE = 2,
|
|
|
|
MIPS_INSN32_SIZE = 4,
|
|
|
|
/* The number of floating-point or integer registers. */
|
|
|
|
MIPS_NUMREGS = 32
|
2004-10-26 21:40:39 +02:00
|
|
|
};
|
|
|
|
|
2004-10-26 16:13:24 +02:00
|
|
|
/* Single step based on where the current instruction will take us. */
|
2007-06-16 00:37:35 +02:00
|
|
|
extern int mips_software_single_step (struct frame_info *frame);
|
2003-11-16 23:46:49 +01:00
|
|
|
|
2004-10-30 19:53:47 +02:00
|
|
|
/* Tell if the program counter value in MEMADDR is in a MIPS16
|
|
|
|
function. */
|
|
|
|
extern int mips_pc_is_mips16 (bfd_vma memaddr);
|
|
|
|
|
2004-10-30 22:11:36 +02:00
|
|
|
/* Return the currently configured (or set) saved register size. */
|
|
|
|
extern unsigned int mips_abi_regsize (struct gdbarch *gdbarch);
|
|
|
|
|
2007-09-10 23:14:11 +02:00
|
|
|
/* Target descriptions which only indicate the size of general
|
|
|
|
registers. */
|
|
|
|
extern struct target_desc *mips_tdesc_gp32;
|
|
|
|
extern struct target_desc *mips_tdesc_gp64;
|
|
|
|
|
2002-12-05 06:17:39 +01:00
|
|
|
#endif /* MIPS_TDEP_H */
|