diff options
author | Mark Kettenis <kettenis@gnu.org> | 2003-09-27 21:57:56 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2003-09-27 21:57:56 +0000 |
commit | 5716833cf88e806df832f6185960991cc15772a6 (patch) | |
tree | 76a8d2b5f9e0bb9e08bc0013db719ad211a8c34d /gdb/i387-tdep.h | |
parent | 41d35cb0fe5aff6050e3dce2506a51876d10d26a (diff) | |
download | gdb-5716833cf88e806df832f6185960991cc15772a6.zip gdb-5716833cf88e806df832f6185960991cc15772a6.tar.gz gdb-5716833cf88e806df832f6185960991cc15772a6.tar.bz2 |
* i386-tdep.h: Put opaque declarations in alphabetical
order. Remove spurious whitespace.
(struct gdbarch_tdep): add st0_regnum and mm0_regnum members.
(i386_sse_regnum_p, i386_mxcsr_regnum_p): Remove prototypes.
* i386-tdep.c (MM0_REGNUM): Remove define.
(i386_mmx_regnum_p): Add gdbarch argument.
(i386_sse_regnum_p, i386_mxcsr_regnum_p): Add gdbarch argument.
Rewrite using new macro definitions for FPU/SSE registers.
(i386_fp_regnum_p, i386_fpc_regnum_p): Rewrite using new macro
definitions from i387-tdep.h.
(i386_register_name): Update.
(i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum): Update to use
new macro definitions for FPU/SSE registers.
(i386_extract_return_value): Determine whether floating-point
registers are present by examining REGCACHE's architecture.
(i386_store_return_value): Likewise. Use I386_MAX_REGISTER_SIZE
instead of FPU_REG_RAW_SIZE. Use new macro definitions for
FPU/SSE registers.
(i386_register_type): Update.
(i386_mmx_regnum_to_fp_regnum): Rewrite using new macro
definitions for FPU registers. Use REGCACHE's architecture to
determine the appropriate register numbers.
(i386_pseudo_register_read, i386_pseudo_register_write,
i386_register_reggroup_p): Update.
(i386_gdbarch_init): Initialize TDEP->st0_regnum and
TDEP->mm0_regnum.
* i387-tdep.h (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): New defines.
(i387_supply_fsave, i387_fill_fsave, i387_supply_fxsave,
i387_fill_fxsave): Change type of fsave/fxsave argument from `char
*' to `void *'.
* i387-tdep.c (i387_print_float_info, fsave_offset, FSAVE_ADDR,
i387_supply_fsave, i387_fill_fsave, fxsave_offset, FXSAVE_ADDR,
i387_supply_fxsave, i387_fill_fxsave): Update to use new macro
definitions for FPU/SSE registers.
(FXSAVE_MXCSR_ADDR): New define.
* x86-64-tdep.c (x86_64_init_abi): Override TDEP->st0_regnum and
TDEP->mm0_regnum.
(I387_FISEG_REGNUM, I387_FOSEG_REGNUM): Remove defines.
(I387_ST0_REGNUM): Define.
Diffstat (limited to 'gdb/i387-tdep.h')
-rw-r--r-- | gdb/i387-tdep.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/gdb/i387-tdep.h b/gdb/i387-tdep.h index 654b4a5..41e695b 100644 --- a/gdb/i387-tdep.h +++ b/gdb/i387-tdep.h @@ -27,6 +27,27 @@ struct ui_file; struct frame_info; struct type; +/* 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) + + /* Print out the i387 floating point state. */ extern void i387_print_float_info (struct gdbarch *gdbarch, @@ -56,26 +77,26 @@ extern void i387_value_to_register (struct frame_info *frame, int regnum, value from *FSAVE. This function masks off any of the reserved bits in *FSAVE. */ -extern void i387_supply_fsave (const char *fsave, int regnum); +extern void i387_supply_fsave (const void *fsave, int regnum); /* Fill register REGNUM (if it is a floating-point register) in *FSAVE with the value in GDB's register cache. If REGNUM is -1, do this for all registers. This function doesn't touch any of the reserved bits in *FSAVE. */ -extern void i387_fill_fsave (char *fsave, int regnum); +extern void i387_fill_fsave (void *fsave, int regnum); /* Fill register REGNUM in GDB's register cache with the appropriate floating-point or SSE register value from *FXSAVE. This function masks off any of the reserved bits in *FXSAVE. */ -extern void i387_supply_fxsave (const char *fxsave, int regnum); +extern void i387_supply_fxsave (const void *fxsave, int regnum); /* Fill register REGNUM (if it is a floating-point or SSE register) in *FXSAVE with the value in GDB's register cache. If REGNUM is -1, do this for all registers. This function doesn't touch any of the reserved bits in *FXSAVE. */ -extern void i387_fill_fxsave (char *fxsave, int regnum); +extern void i387_fill_fxsave (void *fxsave, int regnum); #endif /* i387-tdep.h */ |