Fix get_saved_sp for 64bit address space. Simplify set_save_sp.
authorThiemo Seufer <ths@networkno.de>
Fri, 8 Jul 2005 08:03:48 +0000 (08:03 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Sat, 29 Oct 2005 18:31:39 +0000 (19:31 +0100)
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Thiemo Seufer <ths@networkno.de>
include/asm-mips/stackframe.h

index de303e96260ee64c903c2884763167d504192d23..a8919dcc93c8661ea16cffbc6fa68df5ac49f8c8 100644 (file)
 #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