x86: signal: prepare to include from ia32_signal.c
[cascardo/linux.git] / arch / x86 / include / asm / sigframe.h
1 #ifdef CONFIG_X86_32
2 #define sigframe_ia32           sigframe
3 #define rt_sigframe_ia32        rt_sigframe
4 #define sigcontext_ia32         sigcontext
5 #define _fpstate_ia32           _fpstate
6 #define ucontext_ia32           ucontext
7 #else /* !CONFIG_X86_32 */
8
9 #ifdef CONFIG_IA32_EMULATION
10 #include <asm/ia32.h>
11 #endif /* CONFIG_IA32_EMULATION */
12
13 #endif /* CONFIG_X86_32 */
14
15 #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
16 struct sigframe_ia32 {
17         u32 pretcode;
18         int sig;
19         struct sigcontext_ia32 sc;
20         /*
21          * fpstate is unused. fpstate is moved/allocated after
22          * retcode[] below. This movement allows to have the FP state and the
23          * future state extensions (xsave) stay together.
24          * And at the same time retaining the unused fpstate, prevents changing
25          * the offset of extramask[] in the sigframe and thus prevent any
26          * legacy application accessing/modifying it.
27          */
28         struct _fpstate_ia32 fpstate_unused;
29 #ifdef CONFIG_IA32_EMULATION
30         unsigned int extramask[_COMPAT_NSIG_WORDS-1];
31 #else /* !CONFIG_IA32_EMULATION */
32         unsigned long extramask[_NSIG_WORDS-1];
33 #endif /* CONFIG_IA32_EMULATION */
34         char retcode[8];
35         /* fp state follows here */
36 };
37
38 struct rt_sigframe_ia32 {
39         u32 pretcode;
40         int sig;
41         u32 pinfo;
42         u32 puc;
43 #ifdef CONFIG_IA32_EMULATION
44         compat_siginfo_t info;
45 #else /* !CONFIG_IA32_EMULATION */
46         struct siginfo info;
47 #endif /* CONFIG_IA32_EMULATION */
48         struct ucontext_ia32 uc;
49         char retcode[8];
50         /* fp state follows here */
51 };
52 #endif /* defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION) */
53
54 #ifdef CONFIG_X86_64
55 struct rt_sigframe {
56         char __user *pretcode;
57         struct ucontext uc;
58         struct siginfo info;
59         /* fp state follows here */
60 };
61 #endif /* CONFIG_X86_64 */