These are useless on x86_64, and __NGREG was actually wrong with them.
/* Registers. */
#ifdef __x86_64__
- memcpy (&uc->uc_mcontext.gregs[REG_GSFS], &sc->sc_gs,
- (REG_ERR - REG_GSFS) * sizeof (long));
+ memcpy (&uc->uc_mcontext.gregs[REG_R8], &sc->sc_r8,
+ (REG_ERR - REG_R8) * sizeof (long));
#else
memcpy (&uc->uc_mcontext.gregs[REG_GS], &sc->sc_gs,
(REG_TRAPNO - REG_GS) * sizeof (int));
}
trampoline.c knows this, so it must be changed if this changes. */
-#define sc_i386_thread_state sc_gs /* Beginning of correspondence. */
- /* Segment registers. */
- int sc_gs;
- int sc_fs;
- int sc_es;
- int sc_ds;
-
+#define sc_i386_thread_state sc_r8 /* Beginning of correspondence. */
long sc_r8;
long sc_r9;
long sc_r10;
#define PC rip
#define SP ursp
#define SYSRETURN rax
+#define MACHINE_THREAD_STATE_FIX_NEW(ts) do { \
+ asm ("mov %%cs, %w0" : "=q" ((ts)->cs)); \
+} while(0)
#else
#define PC eip
#define SP uesp
#define SYSRETURN eax
-#endif
-
#define MACHINE_THREAD_STATE_FIX_NEW(ts) do { \
asm ("mov %%cs, %w0" : "=q" ((ts)->cs)); \
asm ("mov %%ds, %w0" : "=q" ((ts)->ds)); \
asm ("mov %%fs, %w0" : "=q" ((ts)->fs)); \
asm ("mov %%gs, %w0" : "=q" ((ts)->gs)); \
} while(0)
+#endif
struct machine_thread_all_state
{
/* Number of each register in the `gregset_t' array. */
enum
{
- REG_GSFS = 0, /* Actually int gs, fs. */
-# define REG_GSFS REG_GSFS
- REG_ESDS, /* Actually int es, ds. */
-# define REG_ESDS REG_ESDS
- REG_R8,
+ REG_R8 = 0,
# define REG_R8 REG_R8
REG_R9,
# define REG_R9 REG_R9