Linux-2.6.12-rc2
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / asm-ia64 / siginfo.h
blobd55f139cbcdce37c9db418881029555287758f9b
1 #ifndef _ASM_IA64_SIGINFO_H
2 #define _ASM_IA64_SIGINFO_H
4 /*
5 * Based on <asm-i386/siginfo.h>.
7 * Modified 1998-2002
8 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
9 */
11 #define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 4)
13 #define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
15 #define HAVE_ARCH_SIGINFO_T
16 #define HAVE_ARCH_COPY_SIGINFO
17 #define HAVE_ARCH_COPY_SIGINFO_TO_USER
19 #include <asm-generic/siginfo.h>
21 typedef struct siginfo {
22 int si_signo;
23 int si_errno;
24 int si_code;
25 int __pad0;
27 union {
28 int _pad[SI_PAD_SIZE];
30 /* kill() */
31 struct {
32 pid_t _pid; /* sender's pid */
33 uid_t _uid; /* sender's uid */
34 } _kill;
36 /* POSIX.1b timers */
37 struct {
38 timer_t _tid; /* timer id */
39 int _overrun; /* overrun count */
40 char _pad[sizeof(__ARCH_SI_UID_T) - sizeof(int)];
41 sigval_t _sigval; /* must overlay ._rt._sigval! */
42 int _sys_private; /* not to be passed to user */
43 } _timer;
45 /* POSIX.1b signals */
46 struct {
47 pid_t _pid; /* sender's pid */
48 uid_t _uid; /* sender's uid */
49 sigval_t _sigval;
50 } _rt;
52 /* SIGCHLD */
53 struct {
54 pid_t _pid; /* which child */
55 uid_t _uid; /* sender's uid */
56 int _status; /* exit code */
57 clock_t _utime;
58 clock_t _stime;
59 } _sigchld;
61 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
62 struct {
63 void __user *_addr; /* faulting insn/memory ref. */
64 int _imm; /* immediate value for "break" */
65 unsigned int _flags; /* see below */
66 unsigned long _isr; /* isr */
67 } _sigfault;
69 /* SIGPOLL */
70 struct {
71 long _band; /* POLL_IN, POLL_OUT, POLL_MSG (XPG requires a "long") */
72 int _fd;
73 } _sigpoll;
74 } _sifields;
75 } siginfo_t;
77 #define si_imm _sifields._sigfault._imm /* as per UNIX SysV ABI spec */
78 #define si_flags _sifields._sigfault._flags
80 * si_isr is valid for SIGILL, SIGFPE, SIGSEGV, SIGBUS, and SIGTRAP provided that
81 * si_code is non-zero and __ISR_VALID is set in si_flags.
83 #define si_isr _sifields._sigfault._isr
86 * Flag values for si_flags:
88 #define __ISR_VALID_BIT 0
89 #define __ISR_VALID (1 << __ISR_VALID_BIT)
92 * SIGILL si_codes
94 #define ILL_BADIADDR (__SI_FAULT|9) /* unimplemented instruction address */
95 #define __ILL_BREAK (__SI_FAULT|10) /* illegal break */
96 #define __ILL_BNDMOD (__SI_FAULT|11) /* bundle-update (modification) in progress */
97 #undef NSIGILL
98 #define NSIGILL 11
101 * SIGFPE si_codes
103 #define __FPE_DECOVF (__SI_FAULT|9) /* decimal overflow */
104 #define __FPE_DECDIV (__SI_FAULT|10) /* decimal division by zero */
105 #define __FPE_DECERR (__SI_FAULT|11) /* packed decimal error */
106 #define __FPE_INVASC (__SI_FAULT|12) /* invalid ASCII digit */
107 #define __FPE_INVDEC (__SI_FAULT|13) /* invalid decimal digit */
108 #undef NSIGFPE
109 #define NSIGFPE 13
112 * SIGSEGV si_codes
114 #define __SEGV_PSTKOVF (__SI_FAULT|3) /* paragraph stack overflow */
115 #undef NSIGSEGV
116 #define NSIGSEGV 3
119 * SIGTRAP si_codes
121 #define TRAP_BRANCH (__SI_FAULT|3) /* process taken branch trap */
122 #define TRAP_HWBKPT (__SI_FAULT|4) /* hardware breakpoint or watchpoint */
123 #undef NSIGTRAP
124 #define NSIGTRAP 4
126 #ifdef __KERNEL__
127 #include <linux/string.h>
129 static inline void
130 copy_siginfo (siginfo_t *to, siginfo_t *from)
132 if (from->si_code < 0)
133 memcpy(to, from, sizeof(siginfo_t));
134 else
135 /* _sigchld is currently the largest know union member */
136 memcpy(to, from, 4*sizeof(int) + sizeof(from->_sifields._sigchld));
139 #endif /* __KERNEL__ */
141 #endif /* _ASM_IA64_SIGINFO_H */