15c2628e8b4f670d0954053444289e2b018be957aHiroshi Shimamoto#ifndef _ASM_X86_SIGFRAME_H
25c2628e8b4f670d0954053444289e2b018be957aHiroshi Shimamoto#define _ASM_X86_SIGFRAME_H
35c2628e8b4f670d0954053444289e2b018be957aHiroshi Shimamoto
4b2fa739c06931d167b6d2aa7b514ab7f30d04dc0Hiroshi Shimamoto#include <asm/sigcontext.h>
5b2fa739c06931d167b6d2aa7b514ab7f30d04dc0Hiroshi Shimamoto#include <asm/siginfo.h>
6b2fa739c06931d167b6d2aa7b514ab7f30d04dc0Hiroshi Shimamoto#include <asm/ucontext.h>
7b2fa739c06931d167b6d2aa7b514ab7f30d04dc0Hiroshi Shimamoto
8123a63476cafcede1c70529f62a5bfb96a0efc1bHarvey Harrison#ifdef CONFIG_X86_32
9a5c56eb36f999ae0ecac278e51fd1cf8feb16c2fHiroshi Shimamoto#define sigframe_ia32		sigframe
10a5c56eb36f999ae0ecac278e51fd1cf8feb16c2fHiroshi Shimamoto#define rt_sigframe_ia32	rt_sigframe
11a5c56eb36f999ae0ecac278e51fd1cf8feb16c2fHiroshi Shimamoto#define sigcontext_ia32		sigcontext
12a5c56eb36f999ae0ecac278e51fd1cf8feb16c2fHiroshi Shimamoto#define _fpstate_ia32		_fpstate
13a5c56eb36f999ae0ecac278e51fd1cf8feb16c2fHiroshi Shimamoto#define ucontext_ia32		ucontext
14c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto#else /* !CONFIG_X86_32 */
15c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto
16c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto#ifdef CONFIG_IA32_EMULATION
17c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto#include <asm/ia32.h>
18c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto#endif /* CONFIG_IA32_EMULATION */
19c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto
20c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto#endif /* CONFIG_X86_32 */
21a5c56eb36f999ae0ecac278e51fd1cf8feb16c2fHiroshi Shimamoto
22c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
23a5c56eb36f999ae0ecac278e51fd1cf8feb16c2fHiroshi Shimamotostruct sigframe_ia32 {
24a5c56eb36f999ae0ecac278e51fd1cf8feb16c2fHiroshi Shimamoto	u32 pretcode;
251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int sig;
26a5c56eb36f999ae0ecac278e51fd1cf8feb16c2fHiroshi Shimamoto	struct sigcontext_ia32 sc;
273c1c7f101426cb2ecc79d817a8a65928965fc860Suresh Siddha	/*
283c1c7f101426cb2ecc79d817a8a65928965fc860Suresh Siddha	 * fpstate is unused. fpstate is moved/allocated after
293c1c7f101426cb2ecc79d817a8a65928965fc860Suresh Siddha	 * retcode[] below. This movement allows to have the FP state and the
303c1c7f101426cb2ecc79d817a8a65928965fc860Suresh Siddha	 * future state extensions (xsave) stay together.
313c1c7f101426cb2ecc79d817a8a65928965fc860Suresh Siddha	 * And at the same time retaining the unused fpstate, prevents changing
323c1c7f101426cb2ecc79d817a8a65928965fc860Suresh Siddha	 * the offset of extramask[] in the sigframe and thus prevent any
333c1c7f101426cb2ecc79d817a8a65928965fc860Suresh Siddha	 * legacy application accessing/modifying it.
343c1c7f101426cb2ecc79d817a8a65928965fc860Suresh Siddha	 */
35a5c56eb36f999ae0ecac278e51fd1cf8feb16c2fHiroshi Shimamoto	struct _fpstate_ia32 fpstate_unused;
36c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto#ifdef CONFIG_IA32_EMULATION
37c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto	unsigned int extramask[_COMPAT_NSIG_WORDS-1];
38c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto#else /* !CONFIG_IA32_EMULATION */
391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned long extramask[_NSIG_WORDS-1];
40c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto#endif /* CONFIG_IA32_EMULATION */
411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	char retcode[8];
423c1c7f101426cb2ecc79d817a8a65928965fc860Suresh Siddha	/* fp state follows here */
431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
45a5c56eb36f999ae0ecac278e51fd1cf8feb16c2fHiroshi Shimamotostruct rt_sigframe_ia32 {
46a5c56eb36f999ae0ecac278e51fd1cf8feb16c2fHiroshi Shimamoto	u32 pretcode;
471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int sig;
48a5c56eb36f999ae0ecac278e51fd1cf8feb16c2fHiroshi Shimamoto	u32 pinfo;
49a5c56eb36f999ae0ecac278e51fd1cf8feb16c2fHiroshi Shimamoto	u32 puc;
50c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto#ifdef CONFIG_IA32_EMULATION
51c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto	compat_siginfo_t info;
52c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto#else /* !CONFIG_IA32_EMULATION */
531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	struct siginfo info;
54c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto#endif /* CONFIG_IA32_EMULATION */
55a5c56eb36f999ae0ecac278e51fd1cf8feb16c2fHiroshi Shimamoto	struct ucontext_ia32 uc;
561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	char retcode[8];
573c1c7f101426cb2ecc79d817a8a65928965fc860Suresh Siddha	/* fp state follows here */
581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
59c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto#endif /* defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION) */
60c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto
61c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto#ifdef CONFIG_X86_64
629d3897630e14b3d33bcb24a3c0fa9d60a01d3058H. Peter Anvin
63123a63476cafcede1c70529f62a5bfb96a0efc1bHarvey Harrisonstruct rt_sigframe {
64123a63476cafcede1c70529f62a5bfb96a0efc1bHarvey Harrison	char __user *pretcode;
65123a63476cafcede1c70529f62a5bfb96a0efc1bHarvey Harrison	struct ucontext uc;
66123a63476cafcede1c70529f62a5bfb96a0efc1bHarvey Harrison	struct siginfo info;
673c1c7f101426cb2ecc79d817a8a65928965fc860Suresh Siddha	/* fp state follows here */
68123a63476cafcede1c70529f62a5bfb96a0efc1bHarvey Harrison};
699d3897630e14b3d33bcb24a3c0fa9d60a01d3058H. Peter Anvin
709d3897630e14b3d33bcb24a3c0fa9d60a01d3058H. Peter Anvin#ifdef CONFIG_X86_X32_ABI
719d3897630e14b3d33bcb24a3c0fa9d60a01d3058H. Peter Anvin
729d3897630e14b3d33bcb24a3c0fa9d60a01d3058H. Peter Anvinstruct rt_sigframe_x32 {
739d3897630e14b3d33bcb24a3c0fa9d60a01d3058H. Peter Anvin	u64 pretcode;
749d3897630e14b3d33bcb24a3c0fa9d60a01d3058H. Peter Anvin	struct ucontext_x32 uc;
759d3897630e14b3d33bcb24a3c0fa9d60a01d3058H. Peter Anvin	compat_siginfo_t info;
769d3897630e14b3d33bcb24a3c0fa9d60a01d3058H. Peter Anvin	/* fp state follows here */
779d3897630e14b3d33bcb24a3c0fa9d60a01d3058H. Peter Anvin};
789d3897630e14b3d33bcb24a3c0fa9d60a01d3058H. Peter Anvin
799d3897630e14b3d33bcb24a3c0fa9d60a01d3058H. Peter Anvin#endif /* CONFIG_X86_X32_ABI */
809d3897630e14b3d33bcb24a3c0fa9d60a01d3058H. Peter Anvin
81c85c2ff877c9305f801f7d5b9e6382cb05a03d45Hiroshi Shimamoto#endif /* CONFIG_X86_64 */
825c2628e8b4f670d0954053444289e2b018be957aHiroshi Shimamoto
835c2628e8b4f670d0954053444289e2b018be957aHiroshi Shimamoto#endif /* _ASM_X86_SIGFRAME_H */
84