summaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/r2300_switch.S
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-03-27 04:47:53 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-03-27 04:47:53 +0000
commit36ea5120664550fae6d31f1c6f695e4f8975cb06 (patch)
tree7b985f066e6fa149027022366b9f3dd92506db24 /arch/mips/kernel/r2300_switch.S
parentf7f4aaffdad04eb69ab618c771df0416ad04a952 (diff)
o Speedup syscalls. Now 816ns per syscall. Yes, nanoseconds and goodbye
Pentium :-) o Little bit smarter handling of unimplemented exceptions. o Fix FPU context switches. o Fix reboot / halt. Powerdown in software still doesn't work. o Fix the fix for handling of return values of interrupted syscalls. o Handling of the Indy second level cache now works as spec'ed. Purely cosmentic, this was not causing any problems.
Diffstat (limited to 'arch/mips/kernel/r2300_switch.S')
-rw-r--r--arch/mips/kernel/r2300_switch.S24
1 files changed, 9 insertions, 15 deletions
diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S
index 7efd61927..f4470e54d 100644
--- a/arch/mips/kernel/r2300_switch.S
+++ b/arch/mips/kernel/r2300_switch.S
@@ -1,10 +1,12 @@
-/* $Id: r2300_switch.S,v 1.1.1.1 1997/06/01 03:16:43 ralf Exp $
+/*
* r2300_switch.S: R3000/R2000 specific task switching code.
*
* Copyright (C) 1994, 1995, 1996 by Ralf Baechle and Andreas Busse
*
* Multi-cpu abstraction and macros for easier reading:
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
+ *
+ * $Id: r2300_switch.S,v 1.3 1998/03/23 06:34:37 ralf Exp $
*/
#include <asm/asm.h>
#include <asm/bootinfo.h>
@@ -25,7 +27,8 @@
MODE_ALIAS = 0x00e0 # uncachable, dirty, valid
.text
- .set mips3
+ .set mips1
+ .set noreorder
/*
* Code necessary to switch tasks on an Linux/MIPS machine.
* FIXME: We don't need to disable interrupts anymore.
@@ -39,15 +42,10 @@ MODE_ALIAS = 0x00e0 # uncachable, dirty, valid
mtc0 t2,CP0_STATUS
CPU_SAVE_NONSCRATCH($28)
sll t2,t1,2 # Save floating point state
- bgez t2,2f
- sw ra,THREAD_REG31($28)
- sll t2,t1,5
bgez t2,1f
- swc1 $f0, (THREAD_FPU + 0x00)($28)
- FPU_SAVE_16ODD($28)
+ sw ra,THREAD_REG31($28)
+ FPU_SAVE($28, t0)
1:
- FPU_SAVE_16EVEN($28, t1)
-2:
move $28, a0
lw t0,THREAD_PGDIR($28) # Switch the root pointer
li t1,TLB_ROOT # get PFN
@@ -80,14 +78,10 @@ MODE_ALIAS = 0x00e0 # uncachable, dirty, valid
xori t1,1
mtc0 t1,CP0_STATUS
sll t0,a2,2
- bgez t0,2f
- sll t0,a2,5
bgez t0,1f
- lwc1 $f0, (THREAD_FPU + 0x00)($28)
- FPU_RESTORE_16ODD($28)
+ lw ra,THREAD_REG31($28)
+ FPU_RESTORE($28, t0)
1:
- FPU_RESTORE_16EVEN($28, t0)
-2:
CPU_RESTORE_NONSCRATCH($28)
lw t0,THREAD_KSP($28) # Restore status register
sw t0,kernelsp