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