Skip to content

Commit a134d22

Browse files
arch/tile: apply commit 74fca9d to the compat signal handling as well
This passes siginfo and mcontext to tilegx32 signal handlers that don't have SA_SIGINFO set just as we have been doing for tilegx64. Cc: [email protected] Signed-off-by: Chris Metcalf <[email protected]>
1 parent fc327e2 commit a134d22

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

arch/tile/kernel/compat_signal.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -403,19 +403,17 @@ int compat_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
403403
* Set up registers for signal handler.
404404
* Registers that we don't modify keep the value they had from
405405
* user-space at the time we took the signal.
406+
* We always pass siginfo and mcontext, regardless of SA_SIGINFO,
407+
* since some things rely on this (e.g. glibc's debug/segfault.c).
406408
*/
407409
regs->pc = ptr_to_compat_reg(ka->sa.sa_handler);
408410
regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */
409411
regs->sp = ptr_to_compat_reg(frame);
410412
regs->lr = restorer;
411413
regs->regs[0] = (unsigned long) usig;
412-
413-
if (ka->sa.sa_flags & SA_SIGINFO) {
414-
/* Need extra arguments, so mark to restore caller-saves. */
415-
regs->regs[1] = ptr_to_compat_reg(&frame->info);
416-
regs->regs[2] = ptr_to_compat_reg(&frame->uc);
417-
regs->flags |= PT_FLAGS_CALLER_SAVES;
418-
}
414+
regs->regs[1] = ptr_to_compat_reg(&frame->info);
415+
regs->regs[2] = ptr_to_compat_reg(&frame->uc);
416+
regs->flags |= PT_FLAGS_CALLER_SAVES;
419417

420418
/*
421419
* Notify any tracer that was single-stepping it.

0 commit comments

Comments
 (0)