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