svn commit: r191376 - head/sys/powerpc/booke

Rafal Jaworowski raj at FreeBSD.org
Wed Apr 22 13:13:35 UTC 2009


Author: raj
Date: Wed Apr 22 13:13:34 2009
New Revision: 191376
URL: http://svn.freebsd.org/changeset/base/191376

Log:
  Provide cpu_throw() for Book-E. Adjust cpu_switch() towards ULE support.
  
  Obtained from:	Freescale, Semihalf

Modified:
  head/sys/powerpc/booke/swtch.S
  head/sys/powerpc/booke/vm_machdep.c

Modified: head/sys/powerpc/booke/swtch.S
==============================================================================
--- head/sys/powerpc/booke/swtch.S	Wed Apr 22 13:11:38 2009	(r191375)
+++ head/sys/powerpc/booke/swtch.S	Wed Apr 22 13:13:34 2009	(r191376)
@@ -69,11 +69,20 @@
 #include <machine/spr.h>
 
 /*
- * void cpu_switch(struct thread *old, struct thread *new)
+ * void cpu_throw(struct thread *old, struct thread *new)
+ */
+ENTRY(cpu_throw)
+	mr	%r15, %r4
+	b	cpu_switchin
+
+/*
+ * void cpu_switch(struct thread *old, struct thread *new, struct mutex *mtx);)
  *
  * Switch to a new thread saving the current state in the old thread.
  */
 ENTRY(cpu_switch)
+	stw	%r5, TD_LOCK(%r3)
+
 	lwz	%r5, TD_PCB(%r3)	/* Get the old thread's PCB ptr */
 
 	mr	%r12, %r2	
@@ -98,6 +107,7 @@ ENTRY(cpu_switch)
 
 	bl	pmap_deactivate		/* Deactivate the current pmap */
 
+cpu_switchin:
 	mr	%r3, %r15		/* Get new thread ptr */
 	bl	pmap_activate		/* Activate the new address space */
 

Modified: head/sys/powerpc/booke/vm_machdep.c
==============================================================================
--- head/sys/powerpc/booke/vm_machdep.c	Wed Apr 22 13:11:38 2009	(r191375)
+++ head/sys/powerpc/booke/vm_machdep.c	Wed Apr 22 13:13:34 2009	(r191376)
@@ -248,15 +248,6 @@ cpu_exit(struct thread *td)
 
 }
 
-/* Temporary helper */
-void
-cpu_throw(struct thread *old, struct thread *new)
-{
-
-	cpu_switch(old, new, NULL);
-	panic("cpu_throw() didn't");
-}
-
 /*
  * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-))
  */


More information about the svn-src-head mailing list