Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Oct 2009 20:59:13 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r198731 - head/sys/powerpc/aim
Message-ID:  <200910312059.n9VKxDjG002787@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Sat Oct 31 20:59:13 2009
New Revision: 198731
URL: http://svn.freebsd.org/changeset/base/198731

Log:
  Unbreak cpu_switch(). The register allocator in my brain is clearly
  broken. Also, Altivec context switching worked before only by accident,
  but should work now by design.

Modified:
  head/sys/powerpc/aim/swtch.S

Modified: head/sys/powerpc/aim/swtch.S
==============================================================================
--- head/sys/powerpc/aim/swtch.S	Sat Oct 31 19:22:12 2009	(r198730)
+++ head/sys/powerpc/aim/swtch.S	Sat Oct 31 20:59:13 2009	(r198731)
@@ -99,17 +99,19 @@ ENTRY(cpu_switch)
 	mr	%r14,%r3		/* Copy the old thread ptr... */
 	mr	%r15,%r4		/* and the new thread ptr in scratch */
 	mr	%r16,%r5		/* and the new lock */
+	mr	%r17,%r6		/* and the PCB */
 	
-	lwz	%r6,PCB_FLAGS(%r5)
+	lwz	%r7,PCB_FLAGS(%r17)
 	/* Save FPU context if needed */
-	andi.	%r6, %r6, PCB_FPU
+	andi.	%r7, %r7, PCB_FPU
 	beq	.L1
 	bl	save_fpu
 
 .L1:
-	lwz	%r6,PCB_FLAGS(%r5)
+	mr	%r3,%r14		/* restore old thread ptr */
+	lwz	%r7,PCB_FLAGS(%r17)
 	/* Save Altivec context if needed */
-	andi.	%r6, %r6, PCB_VEC
+	andi.	%r7, %r7, PCB_VEC
 	beq	.L2
 	bl	save_vec
 	



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910312059.n9VKxDjG002787>