diff options
author | Christoph Hellwig <hch@lst.de> | 2007-06-04 01:15:51 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-06-14 08:29:58 -0400 |
commit | db277e9a67b9d81b9d6cd74edf0c3e1a0ef2aa4b (patch) | |
tree | 288e98873d04c9a89b437f1a4a961acaebb90958 /arch | |
parent | 69d15f6b352a681f1db9bc70219a3e8e9d503dbf (diff) |
[POWERPC] Consolidate restore_sigmask
restore_sigmask is exactly the same on 32 and 64bit, so move it to
common code. Also move _BLOCKABLE to signal.h to avoid defining it
multiple times.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/signal.c | 15 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal.h | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal_32.c | 19 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal_64.c | 15 |
4 files changed, 18 insertions, 34 deletions
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c index 325d260abd4e..f92856b98b70 100644 --- a/arch/powerpc/kernel/signal.c +++ b/arch/powerpc/kernel/signal.c | |||
@@ -13,6 +13,21 @@ | |||
13 | #include <linux/signal.h> | 13 | #include <linux/signal.h> |
14 | #include <asm/unistd.h> | 14 | #include <asm/unistd.h> |
15 | 15 | ||
16 | #include "signal.h" | ||
17 | |||
18 | |||
19 | /* | ||
20 | * Restore the user process's signal mask | ||
21 | */ | ||
22 | void restore_sigmask(sigset_t *set) | ||
23 | { | ||
24 | sigdelsetmask(set, ~_BLOCKABLE); | ||
25 | spin_lock_irq(¤t->sighand->siglock); | ||
26 | current->blocked = *set; | ||
27 | recalc_sigpending(); | ||
28 | spin_unlock_irq(¤t->sighand->siglock); | ||
29 | } | ||
30 | |||
16 | void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka, | 31 | void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka, |
17 | int has_handler) | 32 | int has_handler) |
18 | { | 33 | { |
diff --git a/arch/powerpc/kernel/signal.h b/arch/powerpc/kernel/signal.h index 1e8dfb8620ad..4b091d8b764c 100644 --- a/arch/powerpc/kernel/signal.h +++ b/arch/powerpc/kernel/signal.h | |||
@@ -10,6 +10,9 @@ | |||
10 | #ifndef _POWERPC_ARCH_SIGNAL_H | 10 | #ifndef _POWERPC_ARCH_SIGNAL_H |
11 | #define _POWERPC_ARCH_SIGNAL_H | 11 | #define _POWERPC_ARCH_SIGNAL_H |
12 | 12 | ||
13 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
14 | |||
15 | extern void restore_sigmask(sigset_t *set); | ||
13 | extern void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka, | 16 | extern void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka, |
14 | int has_handler); | 17 | int has_handler); |
15 | 18 | ||
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index f5713bfcc56e..1d899a56fa13 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
@@ -55,8 +55,6 @@ | |||
55 | 55 | ||
56 | #undef DEBUG_SIG | 56 | #undef DEBUG_SIG |
57 | 57 | ||
58 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
59 | |||
60 | #ifdef CONFIG_PPC64 | 58 | #ifdef CONFIG_PPC64 |
61 | #define do_signal do_signal32 | 59 | #define do_signal do_signal32 |
62 | #define sys_sigsuspend compat_sys_sigsuspend | 60 | #define sys_sigsuspend compat_sys_sigsuspend |
@@ -697,23 +695,6 @@ int compat_sys_sigaltstack(u32 __new, u32 __old, int r5, | |||
697 | } | 695 | } |
698 | #endif /* CONFIG_PPC64 */ | 696 | #endif /* CONFIG_PPC64 */ |
699 | 697 | ||
700 | |||
701 | /* | ||
702 | * Restore the user process's signal mask | ||
703 | */ | ||
704 | #ifdef CONFIG_PPC64 | ||
705 | extern void restore_sigmask(sigset_t *set); | ||
706 | #else /* CONFIG_PPC64 */ | ||
707 | static void restore_sigmask(sigset_t *set) | ||
708 | { | ||
709 | sigdelsetmask(set, ~_BLOCKABLE); | ||
710 | spin_lock_irq(¤t->sighand->siglock); | ||
711 | current->blocked = *set; | ||
712 | recalc_sigpending(); | ||
713 | spin_unlock_irq(¤t->sighand->siglock); | ||
714 | } | ||
715 | #endif | ||
716 | |||
717 | /* | 698 | /* |
718 | * Set up a signal frame for a "real-time" signal handler | 699 | * Set up a signal frame for a "real-time" signal handler |
719 | * (one which gets siginfo). | 700 | * (one which gets siginfo). |
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 817f1cf4a405..7e9c4b7e7e82 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
@@ -38,8 +38,6 @@ | |||
38 | 38 | ||
39 | #define DEBUG_SIG 0 | 39 | #define DEBUG_SIG 0 |
40 | 40 | ||
41 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
42 | |||
43 | #define GP_REGS_SIZE min(sizeof(elf_gregset_t), sizeof(struct pt_regs)) | 41 | #define GP_REGS_SIZE min(sizeof(elf_gregset_t), sizeof(struct pt_regs)) |
44 | #define FP_REGS_SIZE sizeof(elf_fpregset_t) | 42 | #define FP_REGS_SIZE sizeof(elf_fpregset_t) |
45 | 43 | ||
@@ -243,19 +241,6 @@ static long setup_trampoline(unsigned int syscall, unsigned int __user *tramp) | |||
243 | } | 241 | } |
244 | 242 | ||
245 | /* | 243 | /* |
246 | * Restore the user process's signal mask (also used by signal32.c) | ||
247 | */ | ||
248 | void restore_sigmask(sigset_t *set) | ||
249 | { | ||
250 | sigdelsetmask(set, ~_BLOCKABLE); | ||
251 | spin_lock_irq(¤t->sighand->siglock); | ||
252 | current->blocked = *set; | ||
253 | recalc_sigpending(); | ||
254 | spin_unlock_irq(¤t->sighand->siglock); | ||
255 | } | ||
256 | |||
257 | |||
258 | /* | ||
259 | * Handle {get,set,swap}_context operations | 244 | * Handle {get,set,swap}_context operations |
260 | */ | 245 | */ |
261 | int sys_swapcontext(struct ucontext __user *old_ctx, | 246 | int sys_swapcontext(struct ucontext __user *old_ctx, |