aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiemo Seufer <ths@networkno.de>2005-07-08 08:03:48 +0000
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 19:31:39 +0100
commit9556ac2fa1b16ec702e200fc558636a09a50f0e0 (patch)
tree39b51399de0785b07d7ad8bbcdc9151fb33fe073
parent4552074577c639da32dd58a617ea11ac3e28912b (diff)
Fix get_saved_sp for 64bit address space. Simplify set_save_sp.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Thiemo Seufer <ths@networkno.de>
-rw-r--r--include/asm-mips/stackframe.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h
index de303e96260..a8919dcc93c 100644
--- a/include/asm-mips/stackframe.h
+++ b/include/asm-mips/stackframe.h
@@ -90,24 +90,28 @@
#ifdef CONFIG_32BIT
mfc0 \temp, CP0_CONTEXT
srl \temp, 23
- LONG_S \stackp, kernelsp(\temp)
#endif
#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
lw \temp, TI_CPU(gp)
dsll \temp, 3
- lui \temp2, %hi(kernelsp)
- daddu \temp, \temp2
- LONG_S \stackp, %lo(kernelsp)(\temp)
#endif
#if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64)
MFC0 \temp, CP0_CONTEXT
dsrl \temp, 23
- LONG_S \stackp, kernelsp(\temp)
#endif
+ LONG_S \stackp, kernelsp(\temp)
.endm
#else
.macro get_saved_sp /* Uniprocessor variation */
+#if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64)
+ lui k1, %highest(kernelsp)
+ daddiu k1, %higher(kernelsp)
+ dsll k1, k1, 16
+ daddiu k1, %hi(kernelsp)
+ dsll k1, k1, 16
+#else
lui k1, %hi(kernelsp)
+#endif
LONG_L k1, %lo(kernelsp)(k1)
.endm