1 #ifndef _ASM_IA64_SIGINFO_H
2 #define _ASM_IA64_SIGINFO_H
5 * Copyright (C) 1998-2002 Hewlett-Packard Co
6 * David Mosberger-Tang <davidm@hpl.hp.com>
9 #include <linux/types.h>
11 typedef union sigval {
16 #define SI_MAX_SIZE 128
17 #define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 4)
19 typedef struct siginfo {
26 int _pad[SI_PAD_SIZE];
30 pid_t _pid; /* sender's pid */
31 uid_t _uid; /* sender's uid */
40 /* POSIX.1b signals */
42 pid_t _pid; /* sender's pid */
43 uid_t _uid; /* sender's uid */
49 pid_t _pid; /* which child */
50 uid_t _uid; /* sender's uid */
51 int _status; /* exit code */
56 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
58 void *_addr; /* faulting insn/memory ref. */
59 int _imm; /* immediate value for "break" */
60 unsigned int _flags; /* see below */
61 unsigned long _isr; /* isr */
66 long _band; /* POLL_IN, POLL_OUT, POLL_MSG (XPG requires a "long") */
71 pid_t _pid; /* which child */
72 uid_t _uid; /* sender's uid */
73 unsigned long _pfm_ovfl_counters[4]; /* which PMU counter overflowed */
79 * How these fields are to be accessed.
81 #define si_pid _sifields._kill._pid
82 #define si_uid _sifields._kill._uid
83 #define si_status _sifields._sigchld._status
84 #define si_utime _sifields._sigchld._utime
85 #define si_stime _sifields._sigchld._stime
86 #define si_value _sifields._rt._sigval
87 #define si_int _sifields._rt._sigval.sival_int
88 #define si_ptr _sifields._rt._sigval.sival_ptr
89 #define si_addr _sifields._sigfault._addr
90 #define si_imm _sifields._sigfault._imm /* as per UNIX SysV ABI spec */
91 #define si_flags _sifields._sigfault._flags
93 * si_isr is valid for SIGILL, SIGFPE, SIGSEGV, SIGBUS, and SIGTRAP provided that
94 * si_code is non-zero and __ISR_VALID is set in si_flags.
96 #define si_isr _sifields._sigfault._isr
97 #define si_band _sifields._sigpoll._band
98 #define si_fd _sifields._sigpoll._fd
99 #define si_pfm_ovfl _sifields._sigprof._pfm_ovfl_counters
102 * Flag values for si_flags:
104 #define __ISR_VALID_BIT 0
105 #define __ISR_VALID (1 << __ISR_VALID_BIT)
109 * Positive values for kernel-generated signals.
112 #define __SI_MASK 0xffff0000
113 #define __SI_KILL (0 << 16)
114 #define __SI_TIMER (1 << 16)
115 #define __SI_POLL (2 << 16)
116 #define __SI_FAULT (3 << 16)
117 #define __SI_CHLD (4 << 16)
118 #define __SI_RT (5 << 16)
119 #define __SI_PROF (6 << 16)
120 #define __SI_CODE(T,N) ((T) << 16 | ((N) & 0xffff))
128 #define __SI_CODE(T,N) (N)
131 #define SI_USER 0 /* sent by kill, sigsend, raise */
132 #define SI_KERNEL 0x80 /* sent by the kernel from somewhere */
133 #define SI_QUEUE (-1) /* sent by sigqueue */
134 #define SI_TIMER __SI_CODE(__SI_TIMER,-2) /* sent by timer expiration */
135 #define SI_MESGQ (-3) /* sent by real time mesq state change */
136 #define SI_ASYNCIO (-4) /* sent by AIO completion */
137 #define SI_SIGIO (-5) /* sent by queued SIGIO */
138 #define SI_TKILL (-6) /* sent by tkill system call */
140 #define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
141 #define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
146 #define ILL_ILLOPC (__SI_FAULT|1) /* illegal opcode */
147 #define ILL_ILLOPN (__SI_FAULT|2) /* illegal operand */
148 #define ILL_ILLADR (__SI_FAULT|3) /* illegal addressing mode */
149 #define ILL_ILLTRP (__SI_FAULT|4) /* illegal trap */
150 #define ILL_PRVOPC (__SI_FAULT|5) /* privileged opcode */
151 #define ILL_PRVREG (__SI_FAULT|6) /* privileged register */
152 #define ILL_COPROC (__SI_FAULT|7) /* coprocessor error */
153 #define ILL_BADSTK (__SI_FAULT|8) /* internal stack error */
154 #define ILL_BADIADDR (__SI_FAULT|9) /* unimplemented instruction address */
155 #define __ILL_BREAK (__SI_FAULT|10) /* illegal break */
156 #define __ILL_BNDMOD (__SI_FAULT|11) /* bundle-update (modification) in progress */
162 #define FPE_INTDIV (__SI_FAULT|1) /* integer divide by zero */
163 #define FPE_INTOVF (__SI_FAULT|2) /* integer overflow */
164 #define FPE_FLTDIV (__SI_FAULT|3) /* floating point divide by zero */
165 #define FPE_FLTOVF (__SI_FAULT|4) /* floating point overflow */
166 #define FPE_FLTUND (__SI_FAULT|5) /* floating point underflow */
167 #define FPE_FLTRES (__SI_FAULT|6) /* floating point inexact result */
168 #define FPE_FLTINV (__SI_FAULT|7) /* floating point invalid operation */
169 #define FPE_FLTSUB (__SI_FAULT|8) /* subscript out of range */
170 #define __FPE_DECOVF (__SI_FAULT|9) /* decimal overflow */
171 #define __FPE_DECDIV (__SI_FAULT|10) /* decimal division by zero */
172 #define __FPE_DECERR (__SI_FAULT|11) /* packed decimal error */
173 #define __FPE_INVASC (__SI_FAULT|12) /* invalid ASCII digit */
174 #define __FPE_INVDEC (__SI_FAULT|13) /* invalid decimal digit */
180 #define SEGV_MAPERR (__SI_FAULT|1) /* address not mapped to object */
181 #define SEGV_ACCERR (__SI_FAULT|2) /* invalid permissions for mapped object */
182 #define __SEGV_PSTKOVF (__SI_FAULT|3) /* paragraph stack overflow */
188 #define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */
189 #define BUS_ADRERR (__SI_FAULT|2) /* non-existant physical address */
190 #define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */
196 #define TRAP_BRKPT (__SI_FAULT|1) /* process breakpoint */
197 #define TRAP_TRACE (__SI_FAULT|2) /* process trace trap */
198 #define TRAP_BRANCH (__SI_FAULT|3) /* process taken branch trap */
199 #define TRAP_HWBKPT (__SI_FAULT|4) /* hardware breakpoint or watchpoint */
205 #define CLD_EXITED (__SI_CHLD|1) /* child has exited */
206 #define CLD_KILLED (__SI_CHLD|2) /* child was killed */
207 #define CLD_DUMPED (__SI_CHLD|3) /* child terminated abnormally */
208 #define CLD_TRAPPED (__SI_CHLD|4) /* traced child has trapped */
209 #define CLD_STOPPED (__SI_CHLD|5) /* child has stopped */
210 #define CLD_CONTINUED (__SI_CHLD|6) /* stopped child has continued */
216 #define POLL_IN (__SI_POLL|1) /* data input available */
217 #define POLL_OUT (__SI_POLL|2) /* output buffers available */
218 #define POLL_MSG (__SI_POLL|3) /* input message available */
219 #define POLL_ERR (__SI_POLL|4) /* i/o error */
220 #define POLL_PRI (__SI_POLL|5) /* high priority input available */
221 #define POLL_HUP (__SI_POLL|6) /* device disconnected */
227 #define PROF_OVFL (__SI_PROF|1) /* some counters overflowed */
230 * sigevent definitions
232 * It seems likely that SIGEV_THREAD will have to be handled from userspace, libpthread
233 * transmuting it to SIGEV_SIGNAL, which the thread manager then catches and does the
234 * appropriate nonsense. However, everything is written out here so as to not get lost.
236 #define SIGEV_SIGNAL 0 /* notify via signal */
237 #define SIGEV_NONE 1 /* other notification: meaningless */
238 #define SIGEV_THREAD 2 /* deliver via thread creation */
240 #define SIGEV_MAX_SIZE 64
241 #define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
243 typedef struct sigevent {
244 sigval_t sigev_value;
248 int _pad[SIGEV_PAD_SIZE];
251 void (*_function)(sigval_t);
252 void *_attribute; /* really pthread_attr_t */
257 #define sigev_notify_function _sigev_un._sigev_thread._function
258 #define sigev_notify_attributes _sigev_un._sigev_thread._attribute
261 #include <linux/string.h>
264 copy_siginfo (siginfo_t *to, siginfo_t *from)
266 if (from->si_code < 0)
267 memcpy(to, from, sizeof(siginfo_t));
269 /* _sigprof is currently the largest know union member */
270 memcpy(to, from, 4*sizeof(int) + sizeof(from->_sifields._sigprof));
273 extern int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from);
274 extern int copy_siginfo_from_user(siginfo_t *to, siginfo_t *from);
276 #endif /* __KERNEL__ */
278 #endif /* _ASM_IA64_SIGINFO_H */