Hexagon: Signal and return path fixes

This fixes the return value of sigreturn and moves the work pending check
into a c routine for readability and fixes the loop for multiple pending
signals.  Based on feedback from Al Viro.

Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
This commit is contained in:
Richard Kuo
2012-05-29 17:23:14 -05:00
parent 60c4ba99e0
commit a11e67c261
5 changed files with 86 additions and 90 deletions

View File

@@ -356,7 +356,6 @@ long sys_syscall(void)
void do_trap0(struct pt_regs *regs)
{
unsigned long syscallret = 0;
syscall_fn syscall;
switch (pt_cause(regs)) {
@@ -396,21 +395,11 @@ void do_trap0(struct pt_regs *regs)
} else {
syscall = (syscall_fn)
(sys_call_table[regs->syscall_nr]);
syscallret = syscall(regs->r00, regs->r01,
regs->r00 = syscall(regs->r00, regs->r01,
regs->r02, regs->r03,
regs->r04, regs->r05);
}
/*
* If it was a sigreturn system call, don't overwrite
* r0 value in stack frame with return value.
*
* __NR_sigreturn doesn't seem to exist in new unistd.h
*/
if (regs->syscall_nr != __NR_rt_sigreturn)
regs->r00 = syscallret;
/* allow strace to get the syscall return state */
if (unlikely(test_thread_flag(TIF_SYSCALL_TRACE)))
tracehook_report_syscall_exit(regs, 0);