/* struct sigcontext is laid out so that starting at sc_gs mimics a
struct i386_thread_state. */
+ _Static_assert (offsetof (struct sigcontext, sc_i386_thread_state)
+ % __alignof__ (struct i386_thread_state) == 0,
+ "sc_i386_thread_state layout mismatch");
memcpy (&scp->sc_i386_thread_state,
&state->basic, sizeof (state->basic));
/* struct sigcontext is laid out so that starting at sc_fpkind mimics
a struct i386_float_state. */
+ _Static_assert (offsetof (struct sigcontext, sc_i386_float_state)
+ % __alignof__ (struct i386_float_state) == 0,
+ "sc_i386_float_state layout mismatch");
ok = machine_get_state (ss->thread, state, i386_FLOAT_STATE,
&state->fpu, &scp->sc_i386_float_state,
sizeof (state->fpu));
/* Error code associated with this signal (interpreted as `error_t'). */
int sc_error;
+ /* Make sure the below members are properly aligned, and not packed
+ together with sc_error -- otherwise the layout won't match that of
+ i386_thread_state. */
+ int sc_pad1;
+
/* All following members are machine-dependent. The rest of this
structure is written to be laid out identically to:
{
long sc_ursp; /* This stack pointer is used. */
int sc_ss; /* Stack segment register. */
+ /* Make sure the below has the same layout as i386_float_state. */
+ int sc_pad2;
+
/* Following mimics struct i386_float_state. Structures and symbolic
values can be found in <mach/i386/fp_reg.h>. */
#define sc_i386_float_state sc_fpkind