diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-25 19:30:53 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-03 18:15:53 -0500 |
commit | eb2f256682e5af4b890d1f3cce4a4d4b62ffa655 (patch) | |
tree | dde04f6f419c6157938420de669830f5b789da94 | |
parent | 86df89a0845a80aa765f3e5e0da43fdf9287029f (diff) |
cris: switch to generic old sigaction()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | arch/cris/Kconfig | 1 | ||||
-rw-r--r-- | arch/cris/arch-v10/kernel/signal.c | 31 | ||||
-rw-r--r-- | arch/cris/arch-v32/kernel/signal.c | 36 | ||||
-rw-r--r-- | arch/cris/include/asm/signal.h | 7 |
4 files changed, 1 insertions, 74 deletions
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 686968c10897..c2a1d0a8924c 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig | |||
@@ -52,6 +52,7 @@ config CRIS | |||
52 | select CLONE_BACKWARDS2 | 52 | select CLONE_BACKWARDS2 |
53 | select GENERIC_SIGALTSTACK | 53 | select GENERIC_SIGALTSTACK |
54 | select OLD_SIGSUSPEND | 54 | select OLD_SIGSUSPEND |
55 | select OLD_SIGACTION | ||
55 | 56 | ||
56 | config HZ | 57 | config HZ |
57 | int | 58 | int |
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c index e53c1b455c35..090e9c64408b 100644 --- a/arch/cris/arch-v10/kernel/signal.c +++ b/arch/cris/arch-v10/kernel/signal.c | |||
@@ -41,37 +41,6 @@ | |||
41 | 41 | ||
42 | void do_signal(int canrestart, struct pt_regs *regs); | 42 | void do_signal(int canrestart, struct pt_regs *regs); |
43 | 43 | ||
44 | int sys_sigaction(int sig, const struct old_sigaction __user *act, | ||
45 | struct old_sigaction *oact) | ||
46 | { | ||
47 | struct k_sigaction new_ka, old_ka; | ||
48 | int ret; | ||
49 | |||
50 | if (act) { | ||
51 | old_sigset_t mask; | ||
52 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
53 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | ||
54 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || | ||
55 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | ||
56 | __get_user(mask, &act->sa_mask)) | ||
57 | return -EFAULT; | ||
58 | siginitset(&new_ka.sa.sa_mask, mask); | ||
59 | } | ||
60 | |||
61 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | ||
62 | |||
63 | if (!ret && oact) { | ||
64 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
65 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | ||
66 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || | ||
67 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | ||
68 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
69 | return -EFAULT; | ||
70 | } | ||
71 | |||
72 | return ret; | ||
73 | } | ||
74 | |||
75 | /* | 44 | /* |
76 | * Do a signal return; undo the signal stack. | 45 | * Do a signal return; undo the signal stack. |
77 | */ | 46 | */ |
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c index 4ccf144b49a9..cee740732d1f 100644 --- a/arch/cris/arch-v32/kernel/signal.c +++ b/arch/cris/arch-v32/kernel/signal.c | |||
@@ -52,42 +52,6 @@ void do_signal(int restart, struct pt_regs *regs); | |||
52 | void keep_debug_flags(unsigned long oldccs, unsigned long oldspc, | 52 | void keep_debug_flags(unsigned long oldccs, unsigned long oldspc, |
53 | struct pt_regs *regs); | 53 | struct pt_regs *regs); |
54 | 54 | ||
55 | int | ||
56 | sys_sigaction(int signal, const struct old_sigaction *act, | ||
57 | struct old_sigaction *oact) | ||
58 | { | ||
59 | int retval; | ||
60 | struct k_sigaction newk; | ||
61 | struct k_sigaction oldk; | ||
62 | |||
63 | if (act) { | ||
64 | old_sigset_t mask; | ||
65 | |||
66 | if (!access_ok(VERIFY_READ, act, sizeof(*act)) || | ||
67 | __get_user(newk.sa.sa_handler, &act->sa_handler) || | ||
68 | __get_user(newk.sa.sa_restorer, &act->sa_restorer) || | ||
69 | __get_user(newk.sa.sa_flags, &act->sa_flags) || | ||
70 | __get_user(mask, &act->sa_mask)) | ||
71 | return -EFAULT; | ||
72 | |||
73 | siginitset(&newk.sa.sa_mask, mask); | ||
74 | } | ||
75 | |||
76 | retval = do_sigaction(signal, act ? &newk : NULL, oact ? &oldk : NULL); | ||
77 | |||
78 | if (!retval && oact) { | ||
79 | if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || | ||
80 | __put_user(oldk.sa.sa_handler, &oact->sa_handler) || | ||
81 | __put_user(oldk.sa.sa_restorer, &oact->sa_restorer) || | ||
82 | __put_user(oldk.sa.sa_flags, &oact->sa_flags) || | ||
83 | __put_user(oldk.sa.sa_mask.sig[0], &oact->sa_mask)) | ||
84 | return -EFAULT; | ||
85 | |||
86 | } | ||
87 | |||
88 | return retval; | ||
89 | } | ||
90 | |||
91 | static int | 55 | static int |
92 | restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) | 56 | restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) |
93 | { | 57 | { |
diff --git a/arch/cris/include/asm/signal.h b/arch/cris/include/asm/signal.h index b3650ab2c320..c11b8745cece 100644 --- a/arch/cris/include/asm/signal.h +++ b/arch/cris/include/asm/signal.h | |||
@@ -16,13 +16,6 @@ typedef struct { | |||
16 | unsigned long sig[_NSIG_WORDS]; | 16 | unsigned long sig[_NSIG_WORDS]; |
17 | } sigset_t; | 17 | } sigset_t; |
18 | 18 | ||
19 | struct old_sigaction { | ||
20 | __sighandler_t sa_handler; | ||
21 | old_sigset_t sa_mask; | ||
22 | unsigned long sa_flags; | ||
23 | void (*sa_restorer)(void); | ||
24 | }; | ||
25 | |||
26 | #define __ARCH_HAS_SA_RESTORER | 19 | #define __ARCH_HAS_SA_RESTORER |
27 | 20 | ||
28 | #include <asm/sigcontext.h> | 21 | #include <asm/sigcontext.h> |