* mips-tdep.h: Add comments on registers.
(MIPS_UNUSED_REGNUM): Define.
* config/mips/tm-mips.h (ZERO_REGNUM, UNUSED_REGNUM)
(T9_REGNUM, V0_REGNUM, A0_REGNUM): Delete.
* irix5-nat.c, mipsv4-nat.c, mips-linux-tdep.c: Update.
* mips-linux-nat.c, remote-mips.c: Update.
2004-10-30 Andrew Cagney <cagney@gnu.org>
+ * mips-tdep.h: Add comments on registers.
+ (MIPS_UNUSED_REGNUM): Define.
+ * config/mips/tm-mips.h (ZERO_REGNUM, UNUSED_REGNUM)
+ (T9_REGNUM, V0_REGNUM, A0_REGNUM): Delete.
+ * irix5-nat.c, mipsv4-nat.c, mips-linux-tdep.c: Update.
+ * mips-linux-nat.c, remote-mips.c: Update.
+
* config/mips/tm-mips.h (t_insn): Delete.
* mips-tdep.c (mips_fetch_instruction, mips_skip_trampoline_code):
Replace t_insn with ULONGEST.
#define STEP_SKIPS_DELAY_P (1)
#define STEP_SKIPS_DELAY(pc) (mips_step_skips_delay (pc))
-/* 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. */
-
-#define ZERO_REGNUM 0 /* read-only register, always 0 */
-#define V0_REGNUM 2 /* Function integer return value */
-#define A0_REGNUM 4 /* Loc of first arg during a subr call */
-#define T9_REGNUM 25 /* Contains address of callee in PIC */
#define RA_REGNUM 31 /* Contains return address value */
#define PS_REGNUM 32 /* Contains processor status */
-#define UNUSED_REGNUM 73 /* Never used, FIXME */
#define FIRST_EMBED_REGNUM 74 /* First CP0 register for embedded use */
#define PRID_REGNUM 89 /* Processor ID */
#define LAST_EMBED_REGNUM 89 /* Last one */
CORE_ADDR jb_addr;
buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
- jb_addr = read_register (A0_REGNUM);
+ jb_addr = read_register (MIPS_A0_REGNUM);
if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
TARGET_PTR_BIT / TARGET_CHAR_BIT))
/* Pseudo registers can not be read. ptrace does not provide a way to
read (or set) PS_REGNUM, and there's no point in reading or setting
- ZERO_REGNUM. We also can not set BADVADDR, CAUSE, or FCRIR via
- ptrace(). */
+ MIPS_ZERO_REGNUM. We also can not set BADVADDR, CAUSE, or FCRIR
+ via ptrace(). */
int
mips_linux_cannot_fetch_register (int regno)
{
- if (regno > ZERO_REGNUM && regno < ZERO_REGNUM + 32)
+ if (regno > MIPS_ZERO_REGNUM && regno < MIPS_ZERO_REGNUM + 32)
return 0;
else if (regno >= mips_regnum (current_gdbarch)->fp0
&& regno <= mips_regnum (current_gdbarch)->fp0 + 32)
int
mips_linux_cannot_store_register (int regno)
{
- if (regno > ZERO_REGNUM && regno < ZERO_REGNUM + 32)
+ if (regno > MIPS_ZERO_REGNUM && regno < MIPS_ZERO_REGNUM + 32)
return 0;
else if (regno >= FP0_REGNUM && regno <= FP0_REGNUM + 32)
return 0;
CORE_ADDR jb_addr;
char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
- jb_addr = read_register (A0_REGNUM);
+ jb_addr = read_register (MIPS_A0_REGNUM);
if (target_read_memory (jb_addr
+ MIPS_LINUX_JB_PC * MIPS_LINUX_JB_ELEMENT_SIZE,
(char *)(regp + EF_CP0_CAUSE));
/* Fill inaccessible registers with zero. */
- regcache_raw_supply (current_regcache, UNUSED_REGNUM, zerobuf);
+ regcache_raw_supply (current_regcache, MIPS_UNUSED_REGNUM, zerobuf);
for (regi = FIRST_EMBED_REGNUM; regi < LAST_EMBED_REGNUM; regi++)
regcache_raw_supply (current_regcache, regi, zerobuf);
}
void *buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
int element_size = TARGET_PTR_BIT == 32 ? 4 : 8;
- jb_addr = read_register (A0_REGNUM);
+ jb_addr = read_register (MIPS_A0_REGNUM);
if (target_read_memory (jb_addr + MIPS64_LINUX_JB_PC * element_size,
buf, TARGET_PTR_BIT / TARGET_CHAR_BIT))
(char *)(regp + MIPS64_EF_CP0_CAUSE));
/* Fill inaccessible registers with zero. */
- regcache_raw_supply (current_regcache, UNUSED_REGNUM, zerobuf);
+ regcache_raw_supply (current_regcache, MIPS_UNUSED_REGNUM, zerobuf);
for (regi = FIRST_EMBED_REGNUM; regi < LAST_EMBED_REGNUM; regi++)
regcache_raw_supply (current_regcache, regi, zerobuf);
}
fprintf_unfiltered (file,
"mips_dump_tdep: TRACE_SET # %s\n",
XSTRING (TRACE_SET (X, STATE)));
-#endif
-#ifdef UNUSED_REGNUM
- fprintf_unfiltered (file,
- "mips_dump_tdep: UNUSED_REGNUM = %d\n", UNUSED_REGNUM);
#endif
fprintf_unfiltered (file,
"mips_dump_tdep: VM_MIN_ADDRESS = %ld\n",
};
extern const struct mips_regnum *mips_regnum (struct gdbarch *gdbarch);
+/* 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. */
+
enum
{
- MIPS_ZERO_REGNUM = 0,
+ MIPS_ZERO_REGNUM = 0, /* Read-only register, always 0. */
MIPS_AT_REGNUM = 1,
- MIPS_V0_REGNUM = 2,
- MIPS_A0_REGNUM = 4,
- MIPS_T9_REGNUM = 25,
+ 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. */
MIPS_SP_REGNUM = 29,
MIPS_RA_REGNUM = 31,
MIPS_EMBED_LO_REGNUM = 33,
MIPS_EMBED_BADVADDR_REGNUM = 35,
MIPS_EMBED_CAUSE_REGNUM = 36,
MIPS_EMBED_PC_REGNUM = 37,
- MIPS_EMBED_FP0_REGNUM = 38
+ MIPS_EMBED_FP0_REGNUM = 38,
+ MIPS_UNUSED_REGNUM = 73 /* Never used, FIXME */
};
/* Defined in mips-tdep.c and used in remote-mips.c */
mips_regnum (current_gdbarch)->badvaddr,
zerobuf);
regcache_raw_supply (current_regcache, DEPRECATED_FP_REGNUM, zerobuf);
- regcache_raw_supply (current_regcache, UNUSED_REGNUM, zerobuf);
+ regcache_raw_supply (current_regcache, MIPS_UNUSED_REGNUM, zerobuf);
for (regi = FIRST_EMBED_REGNUM; regi <= LAST_EMBED_REGNUM; regi++)
regcache_raw_supply (current_regcache, regi, zerobuf);
}
CORE_ADDR jb_addr;
buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
- jb_addr = read_register (A0_REGNUM);
+ jb_addr = read_register (MIPS_A0_REGNUM);
if (target_read_memory (jb_addr + _JB_PC * JB_ELEMENT_SIZE, buf,
TARGET_PTR_BIT / TARGET_CHAR_BIT))
return;
}
- if (regno == DEPRECATED_FP_REGNUM || regno == ZERO_REGNUM)
+ if (regno == DEPRECATED_FP_REGNUM || regno == MIPS_ZERO_REGNUM)
/* DEPRECATED_FP_REGNUM on the mips is a hack which is just
supposed to read zero (see also mips-nat.c). */
val = 0;