summaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/kernel/entry.S5
-rw-r--r--arch/mips/kernel/head.S7
-rw-r--r--arch/mips/kernel/process.c3
-rw-r--r--arch/mips/kernel/r2300_switch.S34
-rw-r--r--arch/mips/kernel/r4k_switch.S29
-rw-r--r--arch/mips/kernel/scall_o32.S5
-rw-r--r--arch/mips/tools/offset.c3
7 files changed, 40 insertions, 46 deletions
diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S
index 2ef0f56cc..8abe70182 100644
--- a/arch/mips/kernel/entry.S
+++ b/arch/mips/kernel/entry.S
@@ -7,7 +7,7 @@
*
* Copyright (C) 1994, 1995 by Ralf Baechle
*
- * $Id: entry.S,v 1.5 1997/12/16 05:34:34 ralf Exp $
+ * $Id: entry.S,v 1.6 1998/03/17 22:07:32 ralf Exp $
*/
/*
@@ -61,8 +61,7 @@ EXPORT(ret_from_irq)
beqz t1, return # -> yes
lw t1, need_resched
bnez t1, reschedule
- GET_CURRENT(s0)
- lw v0, TASK_SIGPENDING(s0)
+ lw v0, TASK_SIGPENDING($28)
move a0, zero
beqz v0, return
nop
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index d6e82febf..229f78930 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -8,7 +8,7 @@
*
* Head.S contains the MIPS exception handler and startup code.
*
- * $Id: head.S,v 1.10 1997/11/13 12:55:29 ralf Exp $
+ * $Id: head.S,v 1.5 1997/12/01 17:57:27 ralf Exp $
*/
#include <linux/config.h>
#include <linux/tasks.h>
@@ -441,9 +441,10 @@ probe_done:
nop
/*
- * Stack for kernel and init
+ * Stack for kernel and init, current variable
*/
-9: la t0, init_task_union+KERNEL_STACK_SIZE-32
+9: la $28, init_task_union
+ addiu t0, $28, KERNEL_STACK_SIZE-32
sw t0, kernelsp
subu sp, t0, 4*SZREG
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 14e896c51..4b65d3c97 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -7,7 +7,7 @@
*
* Copyright (C) 1994 - 1998 by Ralf Baechle and others.
*
- * $Id: process.c,v 1.6 1998/03/21 22:37:05 ralf Exp $
+ * $Id: process.c,v 1.5 1998/03/22 23:27:13 ralf Exp $
*/
#include <linux/config.h>
#include <linux/errno.h>
@@ -84,6 +84,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
regs->regs[3] = 0;
}
if (childregs->cp0_status & ST0_CU0) {
+ childregs->regs[28] = p;
childregs->regs[29] = childksp;
p->tss.current_ds = KERNEL_DS;
} else {
diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S
index 901871a31..7efd61927 100644
--- a/arch/mips/kernel/r2300_switch.S
+++ b/arch/mips/kernel/r2300_switch.S
@@ -1,4 +1,4 @@
-/* $Id: r2300_switch.S,v 1.3 1996/06/29 07:06:42 dm Exp $
+/* $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
@@ -32,33 +32,31 @@ MODE_ALIAS = 0x00e0 # uncachable, dirty, valid
*/
.align 5
LEAF(r2300_resume)
- GET_CURRENT(t0)
mfc0 t1,CP0_STATUS # Save status register
- addu t0,a1 # Add tss offset
- sw t1,THREAD_STATUS(t0)
+ sw t1,THREAD_STATUS($28)
ori t2,t1,0x1f # Disable interrupts
xori t2,0x1e
mtc0 t2,CP0_STATUS
- CPU_SAVE_NONSCRATCH(t0)
+ CPU_SAVE_NONSCRATCH($28)
sll t2,t1,2 # Save floating point state
bgez t2,2f
- sw ra,THREAD_REG31(t0)
+ sw ra,THREAD_REG31($28)
sll t2,t1,5
bgez t2,1f
- swc1 $f0, (THREAD_FPU + 0x00)(t0)
- FPU_SAVE_16ODD(t0)
+ swc1 $f0, (THREAD_FPU + 0x00)($28)
+ FPU_SAVE_16ODD($28)
1:
- FPU_SAVE_16EVEN(t0, t1)
+ FPU_SAVE_16EVEN($28, t1)
2:
- addu a0,a1 # Add tss offset
- lw t0,THREAD_PGDIR(a0) # Switch the root pointer
+ move $28, a0
+ lw t0,THREAD_PGDIR($28) # Switch the root pointer
li t1,TLB_ROOT # get PFN
mtc0 t1,CP0_ENTRYHI
mtc0 zero,CP0_INDEX
srl t0,12 # PFN is 12 bits west
ori t0,MODE_ALIAS # want uncachable, dirty, valid
mtc0 t0,CP0_ENTRYLO0
- lw a2,THREAD_STATUS(a0)
+ lw a2,THREAD_STATUS($28)
tlbwi
/* Flush TLB. */
@@ -85,16 +83,14 @@ MODE_ALIAS = 0x00e0 # uncachable, dirty, valid
bgez t0,2f
sll t0,a2,5
bgez t0,1f
- lwc1 $f0, (THREAD_FPU + 0x00)(a0)
- FPU_RESTORE_16ODD(a0)
+ lwc1 $f0, (THREAD_FPU + 0x00)($28)
+ FPU_RESTORE_16ODD($28)
1:
- FPU_RESTORE_16EVEN(a0, t0)
+ FPU_RESTORE_16EVEN($28, t0)
2:
- CPU_RESTORE_NONSCRATCH(a0)
- lw t0,THREAD_KSP(a0) # Restore status register
+ CPU_RESTORE_NONSCRATCH($28)
+ lw t0,THREAD_KSP($28) # Restore status register
sw t0,kernelsp
jr ra
mtc0 a2,CP0_STATUS
END(r2300_resume)
-
-
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index 97e253028..cb7f9891f 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -25,26 +25,25 @@
.set mips3
.align 5
LEAF(r4xx0_resume)
- GET_CURRENT(t0)
mfc0 t1, CP0_STATUS
- nop
- sw t1, THREAD_STATUS(t0)
+ sw t1, THREAD_STATUS($28)
ori t2, t1, 0x1f
xori t2, t2, 0x1e
mtc0 t2, CP0_STATUS
- CPU_SAVE_NONSCRATCH(t0)
+ CPU_SAVE_NONSCRATCH($28)
sll t2, t1, 2 # Save floating point state
bgez t2, 2f
- sw ra, THREAD_REG31(t0)
+ sw ra, THREAD_REG31($28)
sll t2, t1, 5
bgez t2, 1f
- swc1 $f0, (THREAD_FPU + 0x00)(t0)
- FPU_SAVE_16ODD(t0)
+ swc1 $f0, (THREAD_FPU + 0x00)($28)
+ FPU_SAVE_16ODD($28)
1:
- FPU_SAVE_16EVEN(t0, t1) # clobbers t1
+ FPU_SAVE_16EVEN($28, t1) # clobbers t1
2:
- lw a3, TASK_MM(a0)
- lw a2, THREAD_STATUS(a0)
+ move $28, a0
+ lw a3, TASK_MM($28)
+ lw a2, THREAD_STATUS($28)
lw a3, MM_CONTEXT(a3)
ori t1, a2, 1 # restore fpu, pipeline magic
andi a3, a3, 0xff
@@ -55,13 +54,13 @@
bgez t0, 2f
sll t0, a2, 5
bgez t0, 1f
- lwc1 $f0, (THREAD_FPU + 0x00)(a0)
- FPU_RESTORE_16ODD(a0)
+ lwc1 $f0, (THREAD_FPU + 0x00)($28)
+ FPU_RESTORE_16ODD($28)
1:
- FPU_RESTORE_16EVEN(a0, t0) # clobbers t0
+ FPU_RESTORE_16EVEN($28, t0) # clobbers t0
2:
- CPU_RESTORE_NONSCRATCH(a0)
- lw t0, THREAD_KSP(a0)
+ CPU_RESTORE_NONSCRATCH($28)
+ lw t0, THREAD_KSP($28)
sw t0, kernelsp
jr ra
mtc0 a2, CP0_STATUS
diff --git a/arch/mips/kernel/scall_o32.S b/arch/mips/kernel/scall_o32.S
index ee91ac947..eb25c34e5 100644
--- a/arch/mips/kernel/scall_o32.S
+++ b/arch/mips/kernel/scall_o32.S
@@ -52,8 +52,7 @@ NESTED(handle_sys, PT_SIZE, sp)
subu t0, s1, 5 # 5 or more arguments?
bgezal t0, stackargs
- GET_CURRENT(s3) # syscall tracing enabled?
- lw s3, TASK_FLAGS(s3)
+ lw s3, TASK_FLAGS($28) # syscall tracing enabled?
andi s3, PF_TRACESYS
bnez s3, trace_a_syscall
@@ -150,7 +149,7 @@ sigill_and_out:
li t0, -1 # not a sys call
REG_S t0, PT_OR2(sp)
li a0, SIGILL
- GET_CURRENT(a2)
+ move a2, $28
jal force_sig
j ret_from_sys_call
END(handle_sys)
diff --git a/arch/mips/tools/offset.c b/arch/mips/tools/offset.c
index 88926ebfd..3a25b57d9 100644
--- a/arch/mips/tools/offset.c
+++ b/arch/mips/tools/offset.c
@@ -4,7 +4,7 @@
* Copyright (C) 1996 David S. Miller
* Made portable by Ralf Baechle
*
- * $Id: offset.c,v 1.3 1997/12/01 17:57:41 ralf Exp $
+ * $Id: offset.c,v 1.4 1997/12/16 05:34:45 ralf Exp $
*/
#include <linux/types.h>
@@ -98,7 +98,6 @@ void output_thread_defines(void)
offset("#define THREAD_REG21 ", struct task_struct, tss.reg21);
offset("#define THREAD_REG22 ", struct task_struct, tss.reg22);
offset("#define THREAD_REG23 ", struct task_struct, tss.reg23);
- offset("#define THREAD_REG28 ", struct task_struct, tss.reg28);
offset("#define THREAD_REG29 ", struct task_struct, tss.reg29);
offset("#define THREAD_REG30 ", struct task_struct, tss.reg30);
offset("#define THREAD_REG31 ", struct task_struct, tss.reg31);