diff options
-rw-r--r-- | arch/mips64/kernel/head.S | 7 | ||||
-rw-r--r-- | arch/mips64/kernel/r4k_switch.S | 7 | ||||
-rw-r--r-- | include/asm-mips64/current.h | 17 | ||||
-rw-r--r-- | include/asm-mips64/stackframe.h | 14 |
4 files changed, 27 insertions, 18 deletions
diff --git a/arch/mips64/kernel/head.S b/arch/mips64/kernel/head.S index a789d818a..cc19d318c 100644 --- a/arch/mips64/kernel/head.S +++ b/arch/mips64/kernel/head.S @@ -64,7 +64,12 @@ NESTED(kernel_entry, 16, sp) # kernel entry point daddiu t0, $28, KERNEL_STACK_SIZE-32 sd t0, kernelsp dsubu sp, t0, 4*SZREG # init stack pointer - + move t0, $28 +#ifdef CONFIG_SMP + mtc0 t0, CP0_WATCHLO + dsrl32 t0, t0, 0 + mtc0 t0, CP0_WATCHHI +#endif jal start_kernel 1: b 1b # just in case ... END(kernel_entry) diff --git a/arch/mips64/kernel/r4k_switch.S b/arch/mips64/kernel/r4k_switch.S index 05ebac4de..8ad1c5eb0 100644 --- a/arch/mips64/kernel/r4k_switch.S +++ b/arch/mips64/kernel/r4k_switch.S @@ -9,6 +9,7 @@ * Copyright (C) 1994, 1995, 1996, by Andreas Busse * Copyright (C) 1999 Silicon Graphics, Inc. */ +#include <linux/config.h> #include <asm/asm.h> #include <asm/bootinfo.h> #include <asm/cachectl.h> @@ -43,8 +44,14 @@ */ move $28, a1 cpu_restore_nonscratch $28 +#ifndef CONFIG_SMP daddiu t0, $28, KERNEL_STACK_SIZE-32 sd t0, kernelsp +#else + mtc0 a1, CP0_WATCHLO + dsrl32 a1, a1, 0 + mtc0 a1, CP0_WATCHHI +#endif mfc0 t1, CP0_STATUS /* Do we really need this? */ li a3, 0xff00 and t1, a3 diff --git a/include/asm-mips64/current.h b/include/asm-mips64/current.h index abaab72af..d957f3a4c 100644 --- a/include/asm-mips64/current.h +++ b/include/asm-mips64/current.h @@ -15,21 +15,4 @@ register struct task_struct *current asm("$28"); #endif /* _LANGUAGE_C */ -#ifdef _LANGUAGE_ASSEMBLY - -/* - * Special variant for use by exception handlers when the stack pointer - * is not loaded. - */ -#define _GET_CURRENT(reg) \ - lui reg, %hi(kernelsp); \ - .set push; \ - .set noreorder; \ - ld reg, %lo(kernelsp)(reg); \ - .set pop; \ - ori reg, 0x3fff; \ - xori reg, 0x3fff - -#endif - #endif /* _ASM_CURRENT_H */ diff --git a/include/asm-mips64/stackframe.h b/include/asm-mips64/stackframe.h index aa0a15fc9..0257bb07a 100644 --- a/include/asm-mips64/stackframe.h +++ b/include/asm-mips64/stackframe.h @@ -11,8 +11,12 @@ #ifndef _ASM_STACKFRAME_H #define _ASM_STACKFRAME_H +#include <linux/config.h> + #include <asm/asm.h> #include <asm/offset.h> +#include <asm/processor.h> +#include <asm/addrspace.h> #ifdef _LANGUAGE_C @@ -82,8 +86,18 @@ move k1, sp .set reorder /* Called from user mode, new stack. */ +#ifndef CONFIG_SMP lui k1, %hi(kernelsp) ld k1, %lo(kernelsp)(k1) +#else + mfc0 k1, CP0_WATCHHI + mfc0 k0, CP0_WATCHLO + dsll32 k1, k1, 0 + or k1, k1, k0 + li k0, K0BASE + or k1, k1, k0 + daddiu k1, k1, KERNEL_STACK_SIZE-32 +#endif 8: move k0, sp dsubu sp, k1, PT_SIZE sd k0, PT_R29(sp) |