ucontext.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. /*
  33. * Dummy padding block: if this magic is encountered, the block should
  34. * be skipped using the corresponding size field.
  35. */
  36. #define DUMMY_MAGIC 0xb0d9ed01
  37. #ifdef CONFIG_CRUNCH
  38. #define CRUNCH_MAGIC 0x5065cf03
  39. #define CRUNCH_STORAGE_SIZE (CRUNCH_SIZE + 8)
  40. struct crunch_sigframe {
  41. unsigned long magic;
  42. unsigned long size;
  43. struct crunch_state storage;
  44. } __attribute__((__aligned__(8)));
  45. #endif
  46. #ifdef CONFIG_IWMMXT
  47. /* iwmmxt_area is 0x98 bytes long, preceded by 8 bytes of signature */
  48. #define IWMMXT_MAGIC 0x12ef842a
  49. #define IWMMXT_STORAGE_SIZE (IWMMXT_SIZE + 8)
  50. struct iwmmxt_sigframe {
  51. unsigned long magic;
  52. unsigned long size;
  53. struct iwmmxt_struct storage;
  54. } __attribute__((__aligned__(8)));
  55. #endif /* CONFIG_IWMMXT */
  56. #ifdef CONFIG_VFP
  57. #define VFP_MAGIC 0x56465001
  58. struct vfp_sigframe
  59. {
  60. unsigned long magic;
  61. unsigned long size;
  62. struct user_vfp ufp;
  63. struct user_vfp_exc ufp_exc;
  64. } __attribute__((__aligned__(8)));
  65. /*
  66. * 8 byte for magic and size, 264 byte for ufp, 12 bytes for ufp_exc,
  67. * 4 bytes padding.
  68. */
  69. #define VFP_STORAGE_SIZE sizeof(struct vfp_sigframe)
  70. #endif /* CONFIG_VFP */
  71. /*
  72. * Auxiliary signal frame. This saves stuff like FP state.
  73. * The layout of this structure is not part of the user ABI,
  74. * because the config options aren't. uc_regspace is really
  75. * one of these.
  76. */
  77. struct aux_sigframe {
  78. #ifdef CONFIG_CRUNCH
  79. struct crunch_sigframe crunch;
  80. #endif
  81. #ifdef CONFIG_IWMMXT
  82. struct iwmmxt_sigframe iwmmxt;
  83. #endif
  84. #ifdef CONFIG_VFP
  85. struct vfp_sigframe vfp;
  86. #endif
  87. /* Something that isn't a valid magic number for any coprocessor. */
  88. unsigned long end_magic;
  89. } __attribute__((__aligned__(8)));
  90. #endif
  91. #endif /* !_ASMARM_UCONTEXT_H */