ucontext.h 2.9 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, preceeded 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. #if __LINUX_ARM_ARCH__ < 6
  53. /* For ARM pre-v6, we use fstmiax and fldmiax. This adds one extra
  54. * word after the registers, and a word of padding at the end for
  55. * alignment. */
  56. #define VFP_MAGIC 0x56465001
  57. #define VFP_STORAGE_SIZE 152
  58. #else
  59. #define VFP_MAGIC 0x56465002
  60. #define VFP_STORAGE_SIZE 144
  61. #endif
  62. struct vfp_sigframe
  63. {
  64. unsigned long magic;
  65. unsigned long size;
  66. union vfp_state storage;
  67. };
  68. #endif /* CONFIG_VFP */
  69. /*
  70. * Auxiliary signal frame. This saves stuff like FP state.
  71. * The layout of this structure is not part of the user ABI,
  72. * because the config options aren't. uc_regspace is really
  73. * one of these.
  74. */
  75. struct aux_sigframe {
  76. #ifdef CONFIG_CRUNCH
  77. struct crunch_sigframe crunch;
  78. #endif
  79. #ifdef CONFIG_IWMMXT
  80. struct iwmmxt_sigframe iwmmxt;
  81. #endif
  82. #if 0 && defined CONFIG_VFP /* Not yet saved. */
  83. struct vfp_sigframe vfp;
  84. #endif
  85. /* Something that isn't a valid magic number for any coprocessor. */
  86. unsigned long end_magic;
  87. } __attribute__((__aligned__(8)));
  88. #endif
  89. #endif /* !_ASMARM_UCONTEXT_H */