ucontext.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef __MIPS_UAPI_ASM_UCONTEXT_H
  3. #define __MIPS_UAPI_ASM_UCONTEXT_H
  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. * struct msa_extcontext - MSA extended context structure
  25. * @ext: the extended context header, with magic == MSA_EXTCONTEXT_MAGIC
  26. * @wr: the most significant 64 bits of each MSA vector register
  27. * @csr: the value of the MSA control & status register
  28. *
  29. * If MSA context is live for a task at the time a signal is delivered to it,
  30. * this structure will hold the MSA context of the task as it was prior to the
  31. * signal delivery.
  32. */
  33. struct msa_extcontext {
  34. struct extcontext ext;
  35. #define MSA_EXTCONTEXT_MAGIC 0x784d5341 /* xMSA */
  36. unsigned long long wr[32];
  37. unsigned int csr;
  38. };
  39. #define END_EXTCONTEXT_MAGIC 0x78454e44 /* xEND */
  40. /**
  41. * struct ucontext - user context structure
  42. * @uc_flags:
  43. * @uc_link:
  44. * @uc_stack:
  45. * @uc_mcontext: holds basic processor state
  46. * @uc_sigmask:
  47. * @uc_extcontext: holds extended processor state
  48. */
  49. struct ucontext {
  50. /* Historic fields matching asm-generic */
  51. unsigned long uc_flags;
  52. struct ucontext *uc_link;
  53. stack_t uc_stack;
  54. struct sigcontext uc_mcontext;
  55. sigset_t uc_sigmask;
  56. /* Extended context structures may follow ucontext */
  57. unsigned long long uc_extcontext[];
  58. };
  59. #endif /* __MIPS_UAPI_ASM_UCONTEXT_H */