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