summaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/signal32.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-11-15 12:57:00 -0800
committerDavid S. Miller <davem@davemloft.net>2011-11-15 12:57:00 -0800
commite88d2468718b0789b4c33da2f7e1cef2a1eee279 (patch)
treebeb5a9eff292f1faa05eb9b96b7f1bd7815da131 /arch/sparc/kernel/signal32.c
parent1d299bc7732c34d85bd43ac1a8745f5a2fed2078 (diff)
sparc: Stash orig_i0 into %g6 instead of %g2
As per the comments added by this commit, %g2 turns out to not be a usable place to save away orig_i0 for syscall restart handling. In fact all of %g2, %g3, %g4, and %g5 are assumed to be saved across a system call by various bits of code in glibc. %g1 can't be used because that holds the syscall number, which would need to be saved and restored for syscall restart handling too, and that would only compound our problems :-) This leaves us with %g6 and %g7 which are for "system use". %g7 is used as the "thread register" by glibc, but %g6 is used as a compiler and assembler temporary scratch register. And in no instance is %g6 used to hold a value across a system call. Therefore %g6 is safe for storing away orig_i0, at least for now. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/signal32.c')
-rw-r--r--arch/sparc/kernel/signal32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c
index 2e86fd1ddc7..023b8860dc9 100644
--- a/arch/sparc/kernel/signal32.c
+++ b/arch/sparc/kernel/signal32.c
@@ -837,7 +837,7 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs)
if (pt_regs_is_syscall(regs) &&
(regs->tstate & (TSTATE_XCARRY | TSTATE_ICARRY))) {
restart_syscall = 1;
- orig_i0 = regs->u_regs[UREG_G2];
+ orig_i0 = regs->u_regs[UREG_G6];
}
if (signr > 0) {