siginfo.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. * We duplicate the generic versions - <asm-generic/siginfo.h> is just borked
  16. * by design ...
  17. */
  18. #define HAVE_ARCH_COPY_SIGINFO
  19. struct siginfo;
  20. /*
  21. * Careful to keep union _sifields from shifting ...
  22. */
  23. #if _MIPS_SZLONG == 32
  24. #define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
  25. #elif _MIPS_SZLONG == 64
  26. #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
  27. #else
  28. #error _MIPS_SZLONG neither 32 nor 64
  29. #endif
  30. #include <asm-generic/siginfo.h>
  31. typedef struct siginfo {
  32. int si_signo;
  33. int si_code;
  34. int si_errno;
  35. int __pad0[SI_MAX_SIZE / sizeof(int) - SI_PAD_SIZE - 3];
  36. union {
  37. int _pad[SI_PAD_SIZE];
  38. /* kill() */
  39. struct {
  40. pid_t _pid; /* sender's pid */
  41. __ARCH_SI_UID_T _uid; /* sender's uid */
  42. } _kill;
  43. /* POSIX.1b timers */
  44. struct {
  45. timer_t _tid; /* timer id */
  46. int _overrun; /* overrun count */
  47. char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
  48. sigval_t _sigval; /* same as below */
  49. int _sys_private; /* not to be passed to user */
  50. } _timer;
  51. /* POSIX.1b signals */
  52. struct {
  53. pid_t _pid; /* sender's pid */
  54. __ARCH_SI_UID_T _uid; /* sender's uid */
  55. sigval_t _sigval;
  56. } _rt;
  57. /* SIGCHLD */
  58. struct {
  59. pid_t _pid; /* which child */
  60. __ARCH_SI_UID_T _uid; /* sender's uid */
  61. int _status; /* exit code */
  62. clock_t _utime;
  63. clock_t _stime;
  64. } _sigchld;
  65. /* IRIX SIGCHLD */
  66. struct {
  67. pid_t _pid; /* which child */
  68. clock_t _utime;
  69. int _status; /* exit code */
  70. clock_t _stime;
  71. } _irix_sigchld;
  72. /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
  73. struct {
  74. void __user *_addr; /* faulting insn/memory ref. */
  75. #ifdef __ARCH_SI_TRAPNO
  76. int _trapno; /* TRAP # which caused the signal */
  77. #endif
  78. short _addr_lsb;
  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. } _sifields;
  86. } siginfo_t;
  87. /*
  88. * si_code values
  89. * Again these have been chosen to be IRIX compatible.
  90. */
  91. #undef SI_ASYNCIO
  92. #undef SI_TIMER
  93. #undef SI_MESGQ
  94. #define SI_ASYNCIO -2 /* sent by AIO completion */
  95. #define SI_TIMER __SI_CODE(__SI_TIMER, -3) /* sent by timer expiration */
  96. #define SI_MESGQ __SI_CODE(__SI_MESGQ, -4) /* sent by real time mesq state change */
  97. #endif /* _UAPI_ASM_SIGINFO_H */