patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / include / asm-sparc64 / siginfo.h
1 #ifndef _SPARC64_SIGINFO_H
2 #define _SPARC64_SIGINFO_H
3
4 #define SI_PAD_SIZE32   ((SI_MAX_SIZE/sizeof(int)) - 3)
5
6 #define SIGEV_PAD_SIZE  ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
7 #define SIGEV_PAD_SIZE32 ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
8
9 #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
10 #define __ARCH_SI_TRAPNO
11 #define __ARCH_SI_BAND_T int
12
13 #include <asm-generic/siginfo.h>
14
15 #ifdef __KERNEL__
16
17 #include <linux/compat.h>
18
19 typedef union sigval32 {
20         int sival_int;
21         u32 sival_ptr;
22 } sigval_t32;
23
24 typedef struct siginfo32 {
25         int si_signo;
26         int si_errno;
27         int si_code;
28
29         union {
30                 int _pad[SI_PAD_SIZE32];
31
32                 /* kill() */
33                 struct {
34                         compat_pid_t _pid;              /* sender's pid */
35                         unsigned int _uid;              /* sender's uid */
36                 } _kill;
37
38                 /* POSIX.1b timers */
39                 struct {
40                         timer_t _tid;                   /* timer id */
41                         int _overrun;                   /* overrun count */
42                         sigval_t32 _sigval;             /* same as below */
43                         int _sys_private;               /* not to be passed to user */
44                 } _timer;
45
46                 /* POSIX.1b signals */
47                 struct {
48                         compat_pid_t _pid;              /* sender's pid */
49                         unsigned int _uid;              /* sender's uid */
50                         sigval_t32 _sigval;
51                 } _rt;
52
53                 /* SIGCHLD */
54                 struct {
55                         compat_pid_t _pid;              /* which child */
56                         unsigned int _uid;              /* sender's uid */
57                         int _status;                    /* exit code */
58                         compat_clock_t _utime;
59                         compat_clock_t _stime;
60                 } _sigchld;
61
62                 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
63                 struct {
64                         u32 _addr; /* faulting insn/memory ref. */
65                         int _trapno;
66                 } _sigfault;
67
68                 /* SIGPOLL */
69                 struct {
70                         int _band;      /* POLL_IN, POLL_OUT, POLL_MSG */
71                         int _fd;
72                 } _sigpoll;
73         } _sifields;
74 } siginfo_t32;
75
76 #endif /* __KERNEL__ */
77
78 #define SI_NOINFO       32767           /* no information in siginfo_t */
79
80 /*
81  * SIGEMT si_codes
82  */
83 #define EMT_TAGOVF      (__SI_FAULT|1)  /* tag overflow */
84 #define NSIGEMT         1
85
86 #ifdef __KERNEL__
87
88 typedef struct sigevent32 {
89         sigval_t32 sigev_value;
90         int sigev_signo;
91         int sigev_notify;
92         union {
93                 int _pad[SIGEV_PAD_SIZE32];
94
95                 struct {
96                         u32 _function;
97                         u32 _attribute; /* really pthread_attr_t */
98                 } _sigev_thread;
99         } _sigev_un;
100 } sigevent_t32;
101
102 extern int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from);
103
104 #endif /* __KERNEL__ */
105
106 #endif