ucontext.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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_IWMMXT
  33. /* iwmmxt_area is 0x98 bytes long, preceeded by 8 bytes of signature */
  34. #define IWMMXT_MAGIC 0x12ef842a
  35. #define IWMMXT_STORAGE_SIZE (IWMMXT_SIZE + 8)
  36. struct iwmmxt_sigframe {
  37. unsigned long magic;
  38. unsigned long size;
  39. struct iwmmxt_struct storage;
  40. } __attribute__((__aligned__(8)));
  41. #endif /* CONFIG_IWMMXT */
  42. #ifdef CONFIG_VFP
  43. #if __LINUX_ARM_ARCH__ < 6
  44. /* For ARM pre-v6, we use fstmiax and fldmiax. This adds one extra
  45. * word after the registers, and a word of padding at the end for
  46. * alignment. */
  47. #define VFP_MAGIC 0x56465001
  48. #define VFP_STORAGE_SIZE 152
  49. #else
  50. #define VFP_MAGIC 0x56465002
  51. #define VFP_STORAGE_SIZE 144
  52. #endif
  53. struct vfp_sigframe
  54. {
  55. unsigned long magic;
  56. unsigned long size;
  57. union vfp_state storage;
  58. };
  59. #endif /* CONFIG_VFP */
  60. /*
  61. * Auxiliary signal frame. This saves stuff like FP state.
  62. * The layout of this structure is not part of the user ABI,
  63. * because the config options aren't. uc_regspace is really
  64. * one of these.
  65. */
  66. struct aux_sigframe {
  67. #ifdef CONFIG_IWMMXT
  68. struct iwmmxt_sigframe iwmmxt;
  69. #endif
  70. #if 0 && defined CONFIG_VFP /* Not yet saved. */
  71. struct vfp_sigframe vfp;
  72. #endif
  73. /* Something that isn't a valid magic number for any coprocessor. */
  74. unsigned long end_magic;
  75. } __attribute__((__aligned__(8)));
  76. #endif
  77. #endif /* !_ASMARM_UCONTEXT_H */