Skip to content

Commit

Permalink
Blackfin arch: fix bug when sending signals with the wrong PC, cause …
Browse files Browse the repository at this point in the history
…gdb get confused

We need to send signals with the proper PC, or gdb gets
confused, and lots of tests fail. This should fix that.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
  • Loading branch information
Robin Getz authored and Bryan Wu committed Nov 21, 2007
1 parent 569a50c commit fb32291
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions arch/blackfin/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,18 +463,20 @@ asmlinkage void trap_c(struct pt_regs *fp)
#endif
panic("Kernel exception");
}

/* Ensure that bad return addresses don't end up in an infinite
* loop, due to speculative loads/reads
*/
if (trapnr == VEC_CPLB_I_M)
fp->pc = SAFE_USER_INSTRUCTION;
}

info.si_signo = sig;
info.si_errno = 0;
info.si_addr = (void *)fp->pc;
force_sig_info(sig, &info, current);

/* Ensure that bad return addresses don't end up in an infinite
* loop, due to speculative loads/reads. This needs to be done after
* the signal has been sent.
*/
if (trapnr == VEC_CPLB_I_M && sig != SIGTRAP)
fp->pc = SAFE_USER_INSTRUCTION;

trace_buffer_restore(j);
return;
}
Expand Down

0 comments on commit fb32291

Please sign in to comment.