2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 1994, 1995, 1996, 1999 Ralf Baechle
7 * Copyright (C) 1994, 1995, 1996 Paul M. Antoine.
8 * Copyright (C) 1999 Silicon Graphics, Inc.
10 #ifndef _ASM_STACKFRAME_H
11 #define _ASM_STACKFRAME_H
13 #include <linux/config.h>
14 #include <linux/threads.h>
17 #include <asm/offset.h>
18 #include <asm/processor.h>
19 #include <asm/addrspace.h>
57 .macro get_saved_sp /* SMP variation */
60 lui k0, %hi(pgd_current)
61 daddiu k0, %lo(pgd_current)
65 ld k1, %lo(kernelsp)(k1)
68 .macro set_saved_sp stackp temp temp2
69 lw \temp, TASK_PROCESSOR(gp)
71 lui \temp2, %hi(kernelsp)
73 sd \stackp, %lo(kernelsp)(\temp)
76 .macro get_saved_sp /* Uniprocessor variation */
78 ld k1, %lo(kernelsp)(k1)
81 .macro set_saved_sp stackp temp temp2
85 .macro declare_saved_sp
86 .comm kernelsp, NR_CPUS * 8, 8
93 sll k0, 3 /* extract cu0 bit */
98 /* Called from user mode, new stack. */
101 dsubu sp, k1, PT_SIZE
158 .macro RESTORE_STATIC
209 * Move to kernel mode and disable interrupts.
210 * Set cp0 enable bit as sign that we're running on the kernel stack
221 * Move to kernel mode and enable interrupts.
222 * Set cp0 enable bit as sign that we're running on the kernel stack
226 li t1, ST0_CU0 | 0x1f
233 * Just move to kernel mode and leave interrupts as they are.
234 * Set cp0 enable bit as sign that we're running on the kernel stack
238 li t1, ST0_CU0 | 0x1e
244 #endif /* __ASSEMBLY__ */
246 #endif /* _ASM_STACKFRAME_H */