]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sparc: Fix handling of orig_i0 wrt. debugging when restarting syscalls.
authorDavid S. Miller <davem@davemloft.net>
Mon, 26 Dec 2011 17:30:13 +0000 (12:30 -0500)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Tue, 10 Jan 2012 21:02:29 +0000 (13:02 -0800)
commit7e4f049053301606d9257b0c82851d2940a41eb2
tree43bb45bb74ecaa4a78127c0324121747443e76b8
parentfc2c726c02970de0d74d430ae00782ad9b951bc4
sparc: Fix handling of orig_i0 wrt. debugging when restarting syscalls.

[ A combination of upstream commits 1d299bc7732c34d85bd43ac1a8745f5a2fed2078 and
  e88d2468718b0789b4c33da2f7e1cef2a1eee279 ]

Although we provide a proper way for a debugger to control whether
syscall restart occurs, we run into problems because orig_i0 is not
saved and restored properly.

Luckily we can solve this problem without having to make debuggers
aware of the issue.  Across system calls, several registers are
considered volatile and can be safely clobbered.

Therefore we use the pt_regs save area of one of those registers, %g6,
as a place to save and restore orig_i0.

Debuggers transparently will do the right thing because they save and
restore this register already.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/sparc/kernel/signal32.c
arch/sparc/kernel/signal_32.c
arch/sparc/kernel/signal_64.c