Commit 2feb6f04 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Linus Torvalds

[PATCH] add and use COMPAT_SIGEV_PAD_SIZE

All the 32 bit architectures (effectively) define SIGEV_PAD_SIZE to be
((SIGEV_MAX_SIZE/sizeof(int)) - 3).  So define COMPAT_SIGEV_PAD_SIZE to be
this and replace SIGEV_PAD_SIZE32 where it is used.  It also needs to be
used in the definition of struct compat_sigevent as most of the
architectures would have had it 4 bytes too small in the kernel (since we
were using SIGEV_PAD_SIZE).
Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f9e697a2
......@@ -230,8 +230,6 @@ typedef union sigval32 {
unsigned int sival_ptr;
} sigval_t32;
#define SIGEV_PAD_SIZE32 ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
typedef struct compat_siginfo {
int si_signo;
int si_errno;
......@@ -289,7 +287,7 @@ typedef struct sigevent32 {
int sigev_signo;
int sigev_notify;
union {
int _pad[SIGEV_PAD_SIZE32];
int _pad[COMPAT_SIGEV_PAD_SIZE];
struct {
u32 _function;
u32 _attribute; /* really pthread_attr_t */
......
......@@ -199,7 +199,6 @@ struct ucontext32 {
compat_sigset_t uc_sigmask; /* mask last for extensibility */
};
#define SIGEV_PAD_SIZE32 ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
struct sigevent32 {
union {
int sival_int;
......@@ -208,7 +207,7 @@ struct sigevent32 {
int sigev_signo;
int sigev_notify;
union {
int _pad[SIGEV_PAD_SIZE32];
int _pad[COMPAT_SIGEV_PAD_SIZE];
int _tid;
struct {
u32 *_function;
......
......@@ -4,7 +4,6 @@
#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3)
#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
#define SIGEV_PAD_SIZE32 ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
#define __ARCH_SI_TRAPNO
......@@ -47,7 +46,7 @@ typedef struct sigevent32 {
int sigev_signo;
int sigev_notify;
union {
int _pad[SIGEV_PAD_SIZE32];
int _pad[COMPAT_SIGEV_PAD_SIZE];
struct {
u32 _function;
......
......@@ -101,12 +101,14 @@ typedef union compat_sigval {
compat_uptr_t sival_ptr;
} compat_sigval_t;
#define COMPAT_SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
typedef struct compat_sigevent {
compat_sigval_t sigev_value;
compat_int_t sigev_signo;
compat_int_t sigev_notify;
union {
compat_int_t _pad[SIGEV_PAD_SIZE];
compat_int_t _pad[COMPAT_SIGEV_PAD_SIZE];
compat_int_t _tid;
struct {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment