diff options
Diffstat (limited to 'winsup/cygwin/include/cygwin/signal.h')
-rw-r--r-- | winsup/cygwin/include/cygwin/signal.h | 176 |
1 files changed, 139 insertions, 37 deletions
diff --git a/winsup/cygwin/include/cygwin/signal.h b/winsup/cygwin/include/cygwin/signal.h index 268b5eb74..3d74c9c8d 100644 --- a/winsup/cygwin/include/cygwin/signal.h +++ b/winsup/cygwin/include/cygwin/signal.h @@ -12,53 +12,144 @@ #ifndef _CYGWIN_SIGNAL_H #define _CYGWIN_SIGNAL_H +#include <bits/wordsize.h> + #ifdef __cplusplus extern "C" { #endif + +#ifdef __x86_64__ + +struct _uc_fpxreg { + __uint16_t significand[4]; + __uint16_t exponent; + __uint16_t padding[3]; +}; + +struct _uc_xmmreg { + __uint32_t element[4]; +}; + struct _fpstate { - unsigned long cw; - unsigned long sw; - unsigned long tag; - unsigned long ipoff; - unsigned long cssel; - unsigned long dataoff; - unsigned long datasel; - unsigned char _st[80]; - unsigned long nxst; + __uint16_t cwd; + __uint16_t swd; + __uint16_t ftw; + __uint16_t fop; + __uint64_t rip; + __uint64_t rdp; + __uint32_t mxcsr; + __uint32_t mxcr_mask; + struct _uc_fpxreg st[8]; + struct _uc_xmmreg xmm[16]; + __uint32_t padding[24]; }; struct ucontext { - unsigned long cr2; - unsigned long dr0; - unsigned long dr1; - unsigned long dr2; - unsigned long dr3; - unsigned long dr6; - unsigned long dr7; + __uint64_t p1home; + __uint64_t p2home; + __uint64_t p3home; + __uint64_t p4home; + __uint64_t p5home; + __uint64_t p6home; + __uint32_t cr2; + __uint32_t mxcsr; + __uint16_t cs; + __uint16_t ds; + __uint16_t es; + __uint16_t fs; + __uint16_t gs; + __uint16_t ss; + __uint32_t eflags; + __uint64_t dr0; + __uint64_t dr1; + __uint64_t dr2; + __uint64_t dr3; + __uint64_t dr6; + __uint64_t dr7; + __uint64_t rax; + __uint64_t rcx; + __uint64_t rdx; + __uint64_t rbx; + __uint64_t rsp; + __uint64_t rbp; + __uint64_t rsi; + __uint64_t rdi; + __uint64_t r8; + __uint64_t r9; + __uint64_t r10; + __uint64_t r11; + __uint64_t r12; + __uint64_t r13; + __uint64_t r14; + __uint64_t r15; + __uint64_t rip; + struct _fpstate fpregs; + __uint64_t vcx; + __uint64_t dbc; + __uint64_t btr; + __uint64_t bfr; + __uint64_t etr; + __uint64_t efr; + __uint8_t _internal; + __uint64_t oldmask; +}; + +#else /* !x86_64 */ + +struct _uc_fpreg +{ + __uint16_t significand[4]; + __uint16_t exponent; +}; + +struct _fpstate +{ + __uint32_t cw; + __uint32_t sw; + __uint32_t tag; + __uint32_t ipoff; + __uint32_t cssel; + __uint32_t dataoff; + __uint32_t datasel; + struct _uc_fpreg _st[8]; + __uint32_t nxst; +}; + +struct ucontext +{ + __uint32_t cr2; + __uint32_t dr0; + __uint32_t dr1; + __uint32_t dr2; + __uint32_t dr3; + __uint32_t dr6; + __uint32_t dr7; struct _fpstate fpstate; - unsigned long gs; - unsigned long fs; - unsigned long es; - unsigned long ds; - unsigned long edi; - unsigned long esi; - unsigned long ebx; - unsigned long edx; - unsigned long ecx; - unsigned long eax; - unsigned long ebp; - unsigned long eip; - unsigned long cs; - unsigned long eflags; - unsigned long esp; - unsigned long ss; - unsigned char _internal; - unsigned long oldmask; + __uint32_t gs; + __uint32_t fs; + __uint32_t es; + __uint32_t ds; + __uint32_t edi; + __uint32_t esi; + __uint32_t ebx; + __uint32_t edx; + __uint32_t ecx; + __uint32_t eax; + __uint32_t ebp; + __uint32_t eip; + __uint32_t cs; + __uint32_t eflags; + __uint32_t esp; + __uint32_t ss; + __uint8_t _internal; + __uint32_t oldmask; }; -#define __COPY_CONTEXT_SIZE ((unsigned) &((struct ucontext *) 0)->_internal) +#endif /* !x86_64 */ + +#define __COPY_CONTEXT_SIZE ((size_t) (uintptr_t) &((struct ucontext *) 0)->_internal) typedef union sigval { @@ -208,7 +299,13 @@ enum perform notification */ }; +#if __WORDSIZE == 64 +typedef __uint64_t sigset_t; +#else +/* FIXME: We should probably raise the # of signals for 32 bit as well. + Unfortunately this is an ABI change so requires some forethought. */ typedef __uint32_t sigset_t; +#endif typedef void (*_sig_func_ptr)(int); @@ -274,10 +371,15 @@ struct sigaction #define SIGUSR1 30 /* user defined signal 1 */ #define SIGUSR2 31 /* user defined signal 2 */ +#if __WORDSIZE == 64 +#define NSIG 65 /* signal 0 implied */ +#else +#define NSIG 33 /* signal 0 implied */ +#endif + /* Real-Time signals per SUSv3. RT_SIGMAX is defined as 8 in limits.h */ #define SIGRTMIN 32 -#define SIGRTMAX ((SIGRTMIN) + 0) -#define NSIG 33 /* signal 0 implied */ +#define SIGRTMAX (NSIG - 1) #define SIG_HOLD ((_sig_func_ptr)2) /* Signal in signal mask */ |