]> git.itanic.dy.fi Git - linux-stable/blob - include/asm-ia64/siginfo.h
Linux-2.6.12-rc2
[linux-stable] / include / asm-ia64 / siginfo.h
1 #ifndef _ASM_IA64_SIGINFO_H
2 #define _ASM_IA64_SIGINFO_H
3
4 /*
5  * Based on <asm-i386/siginfo.h>.
6  *
7  * Modified 1998-2002
8  *      David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
9  */
10
11 #define SI_PAD_SIZE     ((SI_MAX_SIZE/sizeof(int)) - 4)
12
13 #define SIGEV_PAD_SIZE  ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
14
15 #define HAVE_ARCH_SIGINFO_T
16 #define HAVE_ARCH_COPY_SIGINFO
17 #define HAVE_ARCH_COPY_SIGINFO_TO_USER
18
19 #include <asm-generic/siginfo.h>
20
21 typedef struct siginfo {
22         int si_signo;
23         int si_errno;
24         int si_code;
25         int __pad0;
26
27         union {
28                 int _pad[SI_PAD_SIZE];
29
30                 /* kill() */
31                 struct {
32                         pid_t _pid;             /* sender's pid */
33                         uid_t _uid;             /* sender's uid */
34                 } _kill;
35
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;
44
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;
51
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;
60
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;
68
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;
76
77 #define si_imm          _sifields._sigfault._imm        /* as per UNIX SysV ABI spec */
78 #define si_flags        _sifields._sigfault._flags
79 /*
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.
82  */
83 #define si_isr          _sifields._sigfault._isr
84
85 /*
86  * Flag values for si_flags:
87  */
88 #define __ISR_VALID_BIT 0
89 #define __ISR_VALID     (1 << __ISR_VALID_BIT)
90
91 /*
92  * SIGILL si_codes
93  */
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
99
100 /*
101  * SIGFPE si_codes
102  */
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
110
111 /*
112  * SIGSEGV si_codes
113  */
114 #define __SEGV_PSTKOVF  (__SI_FAULT|3)  /* paragraph stack overflow */
115 #undef NSIGSEGV
116 #define NSIGSEGV        3
117
118 /*
119  * SIGTRAP si_codes
120  */
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
125
126 #ifdef __KERNEL__
127 #include <linux/string.h>
128
129 static inline void
130 copy_siginfo (siginfo_t *to, siginfo_t *from)
131 {
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));
137 }
138
139 #endif /* __KERNEL__ */
140
141 #endif /* _ASM_IA64_SIGINFO_H */