summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2004-03-23 15:27:03 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-03-23 15:27:03 -0800
commitdb80df6ee8aa0883f1b51ed1996f5bb3ba7c4cbb (patch)
treebceb9dbd0f655d36b2ae911dac54c539b0d7b106 /arch
parent8685429773f88721b45176c45442ca3978e8597a (diff)
[PATCH] fix ppc32 sys_swapcontext
This fixes a bug in the swapcontext system call on ppc32. On ppc32, the system call entry only saves the volatile registers, except in the case of a few system calls (e.g. fork) which need all the registers saved. Swapcontext needs all the registers but we weren't saving them all. So fixes that.
Diffstat (limited to 'arch')
-rw-r--r--arch/ppc/kernel/entry.S8
-rw-r--r--arch/ppc/kernel/misc.S2
2 files changed, 9 insertions, 1 deletions
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index 9cc8c0174ad6..f4cba07bc75c 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -414,6 +414,14 @@ ppc_clone:
stw r0,TRAP(r1) /* register set saved */
b sys_clone
+ .globl ppc_swapcontext
+ppc_swapcontext:
+ SAVE_NVGPRS(r1)
+ lwz r0,TRAP(r1)
+ rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
+ stw r0,TRAP(r1) /* register set saved */
+ b sys_swapcontext
+
/*
* This routine switches between two different tasks. The process
* state of one is saved on its kernel stack. Then the state
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index 9d9023e0ff77..3f9b6a206937 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -1363,7 +1363,7 @@ _GLOBAL(sys_call_table)
.long sys_clock_gettime
.long sys_clock_getres
.long sys_clock_nanosleep
- .long sys_swapcontext
+ .long ppc_swapcontext
.long sys_tgkill /* 250 */
.long sys_utimes
.long sys_statfs64