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/errno.h>
16 #include <asm/fpregdef.h>
17 #include <asm/mipsregs.h>
18 #include <asm/asm-offsets.h>
19 #include <asm/regdef.h>
23 .section __ex_table,"a"; \
29 .section __ex_table,"a"; \
38 * _save_fp_context() - save FP context from the FPU
39 * @a0 - pointer to fpregs field of sigcontext
40 * @a1 - pointer to fpc_csr field of sigcontext
42 * Save FP context, including the 32 FP data registers and the FP
43 * control & status register, from the FPU to signal context.
45 LEAF(_save_fp_context)
48 li v0, 0 # assume success
57 EX2(s.d $f14, 112(a0))
58 EX2(s.d $f16, 128(a0))
59 EX2(s.d $f18, 144(a0))
60 EX2(s.d $f20, 160(a0))
61 EX2(s.d $f22, 176(a0))
62 EX2(s.d $f24, 192(a0))
63 EX2(s.d $f26, 208(a0))
64 EX2(s.d $f28, 224(a0))
65 EX2(s.d $f30, 240(a0))
72 * _restore_fp_context() - restore FP context to the FPU
73 * @a0 - pointer to fpregs field of sigcontext
74 * @a1 - pointer to fpc_csr field of sigcontext
76 * Restore FP context, including the 32 FP data registers and the FP
77 * control & status register, from signal context to the FPU.
79 LEAF(_restore_fp_context)
82 li v0, 0 # assume success
91 EX2(l.d $f14, 112(a0))
92 EX2(l.d $f16, 128(a0))
93 EX2(l.d $f18, 144(a0))
94 EX2(l.d $f20, 160(a0))
95 EX2(l.d $f22, 176(a0))
96 EX2(l.d $f24, 192(a0))
97 EX2(l.d $f26, 208(a0))
98 EX2(l.d $f28, 224(a0))
99 EX2(l.d $f30, 240(a0))
103 END(_restore_fp_context)
106 .type fault, @function
108 fault: li v0, -EFAULT