sigcontext.h 2.6 KB

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