Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ASM_X86_SIGFRAME_H
0003 #define _ASM_X86_SIGFRAME_H
0004 
0005 #include <uapi/asm/sigcontext.h>
0006 #include <asm/siginfo.h>
0007 #include <asm/ucontext.h>
0008 #include <linux/compat.h>
0009 
0010 #ifdef CONFIG_X86_32
0011 #define sigframe_ia32       sigframe
0012 #define rt_sigframe_ia32    rt_sigframe
0013 #define ucontext_ia32       ucontext
0014 #else /* !CONFIG_X86_32 */
0015 
0016 #ifdef CONFIG_IA32_EMULATION
0017 #include <asm/ia32.h>
0018 #endif /* CONFIG_IA32_EMULATION */
0019 
0020 #endif /* CONFIG_X86_32 */
0021 
0022 #if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
0023 struct sigframe_ia32 {
0024     u32 pretcode;
0025     int sig;
0026     struct sigcontext_32 sc;
0027     /*
0028      * fpstate is unused. fpstate is moved/allocated after
0029      * retcode[] below. This movement allows to have the FP state and the
0030      * future state extensions (xsave) stay together.
0031      * And at the same time retaining the unused fpstate, prevents changing
0032      * the offset of extramask[] in the sigframe and thus prevent any
0033      * legacy application accessing/modifying it.
0034      */
0035     struct _fpstate_32 fpstate_unused;
0036     unsigned int extramask[1];
0037     char retcode[8];
0038     /* fp state follows here */
0039 };
0040 
0041 struct rt_sigframe_ia32 {
0042     u32 pretcode;
0043     int sig;
0044     u32 pinfo;
0045     u32 puc;
0046 #ifdef CONFIG_IA32_EMULATION
0047     compat_siginfo_t info;
0048 #else /* !CONFIG_IA32_EMULATION */
0049     struct siginfo info;
0050 #endif /* CONFIG_IA32_EMULATION */
0051     struct ucontext_ia32 uc;
0052     char retcode[8];
0053     /* fp state follows here */
0054 };
0055 #endif /* defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION) */
0056 
0057 #ifdef CONFIG_X86_64
0058 
0059 struct rt_sigframe {
0060     char __user *pretcode;
0061     struct ucontext uc;
0062     struct siginfo info;
0063     /* fp state follows here */
0064 };
0065 
0066 #ifdef CONFIG_X86_X32_ABI
0067 
0068 struct ucontext_x32 {
0069     unsigned int      uc_flags;
0070     unsigned int      uc_link;
0071     compat_stack_t    uc_stack;
0072     unsigned int      uc__pad0;     /* needed for alignment */
0073     struct sigcontext uc_mcontext;  /* the 64-bit sigcontext type */
0074     compat_sigset_t   uc_sigmask;   /* mask last for extensibility */
0075 };
0076 
0077 struct rt_sigframe_x32 {
0078     u64 pretcode;
0079     struct ucontext_x32 uc;
0080     compat_siginfo_t info;
0081     /* fp state follows here */
0082 };
0083 
0084 #endif /* CONFIG_X86_X32_ABI */
0085 
0086 #endif /* CONFIG_X86_64 */
0087 
0088 void __init init_sigframe_size(void);
0089 
0090 #endif /* _ASM_X86_SIGFRAME_H */