11 #ifndef _ASM_STACKFRAME_H
12 #define _ASM_STACKFRAME_H
17 #include <asm/asmmacro.h>
19 #include <asm/asm-offsets.h>
25 #ifdef CONFIG_MIPS_MT_SMTC
27 #elif defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
33 #ifdef CONFIG_MIPS_MT_SMTC
45 #ifdef CONFIG_CPU_HAS_SMARTMIPS
62 #ifndef CONFIG_CPU_HAS_SMARTMIPS
70 #ifndef CONFIG_CPU_HAS_SMARTMIPS
88 #ifdef CONFIG_MIPS_MT_SMTC
89 #define PTEBASE_SHIFT 19
90 #define CPU_ID_REG CP0_TCBIND
91 #define CPU_ID_MFC0 mfc0
92 #elif defined(CONFIG_MIPS_PGD_C0_CONTEXT)
93 #define PTEBASE_SHIFT 48
94 #define CPU_ID_REG CP0_XCONTEXT
95 #define CPU_ID_MFC0 MFC0
97 #define PTEBASE_SHIFT 23
98 #define CPU_ID_REG CP0_CONTEXT
99 #define CPU_ID_MFC0 MFC0
102 CPU_ID_MFC0
k0, CPU_ID_REG
103 #if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32)
112 LONG_SRL
k0, PTEBASE_SHIFT
118 CPU_ID_MFC0 \
temp, CPU_ID_REG
119 LONG_SRL \temp, PTEBASE_SHIFT
124 #ifdef CONFIG_CPU_JUMP_WORKAROUNDS
143 #if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32)
155 .macro set_saved_sp stackp temp
temp2
172 #ifndef CONFIG_CPU_DADDI_WORKAROUNDS
174 PTR_SUBU
sp, k1, PT_SIZE
177 8: PTR_SUBU k1, PT_SIZE
192 #ifdef CONFIG_MIPS_MT_SMTC
198 mfc0
k0, CP0_TCSTATUS
200 LONG_S
k0, PT_TCSTATUS(sp)
218 ori $28, sp, _THREAD_MASK
219 xori $28, _THREAD_MASK
220 #ifdef CONFIG_CPU_CAVIUM_OCTEON
251 #ifdef CONFIG_CPU_HAS_SMARTMIPS
252 LONG_L $24, PT_ACX(sp)
254 LONG_L $24,
PT_HI(sp)
256 LONG_L $24,
PT_LO(sp)
259 LONG_L $24,
PT_LO(sp)
261 LONG_L $24,
PT_HI(sp)
277 .macro RESTORE_STATIC
289 #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
318 .macro RESTORE_SP_AND_RET
333 #ifdef CONFIG_MIPS_MT_SMTC
356 mfc0
v0, CP0_TCSTATUS
358 mtc0
v0, CP0_TCSTATUS
363 #ifdef CONFIG_CPU_CAVIUM_OCTEON
365 jal octeon_mult_restore
378 #ifdef CONFIG_MIPS_MT_SMTC
383 LONG_L
v1, PT_TCSTATUS(sp)
385 mfc0 a0, CP0_TCSTATUS
399 mfc0 v0, CP0_TCCONTEXT
426 mtc0 a0, CP0_TCSTATUS
449 .macro RESTORE_SP_AND_RET
470 .macro RESTORE_ALL_AND_RET
483 #if !defined(CONFIG_MIPS_MT_SMTC)
495 mfc0
t0, CP0_TCSTATUS
502 mtc0
t0, CP0_TCSTATUS
518 #if !defined(CONFIG_MIPS_MT_SMTC)
531 mfc0
t0, CP0_TCSTATUS
538 mtc0
t0, CP0_TCSTATUS
556 #ifdef CONFIG_MIPS_MT_SMTC
568 mfc0
v0, CP0_TCSTATUS
571 mtc0
v0, CP0_TCSTATUS
584 #
if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
592 #ifdef CONFIG_MIPS_MT_SMTC
599 mfc0
v0, CP0_TCSTATUS
604 mtc0
v0, CP0_TCSTATUS