mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: akpm@osdl.org
Cc: torvalds@osdl.org, trini@kernel.crashing.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] fix ppc32 sys_swapcontext
Date: Wed, 24 Mar 2004 22:53:33 +1100	[thread overview]
Message-ID: <16481.30397.114257.314001@cargo.ozlabs.ibm.com> (raw)

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

                 reply	other threads:[~2004-03-24 11:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16481.30397.114257.314001@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=trini@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®