diff options
author | Shi Weihua <shiwh@cn.fujitsu.com> | 2007-12-13 18:58:26 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2007-12-18 19:55:15 -0500 |
commit | 2018df76d276bb4fe97b175bd5db0cdd128dfeb4 (patch) | |
tree | f0b89e3d0be3ef7b6dce37370e7be10da76e952e /arch | |
parent | a3ebdb6c423dff420168a3faf25c76e9e5f59258 (diff) |
[IA64] signal: remove redundant code in setup_sigcontext()
This patch removes some redundant code in the function setup_sigcontext().
The registers ar.ccv,b7,r14,ar.csd,ar.ssd,r2-r3 and r16-r31 are not
restored in restore_sigcontext() when (flags & IA64_SC_FLAG_IN_SYSCALL) is
true. So we don't need to zero those variables in setup_sigcontext().
Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/kernel/signal.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c index 4c730099d58f..309da3567bc8 100644 --- a/arch/ia64/kernel/signal.c +++ b/arch/ia64/kernel/signal.c | |||
@@ -280,15 +280,7 @@ setup_sigcontext (struct sigcontext __user *sc, sigset_t *mask, struct sigscratc | |||
280 | err |= __copy_to_user(&sc->sc_gr[15], &scr->pt.r15, 8); /* r15 */ | 280 | err |= __copy_to_user(&sc->sc_gr[15], &scr->pt.r15, 8); /* r15 */ |
281 | err |= __put_user(scr->pt.cr_iip + ia64_psr(&scr->pt)->ri, &sc->sc_ip); | 281 | err |= __put_user(scr->pt.cr_iip + ia64_psr(&scr->pt)->ri, &sc->sc_ip); |
282 | 282 | ||
283 | if (flags & IA64_SC_FLAG_IN_SYSCALL) { | 283 | if (!(flags & IA64_SC_FLAG_IN_SYSCALL)) { |
284 | /* Clear scratch registers if the signal interrupted a system call. */ | ||
285 | err |= __put_user(0, &sc->sc_ar_ccv); /* ar.ccv */ | ||
286 | err |= __put_user(0, &sc->sc_br[7]); /* b7 */ | ||
287 | err |= __put_user(0, &sc->sc_gr[14]); /* r14 */ | ||
288 | err |= __clear_user(&sc->sc_ar25, 2*8); /* ar.csd & ar.ssd */ | ||
289 | err |= __clear_user(&sc->sc_gr[2], 2*8); /* r2-r3 */ | ||
290 | err |= __clear_user(&sc->sc_gr[16], 16*8); /* r16-r31 */ | ||
291 | } else { | ||
292 | /* Copy scratch regs to sigcontext if the signal didn't interrupt a syscall. */ | 284 | /* Copy scratch regs to sigcontext if the signal didn't interrupt a syscall. */ |
293 | err |= __put_user(scr->pt.ar_ccv, &sc->sc_ar_ccv); /* ar.ccv */ | 285 | err |= __put_user(scr->pt.ar_ccv, &sc->sc_ar_ccv); /* ar.ccv */ |
294 | err |= __put_user(scr->pt.b7, &sc->sc_br[7]); /* b7 */ | 286 | err |= __put_user(scr->pt.b7, &sc->sc_br[7]); /* b7 */ |