PERFORCE change 48841 for review
Juli Mallett
jmallett at FreeBSD.org
Fri Mar 12 16:52:44 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=48841
Change 48841 by jmallett at 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__);
More information about the p4-projects
mailing list