* [PATCH] fix ppc32 sys_swapcontext
@ 2004-03-24 11:53 Paul Mackerras
0 siblings, 0 replies; only message in thread
From: Paul Mackerras @ 2004-03-24 11:53 UTC (permalink / raw)
To: akpm; +Cc: torvalds, trini, linux-kernel
The patch below 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. This patch fixes that.
Please apply.
Thanks,
Paul.
diff -urN pmac-2.5/arch/ppc/kernel/entry.S g5-ppc64/arch/ppc/kernel/entry.S
--- pmac-2.5/arch/ppc/kernel/entry.S 2004-02-16 08:19:48.000000000 +1100
+++ g5-ppc64/arch/ppc/kernel/entry.S 2004-03-24 09:47:12.000000000 +1100
@@ -414,6 +414,14 @@
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 -urN pmac-2.5/arch/ppc/kernel/misc.S g5-ppc64/arch/ppc/kernel/misc.S
--- pmac-2.5/arch/ppc/kernel/misc.S 2004-03-16 20:11:56.000000000 +1100
+++ g5-ppc64/arch/ppc/kernel/misc.S 2004-03-24 09:46:40.000000000 +1100
@@ -1363,7 +1363,7 @@
.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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-03-24 11:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-24 11:53 [PATCH] fix ppc32 sys_swapcontext Paul Mackerras
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®