]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * r6000_fpu.S: Save/restore floating point context for signal handlers. | |
3 | * | |
4 | * This file is subject to the terms and conditions of the GNU General Public | |
5 | * License. See the file "COPYING" in the main directory of this archive | |
6 | * for more details. | |
7 | * | |
8 | * Copyright (C) 1996 by Ralf Baechle | |
9 | * | |
10 | * Multi-arch abstraction and asm macros for easier reading: | |
79add627 | 11 | * Copyright (C) 1996 David S. Miller (davem@davemloft.net) |
1da177e4 LT |
12 | */ |
13 | #include <asm/asm.h> | |
14 | #include <asm/fpregdef.h> | |
15 | #include <asm/mipsregs.h> | |
048eb582 | 16 | #include <asm/asm-offsets.h> |
1da177e4 LT |
17 | #include <asm/regdef.h> |
18 | ||
19 | .set noreorder | |
20 | .set mips2 | |
842dfc11 ML |
21 | .set push |
22 | SET_HARDFLOAT | |
23 | ||
758ef0a9 MR |
24 | /** |
25 | * _save_fp_context() - save FP context from the FPU | |
26 | * @a0 - pointer to fpregs field of sigcontext | |
27 | * @a1 - pointer to fpc_csr field of sigcontext | |
28 | * | |
29 | * Save FP context, including the 32 FP data registers and the FP | |
30 | * control & status register, from the FPU to signal context. | |
31 | */ | |
1da177e4 LT |
32 | LEAF(_save_fp_context) |
33 | mfc0 t0,CP0_STATUS | |
34 | sll t0,t0,2 | |
35 | bgez t0,1f | |
36 | nop | |
37 | ||
38 | cfc1 t1,fcr31 | |
39 | /* Store the 16 double precision registers */ | |
758ef0a9 MR |
40 | sdc1 $f0,0(a0) |
41 | sdc1 $f2,16(a0) | |
42 | sdc1 $f4,32(a0) | |
43 | sdc1 $f6,48(a0) | |
44 | sdc1 $f8,64(a0) | |
45 | sdc1 $f10,80(a0) | |
46 | sdc1 $f12,96(a0) | |
47 | sdc1 $f14,112(a0) | |
48 | sdc1 $f16,128(a0) | |
49 | sdc1 $f18,144(a0) | |
50 | sdc1 $f20,160(a0) | |
51 | sdc1 $f22,176(a0) | |
52 | sdc1 $f24,192(a0) | |
53 | sdc1 $f26,208(a0) | |
54 | sdc1 $f28,224(a0) | |
55 | sdc1 $f30,240(a0) | |
1da177e4 | 56 | jr ra |
758ef0a9 | 57 | sw t0,(a1) |
1da177e4 LT |
58 | 1: jr ra |
59 | nop | |
60 | END(_save_fp_context) | |
61 | ||
758ef0a9 MR |
62 | /** |
63 | * _restore_fp_context() - restore FP context to the FPU | |
64 | * @a0 - pointer to fpregs field of sigcontext | |
65 | * @a1 - pointer to fpc_csr field of sigcontext | |
1da177e4 | 66 | * |
758ef0a9 MR |
67 | * Restore FP context, including the 32 FP data registers and the FP |
68 | * control & status register, from signal context to the FPU. | |
1da177e4 LT |
69 | */ |
70 | LEAF(_restore_fp_context) | |
71 | mfc0 t0,CP0_STATUS | |
72 | sll t0,t0,2 | |
73 | ||
74 | bgez t0,1f | |
758ef0a9 | 75 | lw t0,(a1) |
1da177e4 | 76 | /* Restore the 16 double precision registers */ |
758ef0a9 MR |
77 | ldc1 $f0,0(a0) |
78 | ldc1 $f2,16(a0) | |
79 | ldc1 $f4,32(a0) | |
80 | ldc1 $f6,48(a0) | |
81 | ldc1 $f8,64(a0) | |
82 | ldc1 $f10,80(a0) | |
83 | ldc1 $f12,96(a0) | |
84 | ldc1 $f14,112(a0) | |
85 | ldc1 $f16,128(a0) | |
86 | ldc1 $f18,144(a0) | |
87 | ldc1 $f20,160(a0) | |
88 | ldc1 $f22,176(a0) | |
89 | ldc1 $f24,192(a0) | |
90 | ldc1 $f26,208(a0) | |
91 | ldc1 $f28,224(a0) | |
92 | ldc1 $f30,240(a0) | |
1da177e4 LT |
93 | jr ra |
94 | ctc1 t0,fcr31 | |
95 | 1: jr ra | |
96 | nop | |
97 | END(_restore_fp_context) | |
842dfc11 ML |
98 | |
99 | .set pop /* SET_HARDFLOAT */ |