svr4.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* Solaris/SPARC constants and definitions --
  2. * (C) 1996 Miguel de Icaza
  3. *
  4. * This file is not meant to be included by user level applications
  5. * but the solaris syscall emulator
  6. */
  7. #ifndef _SPARC64_SVR4_H
  8. #define _SPARC64_SVR4_H
  9. /* Signals as used by svr4 */
  10. typedef struct { /* signal set type */
  11. uint sigbits[4];
  12. } svr4_sigset_t;
  13. /* Values for siginfo.code */
  14. #define SVR4_SINOINFO 32767
  15. /* Siginfo, sucker expects bunch of information on those parameters */
  16. typedef union {
  17. char total_size [128];
  18. struct {
  19. int signo;
  20. int code;
  21. int error;
  22. union {
  23. } data;
  24. } siginfo;
  25. } svr4_siginfo_t;
  26. /* Context definition */
  27. /* Location of the user stored registers into a greg_t */
  28. enum {
  29. SVR4_PSR, SVR4_PC, SVR4_NPC, SVR4_Y,
  30. SVR4_G1, SVR4_G2, SVR4_G3, SVR4_G4,
  31. SVR4_G5, SVR4_G6, SVR4_G7, SVR4_O0,
  32. SVR4_O1, SVR4_O2, SVR4_O3, SVR4_O4,
  33. SVR4_O5, SVR4_O6, SVR4_O7
  34. };
  35. /* sizeof (regs) / sizeof (greg_t), defined in the ABI */
  36. #define SVR4_NREGS 19
  37. #define SVR4_MAXWIN 31
  38. typedef struct {
  39. u32 rwin_lo[8];
  40. u32 rwin_in[8];
  41. } svr4_rwindow_t;
  42. typedef struct {
  43. int count;
  44. u32 winptr [SVR4_MAXWIN]; /* pointer to the windows */
  45. svr4_rwindow_t win[SVR4_MAXWIN]; /* the windows */
  46. } svr4_gwindows_t;
  47. typedef int svr4_gregset_t[SVR4_NREGS];
  48. typedef struct {
  49. u64 fpu_regs[32];
  50. u32 fp_q;
  51. u32 fp_fsr;
  52. u_char fp_nqel;
  53. u_char fp_nqsize;
  54. u_char inuse; /* if fpu is in use */
  55. } svr4_fregset_t;
  56. typedef struct {
  57. u32 id; /* if this holds "xrs" string => ptr is valid */
  58. u32 ptr;
  59. } svr4_xrs_t;
  60. /* Machine dependent context */
  61. typedef struct {
  62. svr4_gregset_t greg; /* registers 0..19 (see top) */
  63. u32 gwin; /* may point to register windows */
  64. svr4_fregset_t freg; /* floating point registers */
  65. svr4_xrs_t xrs; /* mhm? */
  66. int pad[19];
  67. } svr4_mcontext_t;
  68. /* flags for stack_t.flags */
  69. enum svr4_stack_flags {
  70. SVR4_SS_ONSTACK,
  71. SVR4_SS_DISABLE,
  72. };
  73. /* signal stack execution place, unsupported */
  74. typedef struct svr4_stack_t {
  75. u32 sp;
  76. int size;
  77. int flags;
  78. } svr4_stack_t;
  79. /* Context used by getcontext and setcontext */
  80. typedef struct svr4_ucontext_t {
  81. u32 flags; /* context flags, indicate what is loaded */
  82. u32 link;
  83. svr4_sigset_t sigmask;
  84. svr4_stack_t stack;
  85. svr4_mcontext_t mcontext;
  86. int pad[23];
  87. } svr4_ucontext_t;
  88. /* windows hold the windows as they were at signal time,
  89. * ucontext->mcontext holds a pointer to them.
  90. * addresses for uc and si are passed as parameters to svr4 signal
  91. * handler
  92. */
  93. /* This is the signal frame that is passed to the signal handler */
  94. typedef struct {
  95. svr4_gwindows_t gw; /* windows */
  96. svr4_ucontext_t uc; /* machine context */
  97. svr4_siginfo_t si; /* siginfo */
  98. } svr4_signal_frame_t;
  99. #define SVR4_SF_ALIGNED (((sizeof (svr4_signal_frame_t) + 7) & (~7)))
  100. #endif /* include control */