uClibc: add a whole bunch of mips64 related fixes
[openwrt.git] / toolchain / uClibc / patches-0.9.33.2 / 615-mips_fix_sigev_pad_size.patch
1 commit b97b4b698b023f75b54f987859c856ab4861ea00
2 Author: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
3 Date:   Thu Jan 2 15:02:12 2014 +0000
4
5     siginfo.h: __SIGEV_PAD_SIZE takes __WORDSIZE into account
6     
7     Make __SIGEV_PAD_SIZE to take __WORDSIZE into account for alpha, mips
8     and ia64 arches.
9     
10     Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
11     Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12
13 --- a/libc/sysdeps/linux/alpha/bits/siginfo.h
14 +++ b/libc/sysdeps/linux/alpha/bits/siginfo.h
15 @@ -258,7 +258,11 @@ enum
16  
17  /* Structure to transport application-defined values with signals.  */
18  # define __SIGEV_MAX_SIZE      64
19 -# define __SIGEV_PAD_SIZE      ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
20 +# if __WORDSIZE == 64
21 +#  define __SIGEV_PAD_SIZE     ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
22 +# else
23 +#  define __SIGEV_PAD_SIZE     ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
24 +# endif
25  
26  typedef struct sigevent
27    {
28 --- a/libc/sysdeps/linux/ia64/bits/siginfo.h
29 +++ b/libc/sysdeps/linux/ia64/bits/siginfo.h
30 @@ -298,7 +298,11 @@ enum
31  
32  /* Structure to transport application-defined values with signals.  */
33  # define __SIGEV_MAX_SIZE      64
34 -# define __SIGEV_PAD_SIZE      ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
35 +# if __WORDSIZE == 64
36 +#  define __SIGEV_PAD_SIZE     ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
37 +# else
38 +#  define __SIGEV_PAD_SIZE     ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
39 +# endif
40  
41  typedef struct sigevent
42    {
43 --- a/libc/sysdeps/linux/mips/bits/siginfo.h
44 +++ b/libc/sysdeps/linux/mips/bits/siginfo.h
45 @@ -265,8 +265,11 @@ enum
46  
47  /* Structure to transport application-defined values with signals.  */
48  # define __SIGEV_MAX_SIZE      64
49 -# define __SIGEV_HEAD_SIZE     (sizeof(long) + 2*sizeof(int))
50 -# define __SIGEV_PAD_SIZE      ((__SIGEV_MAX_SIZE - __SIGEV_HEAD_SIZE) / sizeof (int))
51 +# if __WORDSIZE == 64
52 +#  define __SIGEV_PAD_SIZE     ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
53 +# else
54 +#  define __SIGEV_PAD_SIZE     ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
55 +# endif
56  
57  /* Forward declaration of the `pthread_attr_t' type.  */
58  struct __pthread_attr_s;