]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix ppc32 sys_swapcontext
authorPaul Mackerras <paulus@samba.org>
Tue, 23 Mar 2004 23:27:03 +0000 (15:27 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 23 Mar 2004 23:27:03 +0000 (15:27 -0800)
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.

arch/ppc/kernel/entry.S
arch/ppc/kernel/misc.S

index 9cc8c0174ad632ac26f9545b95c7d32629d9974f..f4cba07bc75c04064b6b9d2fe671f163f8db1366 100644 (file)
@@ -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
index 9d9023e0ff772817640d7b2410cd19b4db4bc4ae..3f9b6a206937d1b50eb05a3671a40a8bebbc5d4b 100644 (file)
@@ -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