From a8da6c2f287037cbacc65578a268f355760eaf8e Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 25 Nov 2012 23:04:23 -0500 Subject: fixup mcontext stuff to expost gregset_t/fpregset_t as appropriate --- arch/arm/bits/signal.h | 1 + arch/i386/bits/signal.h | 9 +++++---- arch/microblaze/bits/signal.h | 1 + arch/mips/bits/signal.h | 20 +++++++++++++++++++- arch/powerpc/bits/signal.h | 2 +- arch/x86_64/bits/signal.h | 9 +++++---- 6 files changed, 32 insertions(+), 10 deletions(-) (limited to 'arch') diff --git a/arch/arm/bits/signal.h b/arch/arm/bits/signal.h index 190b1d63..fd36bc78 100644 --- a/arch/arm/bits/signal.h +++ b/arch/arm/bits/signal.h @@ -2,6 +2,7 @@ || 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; diff --git a/arch/i386/bits/signal.h b/arch/i386/bits/signal.h index 3caadea2..29455aec 100644 --- a/arch/i386/bits/signal.h +++ b/arch/i386/bits/signal.h @@ -2,13 +2,14 @@ || 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; @@ -20,8 +21,8 @@ struct sigcontext { 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 diff --git a/arch/microblaze/bits/signal.h b/arch/microblaze/bits/signal.h index bb60d0dd..94aafd0f 100644 --- a/arch/microblaze/bits/signal.h +++ b/arch/microblaze/bits/signal.h @@ -2,6 +2,7 @@ || 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 { diff --git a/arch/mips/bits/signal.h b/arch/mips/bits/signal.h index 9b4861d3..857d3c07 100644 --- a/arch/mips/bits/signal.h +++ b/arch/mips/bits/signal.h @@ -2,13 +2,31 @@ || 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 { diff --git a/arch/powerpc/bits/signal.h b/arch/powerpc/bits/signal.h index 7ee38fba..81012d5b 100644 --- a/arch/powerpc/bits/signal.h +++ b/arch/powerpc/bits/signal.h @@ -3,7 +3,7 @@ #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]; diff --git a/arch/x86_64/bits/signal.h b/arch/x86_64/bits/signal.h index 38f3bc42..9043aeaf 100644 --- a/arch/x86_64/bits/signal.h +++ b/arch/x86_64/bits/signal.h @@ -2,7 +2,8 @@ || 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; @@ -13,7 +14,7 @@ struct _fpstate { 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; @@ -23,8 +24,8 @@ struct sigcontext { 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 -- cgit v1.2.1