Commit b170d219 authored by Ben Hutchings's avatar Ben Hutchings

signal: Define __ARCH_HAS_SA_RESTORER so we know whether to clear sa_restorer

flush_signal_handlers() needs to know whether sigaction::sa_restorer
is defined, not whether SA_RESTORER is defined.  Define the
__ARCH_HAS_SA_RESTORER macro to indicate this.

Vaguely based on upstream commit 574c4866 'consolidate kernel-side
struct sigaction declarations'.
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Cc: Al Viro <viro@zeniv.linux.org.uk>
parent 80a19deb
...@@ -127,6 +127,7 @@ struct sigaction { ...@@ -127,6 +127,7 @@ struct sigaction {
__sigrestore_t sa_restorer; __sigrestore_t sa_restorer;
sigset_t sa_mask; /* mask last for extensibility */ sigset_t sa_mask; /* mask last for extensibility */
}; };
#define __ARCH_HAS_SA_RESTORER
struct k_sigaction { struct k_sigaction {
struct sigaction sa; struct sigaction sa;
......
...@@ -128,6 +128,7 @@ struct sigaction { ...@@ -128,6 +128,7 @@ struct sigaction {
__sigrestore_t sa_restorer; __sigrestore_t sa_restorer;
sigset_t sa_mask; /* mask last for extensibility */ sigset_t sa_mask; /* mask last for extensibility */
}; };
#define __ARCH_HAS_SA_RESTORER
struct k_sigaction { struct k_sigaction {
struct sigaction sa; struct sigaction sa;
......
...@@ -122,6 +122,7 @@ struct sigaction { ...@@ -122,6 +122,7 @@ struct sigaction {
void (*sa_restorer)(void); void (*sa_restorer)(void);
sigset_t sa_mask; /* mask last for extensibility */ sigset_t sa_mask; /* mask last for extensibility */
}; };
#define __ARCH_HAS_SA_RESTORER
struct k_sigaction { struct k_sigaction {
struct sigaction sa; struct sigaction sa;
......
...@@ -121,6 +121,7 @@ struct sigaction { ...@@ -121,6 +121,7 @@ struct sigaction {
void (*sa_restorer)(void); void (*sa_restorer)(void);
sigset_t sa_mask; /* mask last for extensibility */ sigset_t sa_mask; /* mask last for extensibility */
}; };
#define __ARCH_HAS_SA_RESTORER
struct k_sigaction { struct k_sigaction {
struct sigaction sa; struct sigaction sa;
......
...@@ -123,6 +123,7 @@ struct sigaction { ...@@ -123,6 +123,7 @@ struct sigaction {
__sigrestore_t sa_restorer; __sigrestore_t sa_restorer;
sigset_t sa_mask; /* mask last for extensibility */ sigset_t sa_mask; /* mask last for extensibility */
}; };
#define __ARCH_HAS_SA_RESTORER
struct k_sigaction { struct k_sigaction {
struct sigaction sa; struct sigaction sa;
......
...@@ -119,6 +119,7 @@ struct sigaction { ...@@ -119,6 +119,7 @@ struct sigaction {
__sigrestore_t sa_restorer; __sigrestore_t sa_restorer;
sigset_t sa_mask; /* mask last for extensibility */ sigset_t sa_mask; /* mask last for extensibility */
}; };
#define __ARCH_HAS_SA_RESTORER
struct k_sigaction { struct k_sigaction {
struct sigaction sa; struct sigaction sa;
......
...@@ -131,6 +131,7 @@ struct sigaction { ...@@ -131,6 +131,7 @@ struct sigaction {
__sigrestore_t sa_restorer; __sigrestore_t sa_restorer;
sigset_t sa_mask; /* mask last for extensibility */ sigset_t sa_mask; /* mask last for extensibility */
}; };
#define __ARCH_HAS_SA_RESTORER
struct k_sigaction { struct k_sigaction {
struct sigaction sa; struct sigaction sa;
......
...@@ -109,6 +109,7 @@ struct sigaction { ...@@ -109,6 +109,7 @@ struct sigaction {
__sigrestore_t sa_restorer; __sigrestore_t sa_restorer;
sigset_t sa_mask; /* mask last for extensibility */ sigset_t sa_mask; /* mask last for extensibility */
}; };
#define __ARCH_HAS_SA_RESTORER
struct k_sigaction { struct k_sigaction {
struct sigaction sa; struct sigaction sa;
......
...@@ -131,6 +131,7 @@ struct sigaction { ...@@ -131,6 +131,7 @@ struct sigaction {
void (*sa_restorer)(void); void (*sa_restorer)(void);
sigset_t sa_mask; /* mask last for extensibility */ sigset_t sa_mask; /* mask last for extensibility */
}; };
#define __ARCH_HAS_SA_RESTORER
struct k_sigaction { struct k_sigaction {
struct sigaction sa; struct sigaction sa;
......
...@@ -191,6 +191,7 @@ struct __old_sigaction { ...@@ -191,6 +191,7 @@ struct __old_sigaction {
unsigned long sa_flags; unsigned long sa_flags;
void (*sa_restorer)(void); /* not used by Linux/SPARC yet */ void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
}; };
#define __ARCH_HAS_SA_RESTORER
typedef struct sigaltstack { typedef struct sigaltstack {
void __user *ss_sp; void __user *ss_sp;
......
...@@ -125,6 +125,8 @@ typedef unsigned long sigset_t; ...@@ -125,6 +125,8 @@ typedef unsigned long sigset_t;
extern void do_notify_resume(struct pt_regs *, void *, __u32); extern void do_notify_resume(struct pt_regs *, void *, __u32);
# endif /* __KERNEL__ */ # endif /* __KERNEL__ */
#define __ARCH_HAS_SA_RESTORER
#ifdef __i386__ #ifdef __i386__
# ifdef __KERNEL__ # ifdef __KERNEL__
struct old_sigaction { struct old_sigaction {
......
...@@ -133,6 +133,7 @@ struct sigaction { ...@@ -133,6 +133,7 @@ struct sigaction {
void (*sa_restorer)(void); void (*sa_restorer)(void);
sigset_t sa_mask; /* mask last for extensibility */ sigset_t sa_mask; /* mask last for extensibility */
}; };
#define __ARCH_HAS_SA_RESTORER
struct k_sigaction { struct k_sigaction {
struct sigaction sa; struct sigaction sa;
......
...@@ -99,6 +99,10 @@ typedef unsigned long old_sigset_t; ...@@ -99,6 +99,10 @@ typedef unsigned long old_sigset_t;
#include <asm-generic/signal-defs.h> #include <asm-generic/signal-defs.h>
#ifdef SA_RESTORER
#define __ARCH_HAS_SA_RESTORER
#endif
struct sigaction { struct sigaction {
__sighandler_t sa_handler; __sighandler_t sa_handler;
unsigned long sa_flags; unsigned long sa_flags;
......
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