diff options
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/entry.S | 12 | ||||
-rw-r--r-- | arch/sparc/kernel/ptrace.c | 26 | ||||
-rw-r--r-- | arch/sparc/kernel/rtrap.S | 5 | ||||
-rw-r--r-- | arch/sparc/kernel/signal.c | 16 |
4 files changed, 39 insertions, 20 deletions
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S index 2f96256dc515..e8cdf715a546 100644 --- a/arch/sparc/kernel/entry.S +++ b/arch/sparc/kernel/entry.S | |||
@@ -1196,8 +1196,9 @@ sys_rt_sigreturn: | |||
1196 | be 1f | 1196 | be 1f |
1197 | nop | 1197 | nop |
1198 | 1198 | ||
1199 | add %sp, STACKFRAME_SZ, %o0 | ||
1199 | call syscall_trace | 1200 | call syscall_trace |
1200 | nop | 1201 | mov 1, %o1 |
1201 | 1202 | ||
1202 | 1: | 1203 | 1: |
1203 | /* We are returning to a signal handler. */ | 1204 | /* We are returning to a signal handler. */ |
@@ -1287,8 +1288,12 @@ linux_fast_syscall: | |||
1287 | mov %i3, %o3 | 1288 | mov %i3, %o3 |
1288 | 1289 | ||
1289 | linux_syscall_trace: | 1290 | linux_syscall_trace: |
1291 | add %sp, STACKFRAME_SZ, %o0 | ||
1290 | call syscall_trace | 1292 | call syscall_trace |
1291 | nop | 1293 | mov 0, %o1 |
1294 | cmp %o0, 0 | ||
1295 | bne 3f | ||
1296 | mov -ENOSYS, %o0 | ||
1292 | mov %i0, %o0 | 1297 | mov %i0, %o0 |
1293 | mov %i1, %o1 | 1298 | mov %i1, %o1 |
1294 | mov %i2, %o2 | 1299 | mov %i2, %o2 |
@@ -1337,6 +1342,7 @@ syscall_is_too_hard: | |||
1337 | call %l7 | 1342 | call %l7 |
1338 | mov %i5, %o5 | 1343 | mov %i5, %o5 |
1339 | 1344 | ||
1345 | 3: | ||
1340 | st %o0, [%sp + STACKFRAME_SZ + PT_I0] | 1346 | st %o0, [%sp + STACKFRAME_SZ + PT_I0] |
1341 | 1347 | ||
1342 | ret_sys_call: | 1348 | ret_sys_call: |
@@ -1374,6 +1380,8 @@ ret_sys_call: | |||
1374 | st %l2, [%sp + STACKFRAME_SZ + PT_NPC] | 1380 | st %l2, [%sp + STACKFRAME_SZ + PT_NPC] |
1375 | 1381 | ||
1376 | linux_syscall_trace2: | 1382 | linux_syscall_trace2: |
1383 | add %sp, STACKFRAME_SZ, %o0 | ||
1384 | mov 1, %o1 | ||
1377 | call syscall_trace | 1385 | call syscall_trace |
1378 | add %l1, 0x4, %l2 /* npc = npc+4 */ | 1386 | add %l1, 0x4, %l2 /* npc = npc+4 */ |
1379 | st %l1, [%sp + STACKFRAME_SZ + PT_PC] | 1387 | st %l1, [%sp + STACKFRAME_SZ + PT_PC] |
diff --git a/arch/sparc/kernel/ptrace.c b/arch/sparc/kernel/ptrace.c index 81f3b929743f..20699c701412 100644 --- a/arch/sparc/kernel/ptrace.c +++ b/arch/sparc/kernel/ptrace.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/signal.h> | 21 | #include <linux/signal.h> |
22 | #include <linux/regset.h> | 22 | #include <linux/regset.h> |
23 | #include <linux/elf.h> | 23 | #include <linux/elf.h> |
24 | #include <linux/tracehook.h> | ||
24 | 25 | ||
25 | #include <asm/pgtable.h> | 26 | #include <asm/pgtable.h> |
26 | #include <asm/system.h> | 27 | #include <asm/system.h> |
@@ -450,21 +451,16 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
450 | return ret; | 451 | return ret; |
451 | } | 452 | } |
452 | 453 | ||
453 | asmlinkage void syscall_trace(void) | 454 | asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p) |
454 | { | 455 | { |
455 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | 456 | int ret = 0; |
456 | return; | 457 | |
457 | if (!(current->ptrace & PT_PTRACED)) | 458 | if (test_thread_flag(TIF_SYSCALL_TRACE)) { |
458 | return; | 459 | if (syscall_exit_p) |
459 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) | 460 | tracehook_report_syscall_exit(regs, 0); |
460 | ? 0x80 : 0)); | 461 | else |
461 | /* | 462 | ret = tracehook_report_syscall_entry(regs); |
462 | * this isn't the same as continuing with a signal, but it will do | ||
463 | * for normal use. strace only continues with a signal if the | ||
464 | * stopping signal is not SIGTRAP. -brl | ||
465 | */ | ||
466 | if (current->exit_code) { | ||
467 | send_sig (current->exit_code, current, 1); | ||
468 | current->exit_code = 0; | ||
469 | } | 463 | } |
464 | |||
465 | return ret; | ||
470 | } | 466 | } |
diff --git a/arch/sparc/kernel/rtrap.S b/arch/sparc/kernel/rtrap.S index 891f460b7b96..4da2e1f66290 100644 --- a/arch/sparc/kernel/rtrap.S +++ b/arch/sparc/kernel/rtrap.S | |||
@@ -69,12 +69,13 @@ ret_trap_lockless_ipi: | |||
69 | 69 | ||
70 | ld [%curptr + TI_FLAGS], %g2 | 70 | ld [%curptr + TI_FLAGS], %g2 |
71 | signal_p: | 71 | signal_p: |
72 | andcc %g2, (_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK), %g0 | 72 | andcc %g2, _TIF_DO_NOTIFY_RESUME_MASK, %g0 |
73 | bz,a ret_trap_continue | 73 | bz,a ret_trap_continue |
74 | ld [%sp + STACKFRAME_SZ + PT_PSR], %t_psr | 74 | ld [%sp + STACKFRAME_SZ + PT_PSR], %t_psr |
75 | 75 | ||
76 | mov %g2, %o2 | ||
76 | mov %l5, %o1 | 77 | mov %l5, %o1 |
77 | call do_signal | 78 | call do_notify_resume |
78 | add %sp, STACKFRAME_SZ, %o0 ! pt_regs ptr | 79 | add %sp, STACKFRAME_SZ, %o0 ! pt_regs ptr |
79 | 80 | ||
80 | /* Fall through. */ | 81 | /* Fall through. */ |
diff --git a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c index 3fd1df9f9ba7..c94f91c8b6e0 100644 --- a/arch/sparc/kernel/signal.c +++ b/arch/sparc/kernel/signal.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
19 | #include <linux/binfmts.h> /* do_coredum */ | 19 | #include <linux/binfmts.h> /* do_coredum */ |
20 | #include <linux/bitops.h> | 20 | #include <linux/bitops.h> |
21 | #include <linux/tracehook.h> | ||
21 | 22 | ||
22 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
23 | #include <asm/ptrace.h> | 24 | #include <asm/ptrace.h> |
@@ -513,7 +514,7 @@ static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs, | |||
513 | * want to handle. Thus you cannot kill init even with a SIGKILL even by | 514 | * want to handle. Thus you cannot kill init even with a SIGKILL even by |
514 | * mistake. | 515 | * mistake. |
515 | */ | 516 | */ |
516 | asmlinkage void do_signal(struct pt_regs * regs, unsigned long orig_i0) | 517 | static void do_signal(struct pt_regs *regs, unsigned long orig_i0) |
517 | { | 518 | { |
518 | struct k_sigaction ka; | 519 | struct k_sigaction ka; |
519 | int restart_syscall; | 520 | int restart_syscall; |
@@ -552,6 +553,8 @@ asmlinkage void do_signal(struct pt_regs * regs, unsigned long orig_i0) | |||
552 | */ | 553 | */ |
553 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | 554 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) |
554 | clear_thread_flag(TIF_RESTORE_SIGMASK); | 555 | clear_thread_flag(TIF_RESTORE_SIGMASK); |
556 | |||
557 | tracehook_signal_handler(signr, &info, &ka, regs, 0); | ||
555 | return; | 558 | return; |
556 | } | 559 | } |
557 | if (restart_syscall && | 560 | if (restart_syscall && |
@@ -579,6 +582,17 @@ asmlinkage void do_signal(struct pt_regs * regs, unsigned long orig_i0) | |||
579 | } | 582 | } |
580 | } | 583 | } |
581 | 584 | ||
585 | void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, | ||
586 | unsigned long thread_info_flags) | ||
587 | { | ||
588 | if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) | ||
589 | do_signal(regs, orig_i0); | ||
590 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { | ||
591 | clear_thread_flag(TIF_NOTIFY_RESUME); | ||
592 | tracehook_notify_resume(regs); | ||
593 | } | ||
594 | } | ||
595 | |||
582 | asmlinkage int | 596 | asmlinkage int |
583 | do_sys_sigstack(struct sigstack __user *ssptr, struct sigstack __user *ossptr, | 597 | do_sys_sigstack(struct sigstack __user *ssptr, struct sigstack __user *ossptr, |
584 | unsigned long sp) | 598 | unsigned long sp) |