summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-03-28 03:31:31 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-03-28 03:31:31 +0000
commit5ef77ed0715385e6beeffe0fd9f6001920e6dbbe (patch)
tree23755d784b8650dcd5af2e5975748ba79f6b5a36
parentd3e71cb08747743fce908122bab08b479eb403a5 (diff)
Set ST0_FR the right way.
-rw-r--r--arch/mips64/kernel/head.S6
-rw-r--r--include/asm-mips64/processor.h18
2 files changed, 15 insertions, 9 deletions
diff --git a/arch/mips64/kernel/head.S b/arch/mips64/kernel/head.S
index a0a0a96e6..645209276 100644
--- a/arch/mips64/kernel/head.S
+++ b/arch/mips64/kernel/head.S
@@ -1,4 +1,4 @@
-/* $Id: head.S,v 1.5 2000/03/16 04:04:32 kanoj Exp $
+/* $Id: head.S,v 1.6 2000/03/27 21:05:04 ulfc Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -47,9 +47,9 @@ NESTED(kernel_entry, 16, sp) # kernel entry point
CLI # disable interrupts
mfc0 t0, CP0_STATUS
- li t1, ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_FR)
+ li t1, ~(ST0_CU1|ST0_CU2|ST0_CU3)
and t0, t1
- or t0, (ST0_CU0|ST0_KX|ST0_SX)
+ or t0, (ST0_CU0|ST0_KX|ST0_SX|ST0_FR)
mtc0 t0, CP0_STATUS
la $28, init_task_union # init current pointer
diff --git a/include/asm-mips64/processor.h b/include/asm-mips64/processor.h
index 3bbbce9f5..7c7ae6d01 100644
--- a/include/asm-mips64/processor.h
+++ b/include/asm-mips64/processor.h
@@ -1,4 +1,4 @@
-/* $Id: processor.h,v 1.10 2000/02/24 00:13:20 ralf Exp $
+/* $Id: processor.h,v 1.11 2000/03/14 01:39:27 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -216,13 +216,19 @@ extern int (*_user_mode)(struct pt_regs *);
/*
* Do necessary setup to start up a newly executed thread.
*/
-#define start_thread(regs, new_pc, new_sp) do { \
+#define start_thread(regs, pc, sp) \
+do { \
+ unsigned long __status; \
+ \
/* New thread looses kernel privileges. */ \
- regs->cp0_status = (regs->cp0_status & ~(ST0_CU0|ST0_KSU)) | KSU_USER;\
- regs->cp0_epc = new_pc; \
- regs->regs[29] = new_sp; \
+ __status = regs->cp0_status & ~(ST0_CU0|ST0_FR|ST0_KSU); \
+ __status |= KSU_USER; \
+ __status |= (current->thread.mflags & MF_32BIT) ? 0 : ST0_FR; \
+ regs->cp0_status = __status; \
+ regs->cp0_epc = pc; \
+ regs->regs[29] = sp; \
current->thread.current_ds = USER_DS; \
-} while (0)
+} while(0)
unsigned long get_wchan(struct task_struct *p);