|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+typedef int greg_t, gregset_t[18];
typedef struct sigcontext
{
unsigned long trap_no, error_code, oldmask;
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-struct _fpstate {
+typedef int greg_t, gregset_t[19];
+typedef struct _fpstate {
unsigned long cw, sw, tag, ipoff, cssel, dataoff, datasel;
struct {
unsigned short significand[4], exponent;
} _st[8];
unsigned long status;
-};
+} *fpregset_t;
struct sigcontext {
unsigned short gs, __gsh, fs, __fsh, es, __esh, ds, __dsh;
unsigned long edi, esi, ebp, esp, ebx, edx, ecx, eax;
unsigned long oldmask, cr2;
};
typedef struct {
- unsigned gregs[19];
- struct _fpstate *fpregs;
+ gregset_t gregs;
+ fpregset_t fpregs;
unsigned long oldmask, cr2;
} mcontext_t;
#else
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+typedef unsigned long greg_t, gregset_t[38];
typedef struct sigcontext
{
struct {
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-typedef struct sigcontext
+typedef unsigned long long greg_t, gregset_t[32];
+typedef struct {
+ union {
+ double fp_dregs[32];
+ struct {
+ float _fp_fregs;
+ unsigned _fp_pad;
+ } fp_fregs[32];
+ } fp_r;
+} fpregset_t;
+struct sigcontext
{
unsigned sc_regmask, sc_status;
unsigned long long sc_pc, sc_regs[32], sc_fpregs[32];
unsigned sc_ownedfp, sc_fpc_csr, sc_fpc_eir, sc_used_math, sc_dsp;
unsigned long long sc_mdhi, sc_mdlo;
unsigned long sc_hi1, sc_lo1, sc_hi2, sc_lo2, sc_hi3, sc_lo3;
+};
+typedef struct
+{
+ unsigned regmask, status;
+ unsigned long long pc, regs[32], fpregs[32];
+ unsigned ownedfp, fpc_csr, fpc_eir, used_math, dsp;
+ unsigned long long mdhi, mdlo;
+ unsigned long hi1, lo1, hi2, lo2, hi3, lo3;
} mcontext_t;
#else
typedef struct {
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-typedef unsigned long gregset_t[48];
+typedef unsigned long greg_t, gregset_t[48];
typedef struct {
double fpregs[32];
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
-struct _fpstate {
+typedef long long greg_t, gregset_t[23];
+typedef struct _fpstate {
unsigned short cwd, swd, ftw, fop;
unsigned long long rip, rdp;
unsigned mxcsr, mxcr_mask;
unsigned element[4];
} _xmm[16];
unsigned padding[24];
-};
+} *fpregset_t;
struct sigcontext {
unsigned long r8, r9, r10, r11, r12, r13, r14, r15;
unsigned long rdi, rsi, rbp, rbx, rdx, rax, rcx, rsp, rip, eflags;
unsigned long __reserved1[8];
};
typedef struct {
- unsigned long long gregs[23];
- struct _fpstate *fpregs;
+ gregset_t gregs;
+ fpregset_t fpregs;
unsigned long long __reserved1[8];
} mcontext_t;
#else
#ifdef _GNU_SOURCE
#define __siginfo siginfo
+#define __ucontext ucontext
#endif
#define __NEED_size_t
#include <signal.h>
-#ifdef _GNU_SOURCE
-#define ucontext __ucontext
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+#define NGREG (sizeof(gregset_t)/sizeof(greg_t))
#endif
struct __ucontext;