Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Mar 2004 16:52:42 -0800 (PST)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 48841 for review
Message-ID:  <200403130052.i2D0qg5m046371@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=48841

Change 48841 by jmallett@jmallett_oingo on 2004/03/12 16:52:22

	Write cpu_switch in C.

Affected files ...

.. //depot/projects/mips/sys/mips/mips/swtch.S#3 edit
.. //depot/projects/mips/sys/mips/mips/vm_machdep.c#11 edit

Differences ...

==== //depot/projects/mips/sys/mips/mips/swtch.S#3 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $P4: //depot/projects/mips/sys/mips/mips/swtch.S#2 $
+ * $P4: //depot/projects/mips/sys/mips/mips/swtch.S#3 $
  */
 
 #include <machine/asm.h>
@@ -85,28 +85,6 @@
 END(cpu_throw)
 
 /*
- * a0: struct thread *old
- * a1: struct thread *new
- */
-ENTRY(cpu_switch)
-	dsubu	sp, 8
-	sd	ra, 0(sp)
-	jal	savectx
-	nop
-	bnez	v0, restore
-	nop
-	jal	pmap_deactivate
-	nop
-	jal	cpu_throw
-	nop
-	/* NOTREACHED */
-restore:
-	ld	ra, 0(sp)
-	j	ra
-	daddu	sp, 8
-END(cpu_switch)
-
-/*
  * s0: Routine to call.
  * s1: a0 for said routine.
  * s2: a1 for said routine.

==== //depot/projects/mips/sys/mips/mips/vm_machdep.c#11 (text+ko) ====

@@ -103,6 +103,16 @@
 }
 
 void
+cpu_switch(struct thread *old, struct thread *new)
+{
+	if (!savectx(old->td_pcb)) {
+		pmap_deactivate(old);
+		cpu_throw(old, new);
+		panic("%s: should not be reached", __func__);
+	}
+}
+
+void
 cpu_thread_exit(struct thread *td)     
 {
 	panic("%s", __func__);



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