diff options
author | Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> | 2008-09-09 20:22:12 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-10 02:28:24 -0400 |
commit | 764e8d128f9343027cf09afe8a145e8ff186e129 (patch) | |
tree | 6e528651efcc484bdb34692e9750896ab4fb6893 /arch | |
parent | 0c40ed71736c20f447843b3c96b715bb9c4904d7 (diff) |
x86: signal_64.c: make handle_signal() similar
Make handle_signal() same as 32bit.
No change in functionality intended.
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/signal_64.c | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c index 321da93f2fb7..43e6862fc7a2 100644 --- a/arch/x86/kernel/signal_64.c +++ b/arch/x86/kernel/signal_64.c | |||
@@ -338,39 +338,40 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | |||
338 | 338 | ||
339 | ret = setup_rt_frame(sig, ka, info, oldset, regs); | 339 | ret = setup_rt_frame(sig, ka, info, oldset, regs); |
340 | 340 | ||
341 | if (ret == 0) { | 341 | if (ret) |
342 | /* | 342 | return ret; |
343 | * This has nothing to do with segment registers, | ||
344 | * despite the name. This magic affects uaccess.h | ||
345 | * macros' behavior. Reset it to the normal setting. | ||
346 | */ | ||
347 | set_fs(USER_DS); | ||
348 | 343 | ||
349 | /* | 344 | /* |
350 | * Clear the direction flag as per the ABI for function entry. | 345 | * This has nothing to do with segment registers, |
351 | */ | 346 | * despite the name. This magic affects uaccess.h |
352 | regs->flags &= ~X86_EFLAGS_DF; | 347 | * macros' behavior. Reset it to the normal setting. |
348 | */ | ||
349 | set_fs(USER_DS); | ||
353 | 350 | ||
354 | /* | 351 | /* |
355 | * Clear TF when entering the signal handler, but | 352 | * Clear the direction flag as per the ABI for function entry. |
356 | * notify any tracer that was single-stepping it. | 353 | */ |
357 | * The tracer may want to single-step inside the | 354 | regs->flags &= ~X86_EFLAGS_DF; |
358 | * handler too. | ||
359 | */ | ||
360 | regs->flags &= ~X86_EFLAGS_TF; | ||
361 | 355 | ||
362 | spin_lock_irq(¤t->sighand->siglock); | 356 | /* |
363 | sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); | 357 | * Clear TF when entering the signal handler, but |
364 | if (!(ka->sa.sa_flags & SA_NODEFER)) | 358 | * notify any tracer that was single-stepping it. |
365 | sigaddset(¤t->blocked, sig); | 359 | * The tracer may want to single-step inside the |
366 | recalc_sigpending(); | 360 | * handler too. |
367 | spin_unlock_irq(¤t->sighand->siglock); | 361 | */ |
362 | regs->flags &= ~X86_EFLAGS_TF; | ||
368 | 363 | ||
369 | tracehook_signal_handler(sig, info, ka, regs, | 364 | spin_lock_irq(¤t->sighand->siglock); |
370 | test_thread_flag(TIF_SINGLESTEP)); | 365 | sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); |
371 | } | 366 | if (!(ka->sa.sa_flags & SA_NODEFER)) |
367 | sigaddset(¤t->blocked, sig); | ||
368 | recalc_sigpending(); | ||
369 | spin_unlock_irq(¤t->sighand->siglock); | ||
372 | 370 | ||
373 | return ret; | 371 | tracehook_signal_handler(sig, info, ka, regs, |
372 | test_thread_flag(TIF_SINGLESTEP)); | ||
373 | |||
374 | return 0; | ||
374 | } | 375 | } |
375 | 376 | ||
376 | #define NR_restart_syscall \ | 377 | #define NR_restart_syscall \ |