]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/x86/include/asm/sigframe.h
UBUNTU: Ubuntu-4.13.0-45.50
[mirror_ubuntu-artful-kernel.git] / arch / x86 / include / asm / sigframe.h
CommitLineData
5c2628e8
HS
1#ifndef _ASM_X86_SIGFRAME_H
2#define _ASM_X86_SIGFRAME_H
3
decb4c41 4#include <uapi/asm/sigcontext.h>
b2fa739c
HS
5#include <asm/siginfo.h>
6#include <asm/ucontext.h>
b829d1be 7#include <linux/compat.h>
b2fa739c 8
123a6347 9#ifdef CONFIG_X86_32
a5c56eb3
HS
10#define sigframe_ia32 sigframe
11#define rt_sigframe_ia32 rt_sigframe
a5c56eb3 12#define ucontext_ia32 ucontext
c85c2ff8
HS
13#else /* !CONFIG_X86_32 */
14
15#ifdef CONFIG_IA32_EMULATION
16#include <asm/ia32.h>
17#endif /* CONFIG_IA32_EMULATION */
18
19#endif /* CONFIG_X86_32 */
a5c56eb3 20
c85c2ff8 21#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
a5c56eb3
HS
22struct sigframe_ia32 {
23 u32 pretcode;
1da177e4 24 int sig;
8fcb346b 25 struct sigcontext_32 sc;
3c1c7f10
SS
26 /*
27 * fpstate is unused. fpstate is moved/allocated after
28 * retcode[] below. This movement allows to have the FP state and the
29 * future state extensions (xsave) stay together.
30 * And at the same time retaining the unused fpstate, prevents changing
31 * the offset of extramask[] in the sigframe and thus prevent any
32 * legacy application accessing/modifying it.
33 */
86e9fc3a 34 struct _fpstate_32 fpstate_unused;
c85c2ff8
HS
35#ifdef CONFIG_IA32_EMULATION
36 unsigned int extramask[_COMPAT_NSIG_WORDS-1];
37#else /* !CONFIG_IA32_EMULATION */
1da177e4 38 unsigned long extramask[_NSIG_WORDS-1];
c85c2ff8 39#endif /* CONFIG_IA32_EMULATION */
1da177e4 40 char retcode[8];
3c1c7f10 41 /* fp state follows here */
1da177e4
LT
42};
43
a5c56eb3
HS
44struct rt_sigframe_ia32 {
45 u32 pretcode;
1da177e4 46 int sig;
a5c56eb3
HS
47 u32 pinfo;
48 u32 puc;
c85c2ff8
HS
49#ifdef CONFIG_IA32_EMULATION
50 compat_siginfo_t info;
51#else /* !CONFIG_IA32_EMULATION */
1da177e4 52 struct siginfo info;
c85c2ff8 53#endif /* CONFIG_IA32_EMULATION */
a5c56eb3 54 struct ucontext_ia32 uc;
1da177e4 55 char retcode[8];
3c1c7f10 56 /* fp state follows here */
1da177e4 57};
c85c2ff8
HS
58#endif /* defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION) */
59
60#ifdef CONFIG_X86_64
9d389763 61
123a6347
HH
62struct rt_sigframe {
63 char __user *pretcode;
64 struct ucontext uc;
65 struct siginfo info;
3c1c7f10 66 /* fp state follows here */
123a6347 67};
9d389763
PA
68
69#ifdef CONFIG_X86_X32_ABI
70
b829d1be
BG
71struct ucontext_x32 {
72 unsigned int uc_flags;
73 unsigned int uc_link;
74 compat_stack_t uc_stack;
75 unsigned int uc__pad0; /* needed for alignment */
76 struct sigcontext uc_mcontext; /* the 64-bit sigcontext type */
77 compat_sigset_t uc_sigmask; /* mask last for extensibility */
78};
79
9d389763
PA
80struct rt_sigframe_x32 {
81 u64 pretcode;
82 struct ucontext_x32 uc;
83 compat_siginfo_t info;
84 /* fp state follows here */
85};
86
87#endif /* CONFIG_X86_X32_ABI */
88
c85c2ff8 89#endif /* CONFIG_X86_64 */
5c2628e8
HS
90
91#endif /* _ASM_X86_SIGFRAME_H */