sigcontext.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #ifndef __SPARC_SIGCONTEXT_H
  2. #define __SPARC_SIGCONTEXT_H
  3. #include <asm/ptrace.h>
  4. #include <uapi/asm/sigcontext.h>
  5. #ifndef __ASSEMBLY__
  6. #define __SUNOS_MAXWIN 31
  7. /* This is what SunOS does, so shall I unless we use new 32bit signals or rt signals. */
  8. struct sigcontext32 {
  9. int sigc_onstack; /* state to restore */
  10. int sigc_mask; /* sigmask to restore */
  11. int sigc_sp; /* stack pointer */
  12. int sigc_pc; /* program counter */
  13. int sigc_npc; /* next program counter */
  14. int sigc_psr; /* for condition codes etc */
  15. int sigc_g1; /* User uses these two registers */
  16. int sigc_o0; /* within the trampoline code. */
  17. /* Now comes information regarding the users window set
  18. * at the time of the signal.
  19. */
  20. int sigc_oswins; /* outstanding windows */
  21. /* stack ptrs for each regwin buf */
  22. unsigned sigc_spbuf[__SUNOS_MAXWIN];
  23. /* Windows to restore after signal */
  24. struct reg_window32 sigc_wbuf[__SUNOS_MAXWIN];
  25. };
  26. /* This is what we use for 32bit new non-rt signals. */
  27. typedef struct {
  28. struct {
  29. unsigned int psr;
  30. unsigned int pc;
  31. unsigned int npc;
  32. unsigned int y;
  33. unsigned int u_regs[16]; /* globals and ins */
  34. } si_regs;
  35. int si_mask;
  36. } __siginfo32_t;
  37. #define __SIGC_MAXWIN 7
  38. typedef struct {
  39. unsigned long locals[8];
  40. unsigned long ins[8];
  41. } __siginfo_reg_window;
  42. typedef struct {
  43. int wsaved;
  44. __siginfo_reg_window reg_window[__SIGC_MAXWIN];
  45. unsigned long rwbuf_stkptrs[__SIGC_MAXWIN];
  46. } __siginfo_rwin_t;
  47. #ifdef CONFIG_SPARC64
  48. typedef struct {
  49. unsigned int si_float_regs [64];
  50. unsigned long si_fsr;
  51. unsigned long si_gsr;
  52. unsigned long si_fprs;
  53. } __siginfo_fpu_t;
  54. /* This is what SunOS doesn't, so we have to write this alone
  55. and do it properly. */
  56. struct sigcontext {
  57. /* The size of this array has to match SI_MAX_SIZE from siginfo.h */
  58. char sigc_info[128];
  59. struct {
  60. unsigned long u_regs[16]; /* globals and ins */
  61. unsigned long tstate;
  62. unsigned long tpc;
  63. unsigned long tnpc;
  64. unsigned int y;
  65. unsigned int fprs;
  66. } sigc_regs;
  67. __siginfo_fpu_t * sigc_fpu_save;
  68. struct {
  69. void * ss_sp;
  70. int ss_flags;
  71. unsigned long ss_size;
  72. } sigc_stack;
  73. unsigned long sigc_mask;
  74. __siginfo_rwin_t * sigc_rwin_save;
  75. };
  76. #else
  77. typedef struct {
  78. unsigned long si_float_regs [32];
  79. unsigned long si_fsr;
  80. unsigned long si_fpqdepth;
  81. struct {
  82. unsigned long *insn_addr;
  83. unsigned long insn;
  84. } si_fpqueue [16];
  85. } __siginfo_fpu_t;
  86. #endif /* (CONFIG_SPARC64) */
  87. #endif /* !(__ASSEMBLY__) */
  88. #endif /* !(__SPARC_SIGCONTEXT_H) */