2008-12-19 01:18:35 +08:00
|
|
|
#ifndef _ASM_X86_SIGFRAME_H
|
|
|
|
#define _ASM_X86_SIGFRAME_H
|
|
|
|
|
2015-09-05 15:32:43 +08:00
|
|
|
#include <uapi/asm/sigcontext.h>
|
2008-12-19 06:43:34 +08:00
|
|
|
#include <asm/siginfo.h>
|
|
|
|
#include <asm/ucontext.h>
|
2015-06-22 19:55:12 +08:00
|
|
|
#include <linux/compat.h>
|
2008-12-19 06:43:34 +08:00
|
|
|
|
2008-02-09 04:10:00 +08:00
|
|
|
#ifdef CONFIG_X86_32
|
2008-12-18 10:49:55 +08:00
|
|
|
#define sigframe_ia32 sigframe
|
|
|
|
#define rt_sigframe_ia32 rt_sigframe
|
|
|
|
#define ucontext_ia32 ucontext
|
2008-12-18 10:51:08 +08:00
|
|
|
#else /* !CONFIG_X86_32 */
|
|
|
|
|
|
|
|
#ifdef CONFIG_IA32_EMULATION
|
|
|
|
#include <asm/ia32.h>
|
|
|
|
#endif /* CONFIG_IA32_EMULATION */
|
|
|
|
|
|
|
|
#endif /* CONFIG_X86_32 */
|
2008-12-18 10:49:55 +08:00
|
|
|
|
2008-12-18 10:51:08 +08:00
|
|
|
#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
|
2008-12-18 10:49:55 +08:00
|
|
|
struct sigframe_ia32 {
|
|
|
|
u32 pretcode;
|
2005-04-17 06:20:36 +08:00
|
|
|
int sig;
|
2015-09-05 15:32:41 +08:00
|
|
|
struct sigcontext_32 sc;
|
2008-07-30 01:29:21 +08:00
|
|
|
/*
|
|
|
|
* fpstate is unused. fpstate is moved/allocated after
|
|
|
|
* retcode[] below. This movement allows to have the FP state and the
|
|
|
|
* future state extensions (xsave) stay together.
|
|
|
|
* And at the same time retaining the unused fpstate, prevents changing
|
|
|
|
* the offset of extramask[] in the sigframe and thus prevent any
|
|
|
|
* legacy application accessing/modifying it.
|
|
|
|
*/
|
2015-09-05 15:32:36 +08:00
|
|
|
struct _fpstate_32 fpstate_unused;
|
2008-12-18 10:51:08 +08:00
|
|
|
#ifdef CONFIG_IA32_EMULATION
|
|
|
|
unsigned int extramask[_COMPAT_NSIG_WORDS-1];
|
|
|
|
#else /* !CONFIG_IA32_EMULATION */
|
2005-04-17 06:20:36 +08:00
|
|
|
unsigned long extramask[_NSIG_WORDS-1];
|
2008-12-18 10:51:08 +08:00
|
|
|
#endif /* CONFIG_IA32_EMULATION */
|
2005-04-17 06:20:36 +08:00
|
|
|
char retcode[8];
|
2008-07-30 01:29:21 +08:00
|
|
|
/* fp state follows here */
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2008-12-18 10:49:55 +08:00
|
|
|
struct rt_sigframe_ia32 {
|
|
|
|
u32 pretcode;
|
2005-04-17 06:20:36 +08:00
|
|
|
int sig;
|
2008-12-18 10:49:55 +08:00
|
|
|
u32 pinfo;
|
|
|
|
u32 puc;
|
2008-12-18 10:51:08 +08:00
|
|
|
#ifdef CONFIG_IA32_EMULATION
|
|
|
|
compat_siginfo_t info;
|
|
|
|
#else /* !CONFIG_IA32_EMULATION */
|
2005-04-17 06:20:36 +08:00
|
|
|
struct siginfo info;
|
2008-12-18 10:51:08 +08:00
|
|
|
#endif /* CONFIG_IA32_EMULATION */
|
2008-12-18 10:49:55 +08:00
|
|
|
struct ucontext_ia32 uc;
|
2005-04-17 06:20:36 +08:00
|
|
|
char retcode[8];
|
2008-07-30 01:29:21 +08:00
|
|
|
/* fp state follows here */
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
2008-12-18 10:51:08 +08:00
|
|
|
#endif /* defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION) */
|
|
|
|
|
|
|
|
#ifdef CONFIG_X86_64
|
2012-02-19 23:50:12 +08:00
|
|
|
|
2008-02-09 04:10:00 +08:00
|
|
|
struct rt_sigframe {
|
|
|
|
char __user *pretcode;
|
|
|
|
struct ucontext uc;
|
|
|
|
struct siginfo info;
|
2008-07-30 01:29:21 +08:00
|
|
|
/* fp state follows here */
|
2008-02-09 04:10:00 +08:00
|
|
|
};
|
2012-02-19 23:50:12 +08:00
|
|
|
|
|
|
|
#ifdef CONFIG_X86_X32_ABI
|
|
|
|
|
2015-06-22 19:55:12 +08:00
|
|
|
struct ucontext_x32 {
|
|
|
|
unsigned int uc_flags;
|
|
|
|
unsigned int uc_link;
|
|
|
|
compat_stack_t uc_stack;
|
|
|
|
unsigned int uc__pad0; /* needed for alignment */
|
|
|
|
struct sigcontext uc_mcontext; /* the 64-bit sigcontext type */
|
|
|
|
compat_sigset_t uc_sigmask; /* mask last for extensibility */
|
|
|
|
};
|
|
|
|
|
2012-02-19 23:50:12 +08:00
|
|
|
struct rt_sigframe_x32 {
|
|
|
|
u64 pretcode;
|
|
|
|
struct ucontext_x32 uc;
|
|
|
|
compat_siginfo_t info;
|
|
|
|
/* fp state follows here */
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* CONFIG_X86_X32_ABI */
|
|
|
|
|
2008-12-18 10:51:08 +08:00
|
|
|
#endif /* CONFIG_X86_64 */
|
2008-12-19 01:18:35 +08:00
|
|
|
|
|
|
|
#endif /* _ASM_X86_SIGFRAME_H */
|