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"; \
31 * _save_fp_context() - save FP context from the FPU
32 * @a0 - pointer to fpregs field of sigcontext
33 * @a1 - pointer to fpc_csr field of sigcontext
35 * Save FP context, including the 32 FP data registers and the FP
36 * control & status register, from the FPU to signal context.
38 LEAF(_save_fp_context)
41 li v0, 0 # assume success
56 EX(swc1 $f13, 104(a0))
57 EX(swc1 $f14, 112(a0))
58 EX(swc1 $f15, 120(a0))
59 EX(swc1 $f16, 128(a0))
60 EX(swc1 $f17, 136(a0))
61 EX(swc1 $f18, 144(a0))
62 EX(swc1 $f19, 152(a0))
63 EX(swc1 $f20, 160(a0))
64 EX(swc1 $f21, 168(a0))
65 EX(swc1 $f22, 176(a0))
66 EX(swc1 $f23, 184(a0))
67 EX(swc1 $f24, 192(a0))
68 EX(swc1 $f25, 200(a0))
69 EX(swc1 $f26, 208(a0))
70 EX(swc1 $f27, 216(a0))
71 EX(swc1 $f28, 224(a0))
72 EX(swc1 $f29, 232(a0))
73 EX(swc1 $f30, 240(a0))
74 EX(swc1 $f31, 248(a0))
81 * _restore_fp_context() - restore FP context to the FPU
82 * @a0 - pointer to fpregs field of sigcontext
83 * @a1 - pointer to fpc_csr field of sigcontext
85 * Restore FP context, including the 32 FP data registers and the FP
86 * control & status register, from signal context to the FPU.
88 LEAF(_restore_fp_context)
91 li v0, 0 # assume success
103 EX(lwc1 $f10, 80(a0))
104 EX(lwc1 $f11, 88(a0))
105 EX(lwc1 $f12, 96(a0))
106 EX(lwc1 $f13, 104(a0))
107 EX(lwc1 $f14, 112(a0))
108 EX(lwc1 $f15, 120(a0))
109 EX(lwc1 $f16, 128(a0))
110 EX(lwc1 $f17, 136(a0))
111 EX(lwc1 $f18, 144(a0))
112 EX(lwc1 $f19, 152(a0))
113 EX(lwc1 $f20, 160(a0))
114 EX(lwc1 $f21, 168(a0))
115 EX(lwc1 $f22, 176(a0))
116 EX(lwc1 $f23, 184(a0))
117 EX(lwc1 $f24, 192(a0))
118 EX(lwc1 $f25, 200(a0))
119 EX(lwc1 $f26, 208(a0))
120 EX(lwc1 $f27, 216(a0))
121 EX(lwc1 $f28, 224(a0))
122 EX(lwc1 $f29, 232(a0))
123 EX(lwc1 $f30, 240(a0))
124 EX(lwc1 $f31, 248(a0))
128 END(_restore_fp_context)
131 .type fault, @function
133 fault: li v0, -EFAULT