2002-12-05 05:17:39 +00:00
|
|
|
/* Target-dependent header for the MIPS architecture, for GDB, the GNU Debugger.
|
|
|
|
|
2007-01-09 17:59:20 +00:00
|
|
|
Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
|
2002-12-05 05:17:39 +00: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
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(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
|
|
|
|
along with this program; if not, write to the Free Software
|
2005-12-17 22:34:03 +00:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA. */
|
2002-12-05 05:17:39 +00: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 17:41:26 +00:00
|
|
|
struct gdbarch;
|
|
|
|
|
2002-12-05 05:17:39 +00: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 18:28:43 +00:00
|
|
|
/* Return the MIPS ISA's register size. Just a short cut to the BFD
|
2003-11-15 22:09:07 +00:00
|
|
|
architecture's word size. */
|
2004-04-29 18:28:43 +00:00
|
|
|
extern int mips_isa_regsize (struct gdbarch *gdbarch);
|
2003-11-15 22:09:07 +00: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 19:24:05 +00: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);
|
|
|
|
|
2004-10-30 22:36:34 +00:00
|
|
|
/* Register numbers of various important registers. Note that some of
|
|
|
|
these values are "real" register numbers, and correspond to the
|
|
|
|
general registers of the machine, and some are "phony" register
|
|
|
|
numbers which are too large to be actual register numbers as far as
|
|
|
|
the user is concerned but do serve to get the desired values when
|
|
|
|
passed to read_register. */
|
|
|
|
|
2004-10-26 19:40:39 +00:00
|
|
|
enum
|
|
|
|
{
|
2004-10-30 22:36:34 +00:00
|
|
|
MIPS_ZERO_REGNUM = 0, /* Read-only register, always 0. */
|
2004-10-26 19:40:39 +00:00
|
|
|
MIPS_AT_REGNUM = 1,
|
2004-10-30 22:36:34 +00: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 00:01:04 +00:00
|
|
|
MIPS_SP_REGNUM = 29,
|
2004-10-26 19:40:39 +00:00
|
|
|
MIPS_RA_REGNUM = 31,
|
2004-10-30 22:54:40 +00: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 19:24:05 +00: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-30 22:36:34 +00:00
|
|
|
MIPS_EMBED_FP0_REGNUM = 38,
|
2004-10-30 23:08:18 +00:00
|
|
|
MIPS_UNUSED_REGNUM = 73, /* Never used, FIXME */
|
|
|
|
MIPS_FIRST_EMBED_REGNUM = 74, /* First CP0 register for embedded use. */
|
2004-10-30 23:22:54 +00:00
|
|
|
MIPS_PRID_REGNUM = 89, /* Processor ID. */
|
2004-10-30 23:08:18 +00: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 19:24:05 +00:00
|
|
|
};
|
|
|
|
|
2003-11-16 22:46:49 +00:00
|
|
|
/* Defined in mips-tdep.c and used in remote-mips.c */
|
|
|
|
extern void deprecated_mips_set_processor_regs_hack (void);
|
|
|
|
|
2004-10-30 20:54:54 +00:00
|
|
|
/* Instruction sizes and other useful constants. */
|
|
|
|
enum
|
2004-10-26 19:40:39 +00:00
|
|
|
{
|
2004-10-30 20:54:54 +00:00
|
|
|
MIPS_INSN16_SIZE = 2,
|
|
|
|
MIPS_INSN32_SIZE = 4,
|
|
|
|
/* The number of floating-point or integer registers. */
|
|
|
|
MIPS_NUMREGS = 32
|
2004-10-26 19:40:39 +00:00
|
|
|
};
|
|
|
|
|
2004-10-26 14:13:24 +00:00
|
|
|
/* Single step based on where the current instruction will take us. */
|
|
|
|
extern void mips_software_single_step (enum target_signal, int);
|
2003-11-16 22:46:49 +00:00
|
|
|
|
2004-10-30 17:53:47 +00: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 20:11:36 +00:00
|
|
|
/* Return the currently configured (or set) saved register size. */
|
|
|
|
extern unsigned int mips_abi_regsize (struct gdbarch *gdbarch);
|
|
|
|
|
2002-12-05 05:17:39 +00:00
|
|
|
#endif /* MIPS_TDEP_H */
|