ucontext.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #ifndef _ASMARM_UCONTEXT_H
  2. #define _ASMARM_UCONTEXT_H
  3. #include <asm/fpstate.h>
  4. /*
  5. * struct sigcontext only has room for the basic registers, but struct
  6. * ucontext now has room for all registers which need to be saved and
  7. * restored. Coprocessor registers are stored in uc_regspace. Each
  8. * coprocessor's saved state should start with a documented 32-bit magic
  9. * number, followed by a 32-bit word giving the coproccesor's saved size.
  10. * uc_regspace may be expanded if necessary, although this takes some
  11. * coordination with glibc.
  12. */
  13. struct ucontext {
  14. unsigned long uc_flags;
  15. struct ucontext *uc_link;
  16. stack_t uc_stack;
  17. struct sigcontext uc_mcontext;
  18. sigset_t uc_sigmask;
  19. /* Allow for uc_sigmask growth. Glibc uses a 1024-bit sigset_t. */
  20. int __unused[32 - (sizeof (sigset_t) / sizeof (int))];
  21. /* Last for extensibility. Eight byte aligned because some
  22. coprocessors require eight byte alignment. */
  23. unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
  24. };
  25. #ifdef __KERNEL__
  26. /*
  27. * Coprocessor save state. The magic values and specific
  28. * coprocessor's layouts are part of the userspace ABI. Each one of
  29. * these should be a multiple of eight bytes and aligned to eight
  30. * bytes, to prevent unpredictable padding in the signal frame.
  31. */
  32. #ifdef CONFIG_CRUNCH
  33. #define CRUNCH_MAGIC 0x5065cf03
  34. #define CRUNCH_STORAGE_SIZE (CRUNCH_SIZE + 8)
  35. struct crunch_sigframe {
  36. unsigned long magic;
  37. unsigned long size;
  38. struct crunch_state storage;
  39. } __attribute__((__aligned__(8)));
  40. #endif
  41. #ifdef CONFIG_IWMMXT
  42. /* iwmmxt_area is 0x98 bytes long, preceded by 8 bytes of signature */
  43. #define IWMMXT_MAGIC 0x12ef842a
  44. #define IWMMXT_STORAGE_SIZE (IWMMXT_SIZE + 8)
  45. struct iwmmxt_sigframe {
  46. unsigned long magic;
  47. unsigned long size;
  48. struct iwmmxt_struct storage;
  49. } __attribute__((__aligned__(8)));
  50. #endif /* CONFIG_IWMMXT */
  51. #ifdef CONFIG_VFP
  52. #define VFP_MAGIC 0x56465001
  53. struct vfp_sigframe
  54. {
  55. unsigned long magic;
  56. unsigned long size;
  57. struct user_vfp ufp;
  58. struct user_vfp_exc ufp_exc;
  59. } __attribute__((__aligned__(8)));
  60. /*
  61. * 8 byte for magic and size, 264 byte for ufp, 12 bytes for ufp_exc,
  62. * 4 bytes padding.
  63. */
  64. #define VFP_STORAGE_SIZE sizeof(struct vfp_sigframe)
  65. #endif /* CONFIG_VFP */
  66. /*
  67. * Auxiliary signal frame. This saves stuff like FP state.
  68. * The layout of this structure is not part of the user ABI,
  69. * because the config options aren't. uc_regspace is really
  70. * one of these.
  71. */
  72. struct aux_sigframe {
  73. #ifdef CONFIG_CRUNCH
  74. struct crunch_sigframe crunch;
  75. #endif
  76. #ifdef CONFIG_IWMMXT
  77. struct iwmmxt_sigframe iwmmxt;
  78. #endif
  79. #ifdef CONFIG_VFP
  80. struct vfp_sigframe vfp;
  81. #endif
  82. /* Something that isn't a valid magic number for any coprocessor. */
  83. unsigned long end_magic;
  84. } __attribute__((__aligned__(8)));
  85. #endif
  86. #endif /* !_ASMARM_UCONTEXT_H */