siginfo.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1998, 1999, 2001, 2003 Ralf Baechle
  7. * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
  8. */
  9. #ifndef _ASM_SIGINFO_H
  10. #define _ASM_SIGINFO_H
  11. #define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
  12. #undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
  13. #define HAVE_ARCH_SIGINFO_T
  14. /*
  15. * Careful to keep union _sifields from shifting ...
  16. */
  17. #if _MIPS_SZLONG == 32
  18. #define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
  19. #elif _MIPS_SZLONG == 64
  20. #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
  21. #else
  22. #error _MIPS_SZLONG neither 32 nor 64
  23. #endif
  24. #define __ARCH_SIGSYS
  25. #include <asm-generic/siginfo.h>
  26. /* We can't use generic siginfo_t, because our si_code and si_errno are swapped */
  27. typedef struct siginfo {
  28. int si_signo;
  29. int si_code;
  30. int si_errno;
  31. int __pad0[SI_MAX_SIZE / sizeof(int) - SI_PAD_SIZE - 3];
  32. union {
  33. int _pad[SI_PAD_SIZE];
  34. /* kill() */
  35. struct {
  36. __kernel_pid_t _pid; /* sender's pid */
  37. __ARCH_SI_UID_T _uid; /* sender's uid */
  38. } _kill;
  39. /* POSIX.1b timers */
  40. struct {
  41. __kernel_timer_t _tid; /* timer id */
  42. int _overrun; /* overrun count */
  43. char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
  44. sigval_t _sigval; /* same as below */
  45. int _sys_private; /* not to be passed to user */
  46. } _timer;
  47. /* POSIX.1b signals */
  48. struct {
  49. __kernel_pid_t _pid; /* sender's pid */
  50. __ARCH_SI_UID_T _uid; /* sender's uid */
  51. sigval_t _sigval;
  52. } _rt;
  53. /* SIGCHLD */
  54. struct {
  55. __kernel_pid_t _pid; /* which child */
  56. __ARCH_SI_UID_T _uid; /* sender's uid */
  57. int _status; /* exit code */
  58. __kernel_clock_t _utime;
  59. __kernel_clock_t _stime;
  60. } _sigchld;
  61. /* IRIX SIGCHLD */
  62. struct {
  63. __kernel_pid_t _pid; /* which child */
  64. __kernel_clock_t _utime;
  65. int _status; /* exit code */
  66. __kernel_clock_t _stime;
  67. } _irix_sigchld;
  68. /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
  69. struct {
  70. void *_addr; /* faulting insn/memory ref. */
  71. #ifdef __ARCH_SI_TRAPNO
  72. int _trapno; /* TRAP # which caused the signal */
  73. #endif
  74. short _addr_lsb;
  75. struct {
  76. void *_lower;
  77. void *_upper;
  78. } _addr_bnd;
  79. } _sigfault;
  80. /* SIGPOLL, SIGXFSZ (To do ...) */
  81. struct {
  82. __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
  83. int _fd;
  84. } _sigpoll;
  85. /* SIGSYS */
  86. struct {
  87. void *_call_addr; /* calling user insn */
  88. int _syscall; /* triggering system call number */
  89. unsigned int _arch; /* AUDIT_ARCH_* of syscall */
  90. } _sigsys;
  91. } _sifields;
  92. } siginfo_t;
  93. /*
  94. * si_code values
  95. * Again these have been chosen to be IRIX compatible.
  96. */
  97. #undef SI_ASYNCIO
  98. #undef SI_TIMER
  99. #undef SI_MESGQ
  100. #define SI_ASYNCIO -2 /* sent by AIO completion */
  101. #define SI_TIMER __SI_CODE(__SI_TIMER, -3) /* sent by timer expiration */
  102. #define SI_MESGQ __SI_CODE(__SI_MESGQ, -4) /* sent by real time mesq state change */
  103. #endif /* _ASM_SIGINFO_H */