diff options
author | Markus Deuling <deuling@de.ibm.com> | 2008-03-11 05:21:38 +0000 |
---|---|---|
committer | Markus Deuling <deuling@de.ibm.com> | 2008-03-11 05:21:38 +0000 |
commit | 20a6ec495b38548cc88165e7c18203d6d387d55d (patch) | |
tree | b7cd82da0005270ffc124fc9a86df24e57a96f1c /gdb/i387-tdep.h | |
parent | dd2c76da5595b0a7c60acc52328955e0b847fcaf (diff) | |
download | gdb-20a6ec495b38548cc88165e7c18203d6d387d55d.zip gdb-20a6ec495b38548cc88165e7c18203d6d387d55d.tar.gz gdb-20a6ec495b38548cc88165e7c18203d6d387d55d.tar.bz2 |
* win32-nat.c (do_win32_fetch_inferior_registers): Use get_regcache_arch
to get at the current architecture and at the target specific vector.
Add target specific vector to I387_FISEG_REGNUM and I387_FOP_REGNUM and
remove define of I387_ST0_REGNUM.
* amd64-tdep.c (I387_ST0_REGNUM): Remove define.
(amd64_supply_fxsave, amd64_collect_fxsave): Use get_regcache_arch to
get at the current architecture
(I387_FISEG_REGNUM, I387_FOSEG_REGNUM): Add target specific vector as
parameter.
* i386-tdep.c: Remove various define's and undef's of I387_ST0_REGNUM,
I387_NUM_XMM_REGS and I387_MM0_REGNUM.
(I387_NUM_XMM_REGS, I387_XMM0_REGNUM, I387_MXCSR_REGNUM,
I387_ST0_REGNUM, I387_FCTRL_REGNUM, I387_MM0_REGNUM,
(I387_FSTAT_REGNUM): Add target specific vector as parameter.
(i386_register_name, i386_dbx_reg_to_regnum): Use gdbarch_tdep to get
at the target specific vector.
(i386_get_longjmp_target): Use get_frame_arch to get at the current
architecture. Use gdbarch_tdep to get at the target specific vector.
(i386_fp_regnum_p, i386_fpc_regnum_p): Add gdbarch as parameter and
update caller. Use gdbarch_tdep to get at the target specific vector.
(i386_register_to_value: Use get_frame_arch to get at the current
architecture.
* i386-tdep.h (i386_fp_regnum_p, i386_fpc_regnum_p): Add gdbarch as
parameter.
* i387-tdep.c (I387_FCTRL_REGNUM, I387_FSTAT_REGNUM, I387_FTAG_REGNUM,
I387_FISEG_REGNUM, I387_FIOFF_REGNUM, I387_FOSEG_REGNUM
I387_FOOFF_REGNUM, I387_FOP_REGNUM, I387_ST0_REGNUM, FSAVE_ADDR,
FXSAVE_ADDR, I387_XMM0_REGNUM): Add target specific vector as parameter.
(I387_ST0_REGNUM, I387_NUM_XMM_REGS): Remove various define's and
undef's.
(i387_convert_register_p, i387_register_to_value,
i387_value_to_register): Update call for i386_fp_regnum_p.
* i387-tdep.h: Remove comment.
(I387_ST0_REGNUM, I387_NUM_XMM_REGS, I387_MM0_REGNUM): Add define.
(I387_FCTRL_REGNUM, I387_FSTAT_REGNUM, I387_FTAG_REGNUM,
I387_FISEG_REGNUM, I387_FIOFF_REGNUM, I387_FOSEG_REGNUM,
I387_FOOFF_REGNUM, I387_FOP_REGNUM, I387_XMM0_REGNUM,
I387_MXCSR_REGNUM): Add target specific vector as parameter.
Diffstat (limited to 'gdb/i387-tdep.h')
-rw-r--r-- | gdb/i387-tdep.h | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/gdb/i387-tdep.h b/gdb/i387-tdep.h index 45d829f..7ac2416 100644 --- a/gdb/i387-tdep.h +++ b/gdb/i387-tdep.h @@ -27,26 +27,21 @@ struct regcache; struct type; struct ui_file; -/* Because the number of general-purpose registers is different for - AMD64, the floating-point registers and SSE registers get shifted. - The following definitions are intended to help writing code that - needs the register numbers of floating-point registers and SSE - registers. In order to use these, one should provide a definition - for I387_ST0_REGNUM, and possibly I387_NUM_XMM_REGS, preferably by - using a local "#define" in the body of the function that uses this. - Please "#undef" them before the end of the function. */ - -#define I387_FCTRL_REGNUM (I387_ST0_REGNUM + 8) -#define I387_FSTAT_REGNUM (I387_FCTRL_REGNUM + 1) -#define I387_FTAG_REGNUM (I387_FCTRL_REGNUM + 2) -#define I387_FISEG_REGNUM (I387_FCTRL_REGNUM + 3) -#define I387_FIOFF_REGNUM (I387_FCTRL_REGNUM + 4) -#define I387_FOSEG_REGNUM (I387_FCTRL_REGNUM + 5) -#define I387_FOOFF_REGNUM (I387_FCTRL_REGNUM + 6) -#define I387_FOP_REGNUM (I387_FCTRL_REGNUM + 7) -#define I387_XMM0_REGNUM (I387_ST0_REGNUM + 16) -#define I387_MXCSR_REGNUM (I387_XMM0_REGNUM + I387_NUM_XMM_REGS) - +#define I387_ST0_REGNUM(tdep) ((tdep)->st0_regnum) +#define I387_NUM_XMM_REGS(tdep) ((tdep)->num_xmm_regs) +#define I387_MM0_REGNUM(tdep) ((tdep)->mm0_regnum) + +#define I387_FCTRL_REGNUM(tdep) (I387_ST0_REGNUM (tdep) + 8) +#define I387_FSTAT_REGNUM(tdep) (I387_FCTRL_REGNUM (tdep) + 1) +#define I387_FTAG_REGNUM(tdep) (I387_FCTRL_REGNUM (tdep) + 2) +#define I387_FISEG_REGNUM(tdep) (I387_FCTRL_REGNUM (tdep) + 3) +#define I387_FIOFF_REGNUM(tdep) (I387_FCTRL_REGNUM (tdep) + 4) +#define I387_FOSEG_REGNUM(tdep) (I387_FCTRL_REGNUM (tdep) + 5) +#define I387_FOOFF_REGNUM(tdep) (I387_FCTRL_REGNUM (tdep) + 6) +#define I387_FOP_REGNUM(tdep) (I387_FCTRL_REGNUM (tdep) + 7) +#define I387_XMM0_REGNUM(tdep) (I387_ST0_REGNUM (tdep) + 16) +#define I387_MXCSR_REGNUM(tdep) \ + (I387_XMM0_REGNUM (tdep) + I387_NUM_XMM_REGS (tdep)) /* Print out the i387 floating point state. */ |