Blackfin arch: fix signal handling bug
authorBernd Schmidt <bernd.schmidt@analog.com>
Mon, 21 May 2007 10:09:33 +0000 (18:09 +0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 21 May 2007 16:50:23 +0000 (09:50 -0700)
commitc824498db47285aeff430c007685a193b673c949
tree685e3736b978199da0588ad14b7e24ee2b7c8d0a
parenta9c59c2746c7e773839d51027c0e16ccf41f8fef
Blackfin arch: fix signal handling bug

There's a forum thread at
https://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&_forum_action=MessageReply&message_id=24741

which has a testcase involving signal handling that crashes quite readily.
Inspecting the code I believe what happens is that signal handling can become
confused when it is invoked on return from an interrupt, if the contents of
P0 and R0 at the time of the interrupt happen to be such that P0 is larger
than zero (indicating to the signal code that we're in a syscall), and R0
happens to have a value of something like -EINTR or -ERESTARTSYS.
Fixed by setting orig_p0 to -1 if we're returning from an interrupt.  The
testcase now seems to run without problems.

Signed-off-by: Bernd Schmidt <bernd.schmidt@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/blackfin/mach-common/entry.S