This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Rename mmx_regnum_to_fp_regnum
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 19 Apr 2003 16:30:38 +0200 (CEST)
- Subject: [PATCH] Rename mmx_regnum_to_fp_regnum
Only cosmetic, but makes things a bit more consistent.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis at gnu dot org>
* i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Renamed from
mmx_regnum_to_fp_regnum. Adjust all callers.
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.134
diff -u -p -r1.134 i386-tdep.c
--- i386-tdep.c 19 Apr 2003 14:26:15 -0000 1.134
+++ i386-tdep.c 19 Apr 2003 14:29:10 -0000
@@ -1141,19 +1141,21 @@ i386_register_type (struct gdbarch *gdba
}
/* Map a cooked register onto a raw register or memory. For the i386,
- the MMX registers need to be mapped onto floating point registers. */
+ the MMX registers need to be mapped onto floating-point registers. */
static int
-mmx_regnum_to_fp_regnum (struct regcache *regcache, int regnum)
+i386_mmx_regnum_to_fp_regnum (struct regcache *regcache, int regnum)
{
int mmxi;
ULONGEST fstat;
int tos;
int fpi;
+
mmxi = regnum - MM0_REGNUM;
regcache_raw_read_unsigned (regcache, FSTAT_REGNUM, &fstat);
tos = (fstat >> 11) & 0x7;
fpi = (mmxi + tos) % 8;
+
return (FP0_REGNUM + fpi);
}
@@ -1164,9 +1166,10 @@ i386_pseudo_register_read (struct gdbarc
if (i386_mmx_regnum_p (regnum))
{
char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE);
- int fpnum = mmx_regnum_to_fp_regnum (regcache, regnum);
- regcache_raw_read (regcache, fpnum, mmx_buf);
+ int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum);
+
/* Extract (always little endian). */
+ regcache_raw_read (regcache, fpnum, mmx_buf);
memcpy (buf, mmx_buf, REGISTER_RAW_SIZE (regnum));
}
else
@@ -1180,7 +1183,8 @@ i386_pseudo_register_write (struct gdbar
if (i386_mmx_regnum_p (regnum))
{
char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE);
- int fpnum = mmx_regnum_to_fp_regnum (regcache, regnum);
+ int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum);
+
/* Read ... */
regcache_raw_read (regcache, fpnum, mmx_buf);
/* ... Modify ... (always little endian). */