blob: 3bd0f4276000cc5f1d7184a8785d92be325f544e [file] [log] [blame]
Hiroshi Shimamoto5c2628e2008-12-18 09:18:35 -08001#ifndef _ASM_X86_SIGFRAME_H
2#define _ASM_X86_SIGFRAME_H
3
Harvey Harrison123a6342008-02-08 12:10:00 -08004#ifdef CONFIG_X86_32
Hiroshi Shimamotoa5c56eb2008-12-17 18:49:55 -08005#define sigframe_ia32 sigframe
6#define rt_sigframe_ia32 rt_sigframe
7#define sigcontext_ia32 sigcontext
8#define _fpstate_ia32 _fpstate
9#define ucontext_ia32 ucontext
Hiroshi Shimamotoc85c2ff2008-12-17 18:51:08 -080010#else /* !CONFIG_X86_32 */
Hiroshi Shimamotoa5c56eb2008-12-17 18:49:55 -080011
Hiroshi Shimamotoc85c2ff2008-12-17 18:51:08 -080012#ifdef CONFIG_IA32_EMULATION
13#include <asm/ia32.h>
14#endif /* CONFIG_IA32_EMULATION */
15
16#endif /* CONFIG_X86_32 */
17
18#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
Hiroshi Shimamotoa5c56eb2008-12-17 18:49:55 -080019struct sigframe_ia32 {
20 u32 pretcode;
Linus Torvalds1da177e2005-04-16 15:20:36 -070021 int sig;
Hiroshi Shimamotoa5c56eb2008-12-17 18:49:55 -080022 struct sigcontext_ia32 sc;
Suresh Siddha3c1c7f12008-07-29 10:29:21 -070023 /*
24 * fpstate is unused. fpstate is moved/allocated after
25 * retcode[] below. This movement allows to have the FP state and the
26 * future state extensions (xsave) stay together.
27 * And at the same time retaining the unused fpstate, prevents changing
28 * the offset of extramask[] in the sigframe and thus prevent any
29 * legacy application accessing/modifying it.
30 */
Hiroshi Shimamotoa5c56eb2008-12-17 18:49:55 -080031 struct _fpstate_ia32 fpstate_unused;
Hiroshi Shimamotoc85c2ff2008-12-17 18:51:08 -080032#ifdef CONFIG_IA32_EMULATION
33 unsigned int extramask[_COMPAT_NSIG_WORDS-1];
34#else /* !CONFIG_IA32_EMULATION */
Linus Torvalds1da177e2005-04-16 15:20:36 -070035 unsigned long extramask[_NSIG_WORDS-1];
Hiroshi Shimamotoc85c2ff2008-12-17 18:51:08 -080036#endif /* CONFIG_IA32_EMULATION */
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 char retcode[8];
Suresh Siddha3c1c7f12008-07-29 10:29:21 -070038 /* fp state follows here */
Linus Torvalds1da177e2005-04-16 15:20:36 -070039};
40
Hiroshi Shimamotoa5c56eb2008-12-17 18:49:55 -080041struct rt_sigframe_ia32 {
42 u32 pretcode;
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 int sig;
Hiroshi Shimamotoa5c56eb2008-12-17 18:49:55 -080044 u32 pinfo;
45 u32 puc;
Hiroshi Shimamotoc85c2ff2008-12-17 18:51:08 -080046#ifdef CONFIG_IA32_EMULATION
47 compat_siginfo_t info;
48#else /* !CONFIG_IA32_EMULATION */
Linus Torvalds1da177e2005-04-16 15:20:36 -070049 struct siginfo info;
Hiroshi Shimamotoc85c2ff2008-12-17 18:51:08 -080050#endif /* CONFIG_IA32_EMULATION */
Hiroshi Shimamotoa5c56eb2008-12-17 18:49:55 -080051 struct ucontext_ia32 uc;
Linus Torvalds1da177e2005-04-16 15:20:36 -070052 char retcode[8];
Suresh Siddha3c1c7f12008-07-29 10:29:21 -070053 /* fp state follows here */
Linus Torvalds1da177e2005-04-16 15:20:36 -070054};
Hiroshi Shimamotoc85c2ff2008-12-17 18:51:08 -080055#endif /* defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION) */
56
57#ifdef CONFIG_X86_64
Harvey Harrison123a6342008-02-08 12:10:00 -080058struct rt_sigframe {
59 char __user *pretcode;
60 struct ucontext uc;
61 struct siginfo info;
Suresh Siddha3c1c7f12008-07-29 10:29:21 -070062 /* fp state follows here */
Harvey Harrison123a6342008-02-08 12:10:00 -080063};
Hiroshi Shimamotoc85c2ff2008-12-17 18:51:08 -080064#endif /* CONFIG_X86_64 */
Hiroshi Shimamoto5c2628e2008-12-18 09:18:35 -080065
66#endif /* _ASM_X86_SIGFRAME_H */