1 #ifndef __ASM_COMPAT_SIGNAL_H
2 #define __ASM_COMPAT_SIGNAL_H
5 #include <linux/compat.h>
6 #include <linux/compiler.h>
8 #include <asm/signal.h>
9 #include <asm/siginfo.h>
11 #include <asm/uaccess.h>
13 #define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3)
15 typedef struct compat_siginfo
{
21 int _pad
[SI_PAD_SIZE32
];
25 compat_pid_t _pid
; /* sender's pid */
26 compat_uid_t _uid
; /* sender's uid */
31 compat_pid_t _pid
; /* which child */
32 compat_uid_t _uid
; /* sender's uid */
33 int _status
; /* exit code */
34 compat_clock_t _utime
;
35 compat_clock_t _stime
;
40 compat_pid_t _pid
; /* which child */
41 compat_clock_t _utime
;
42 int _status
; /* exit code */
43 compat_clock_t _stime
;
46 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
48 s32 _addr
; /* faulting insn/memory ref. */
51 /* SIGPOLL, SIGXFSZ (To do ...) */
53 int _band
; /* POLL_IN, POLL_OUT, POLL_MSG */
59 timer_t _tid
; /* timer id */
60 int _overrun
; /* overrun count */
61 compat_sigval_t _sigval
;/* same as below */
62 int _sys_private
; /* not to be passed to user */
65 /* POSIX.1b signals */
67 compat_pid_t _pid
; /* sender's pid */
68 compat_uid_t _uid
; /* sender's uid */
69 compat_sigval_t _sigval
;
75 static inline int __copy_conv_sigset_to_user(compat_sigset_t __user
*d
,
80 BUG_ON(sizeof(*d
) != sizeof(*s
));
81 BUG_ON(_NSIG_WORDS
!= 2);
83 err
= __put_user(s
->sig
[0], &d
->sig
[0]);
84 err
|= __put_user(s
->sig
[0] >> 32, &d
->sig
[1]);
85 err
|= __put_user(s
->sig
[1], &d
->sig
[2]);
86 err
|= __put_user(s
->sig
[1] >> 32, &d
->sig
[3]);
91 static inline int __copy_conv_sigset_from_user(sigset_t
*d
,
92 const compat_sigset_t __user
*s
)
98 } *u
= (union sigset_u
*) d
;
100 BUG_ON(sizeof(*d
) != sizeof(*s
));
101 BUG_ON(_NSIG_WORDS
!= 2);
103 #ifdef CONFIG_CPU_BIG_ENDIAN
104 err
= __get_user(u
->c
.sig
[1], &s
->sig
[0]);
105 err
|= __get_user(u
->c
.sig
[0], &s
->sig
[1]);
106 err
|= __get_user(u
->c
.sig
[3], &s
->sig
[2]);
107 err
|= __get_user(u
->c
.sig
[2], &s
->sig
[3]);
109 #ifdef CONFIG_CPU_LITTLE_ENDIAN
110 err
= __get_user(u
->c
.sig
[0], &s
->sig
[0]);
111 err
|= __get_user(u
->c
.sig
[1], &s
->sig
[1]);
112 err
|= __get_user(u
->c
.sig
[2], &s
->sig
[2]);
113 err
|= __get_user(u
->c
.sig
[3], &s
->sig
[3]);
119 #endif /* __ASM_COMPAT_SIGNAL_H */