/* * This header is culled from various kernel headers for x86_64. * Glibc and the kernel don't agree on the layout for ucontext_t. */ #ifndef X86_64_UCONTEXT_H #define X86_64_UCONTEXT_H typedef unsigned long my_sigset_t; typedef struct my_sigaltstack { void *ss_sp; int ss_flags; size_t ss_size; } my_stack_t; typedef unsigned short my___u16; typedef unsigned int my___u32; typedef unsigned long long my___u64; struct my__fpstate { my___u16 cwd; my___u16 swd; my___u16 twd; /* Note this is not the same as the 32bit/x87/FSAVE twd */ my___u16 fop; my___u64 rip; my___u64 rdp; my___u32 mxcsr; my___u32 mxcsr_mask; my___u32 st_space[32]; /* 8*16 bytes for each FP-reg */ my___u32 xmm_space[64]; /* 16*16 bytes for each XMM-reg */ my___u32 reserved2[24]; }; struct my_sigcontext { unsigned long r8; unsigned long r9; unsigned long r10; unsigned long r11; unsigned long r12; unsigned long r13; unsigned long r14; unsigned long r15; unsigned long rdi; unsigned long rsi; unsigned long rbp; unsigned long rbx; unsigned long rdx; unsigned long rax; unsigned long rcx; unsigned long rsp; unsigned long rip; unsigned long eflags; /* RFLAGS */ unsigned short cs; unsigned short gs; unsigned short fs; unsigned short __pad0; unsigned long err; unsigned long trapno; unsigned long oldmask; unsigned long cr2; struct my__fpstate *fpstate; /* zero when no FPU context */ unsigned long reserved1[8]; }; struct my_ucontext; struct my_ucontext { unsigned long uc_flags; struct my_ucontext *uc_link; my_stack_t uc_stack; struct my_sigcontext uc_mcontext; my_sigset_t uc_sigmask; /* mask last for extensibility */ }; typedef struct my_ucontext my_ucontext_t; #define ucontext_t my_ucontext_t #endif /* X86_64_UCONTEXT_H */