ucontext.h 2.1 KB

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