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) 1996, 1998 by Ralf Baechle
8 * Multi-arch abstraction and asm macros for easier reading:
9 * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
11 * Further modifications to make this work:
12 * Copyright (c) 1998 Harald Koerfgen
15 #include <asm/asmmacro.h>
16 #include <asm/errno.h>
17 #include <asm/export.h>
18 #include <asm/fpregdef.h>
19 #include <asm/mipsregs.h>
20 #include <asm/asm-offsets.h>
21 #include <asm/regdef.h>
25 .section __ex_table,"a"; \
31 .section __ex_table,"a"; \
39 * Save a thread's fp context.
42 EXPORT_SYMBOL(_save_fp)
43 fpu_save_single a0, t1 # clobbers t1
48 * Restore a thread's fp context.
51 fpu_restore_single a0, t1 # clobbers t1
56 * Load the FPU with signalling NANS. This bit pattern we're using has
57 * the property that no matter whether considered as single or as double
58 * precision represents signaling NANS.
60 * The value to initialize fcr31 to comes in $a0.
116 * _save_fp_context() - save FP context from the FPU
117 * @a0 - pointer to fpregs field of sigcontext
118 * @a1 - pointer to fpc_csr field of sigcontext
120 * Save FP context, including the 32 FP data registers and the FP
121 * control & status register, from the FPU to signal context.
123 LEAF(_save_fp_context)
126 li v0, 0 # assume success
133 EX2(s.d $f10, 80(a0))
134 EX2(s.d $f12, 96(a0))
135 EX2(s.d $f14, 112(a0))
136 EX2(s.d $f16, 128(a0))
137 EX2(s.d $f18, 144(a0))
138 EX2(s.d $f20, 160(a0))
139 EX2(s.d $f22, 176(a0))
140 EX2(s.d $f24, 192(a0))
141 EX2(s.d $f26, 208(a0))
142 EX2(s.d $f28, 224(a0))
143 EX2(s.d $f30, 240(a0))
147 END(_save_fp_context)
150 * _restore_fp_context() - restore FP context to the FPU
151 * @a0 - pointer to fpregs field of sigcontext
152 * @a1 - pointer to fpc_csr field of sigcontext
154 * Restore FP context, including the 32 FP data registers and the FP
155 * control & status register, from signal context to the FPU.
157 LEAF(_restore_fp_context)
160 li v0, 0 # assume success
167 EX2(l.d $f10, 80(a0))
168 EX2(l.d $f12, 96(a0))
169 EX2(l.d $f14, 112(a0))
170 EX2(l.d $f16, 128(a0))
171 EX2(l.d $f18, 144(a0))
172 EX2(l.d $f20, 160(a0))
173 EX2(l.d $f22, 176(a0))
174 EX2(l.d $f24, 192(a0))
175 EX2(l.d $f26, 208(a0))
176 EX2(l.d $f28, 224(a0))
177 EX2(l.d $f30, 240(a0))
181 END(_restore_fp_context)
184 .type fault, @function
186 fault: li v0, -EFAULT