siginfo.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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 _UAPI_ASM_SIGINFO_H
  10. #define _UAPI_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 __user *_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. union {
  76. /* used when si_code=SEGV_BNDERR */
  77. struct {
  78. void __user *_lower;
  79. void __user *_upper;
  80. } _addr_bnd;
  81. /* used when si_code=SEGV_PKUERR */
  82. __u32 _pkey;
  83. };
  84. } _sigfault;
  85. /* SIGPOLL, SIGXFSZ (To do ...) */
  86. struct {
  87. __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
  88. int _fd;
  89. } _sigpoll;
  90. /* SIGSYS */
  91. struct {
  92. void __user *_call_addr; /* calling user insn */
  93. int _syscall; /* triggering system call number */
  94. unsigned int _arch; /* AUDIT_ARCH_* of syscall */
  95. } _sigsys;
  96. } _sifields;
  97. } siginfo_t;
  98. /*
  99. * si_code values
  100. * Again these have been chosen to be IRIX compatible.
  101. */
  102. #undef SI_ASYNCIO
  103. #undef SI_TIMER
  104. #undef SI_MESGQ
  105. #define SI_ASYNCIO -2 /* sent by AIO completion */
  106. #define SI_TIMER __SI_CODE(__SI_TIMER, -3) /* sent by timer expiration */
  107. #define SI_MESGQ __SI_CODE(__SI_MESGQ, -4) /* sent by real time mesq state change */
  108. #endif /* _UAPI_ASM_SIGINFO_H */