xref: /linux/arch/mips/include/uapi/asm/ucontext.h (revision b6ebbac51bedf9e98e837688bc838f400196da5e)
1 #ifndef __MIPS_UAPI_ASM_UCONTEXT_H
2 #define __MIPS_UAPI_ASM_UCONTEXT_H
3 
4 /**
5  * struct extcontext - extended context header structure
6  * @magic:	magic value identifying the type of extended context
7  * @size:	the size in bytes of the enclosing structure
8  *
9  * Extended context structures provide context which does not fit within struct
10  * sigcontext. They are placed sequentially in memory at the end of struct
11  * ucontext and struct sigframe, with each extended context structure beginning
12  * with a header defined by this struct. The type of context represented is
13  * indicated by the magic field. Userland may check each extended context
14  * structure against magic values that it recognises. The size field allows any
15  * unrecognised context to be skipped, allowing for future expansion. The end
16  * of the extended context data is indicated by the magic value
17  * END_EXTCONTEXT_MAGIC.
18  */
19 struct extcontext {
20 	unsigned int		magic;
21 	unsigned int		size;
22 };
23 
24 /**
25  * struct msa_extcontext - MSA extended context structure
26  * @ext:	the extended context header, with magic == MSA_EXTCONTEXT_MAGIC
27  * @wr:		the most significant 64 bits of each MSA vector register
28  * @csr:	the value of the MSA control & status register
29  *
30  * If MSA context is live for a task at the time a signal is delivered to it,
31  * this structure will hold the MSA context of the task as it was prior to the
32  * signal delivery.
33  */
34 struct msa_extcontext {
35 	struct extcontext	ext;
36 #define MSA_EXTCONTEXT_MAGIC	0x784d5341	/* xMSA */
37 
38 	unsigned long long	wr[32];
39 	unsigned int		csr;
40 };
41 
42 #define END_EXTCONTEXT_MAGIC	0x78454e44	/* xEND */
43 
44 /**
45  * struct ucontext - user context structure
46  * @uc_flags:
47  * @uc_link:
48  * @uc_stack:
49  * @uc_mcontext:	holds basic processor state
50  * @uc_sigmask:
51  * @uc_extcontext:	holds extended processor state
52  */
53 struct ucontext {
54 	/* Historic fields matching asm-generic */
55 	unsigned long		uc_flags;
56 	struct ucontext		*uc_link;
57 	stack_t			uc_stack;
58 	struct sigcontext	uc_mcontext;
59 	sigset_t		uc_sigmask;
60 
61 	/* Extended context structures may follow ucontext */
62 	unsigned long long	uc_extcontext[0];
63 };
64 
65 #endif /* __MIPS_UAPI_ASM_UCONTEXT_H */
66