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 static inline int __copy_conv_sigset_to_user(compat_sigset_t __user
*d
,
18 BUG_ON(sizeof(*d
) != sizeof(*s
));
19 BUG_ON(_NSIG_WORDS
!= 2);
21 err
= __put_user(s
->sig
[0], &d
->sig
[0]);
22 err
|= __put_user(s
->sig
[0] >> 32, &d
->sig
[1]);
23 err
|= __put_user(s
->sig
[1], &d
->sig
[2]);
24 err
|= __put_user(s
->sig
[1] >> 32, &d
->sig
[3]);
29 static inline int __copy_conv_sigset_from_user(sigset_t
*d
,
30 const compat_sigset_t __user
*s
)
36 } *u
= (union sigset_u
*) d
;
38 BUG_ON(sizeof(*d
) != sizeof(*s
));
39 BUG_ON(_NSIG_WORDS
!= 2);
41 #ifdef CONFIG_CPU_BIG_ENDIAN
42 err
= __get_user(u
->c
.sig
[1], &s
->sig
[0]);
43 err
|= __get_user(u
->c
.sig
[0], &s
->sig
[1]);
44 err
|= __get_user(u
->c
.sig
[3], &s
->sig
[2]);
45 err
|= __get_user(u
->c
.sig
[2], &s
->sig
[3]);
47 #ifdef CONFIG_CPU_LITTLE_ENDIAN
48 err
= __get_user(u
->c
.sig
[0], &s
->sig
[0]);
49 err
|= __get_user(u
->c
.sig
[1], &s
->sig
[1]);
50 err
|= __get_user(u
->c
.sig
[2], &s
->sig
[2]);
51 err
|= __get_user(u
->c
.sig
[3], &s
->sig
[3]);
57 #endif /* __ASM_COMPAT_SIGNAL_H */