r2300_fpu.S (bf61c8840efe60fd8f91446860b63338fb424158) r2300_fpu.S (842dfc11ea9a21f9825167c8a4f2834b205b0a79)
1/*
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
4 * for more details.
5 *
6 * Copyright (C) 1996, 1998 by Ralf Baechle
7 *
8 * Multi-arch abstraction and asm macros for easier reading:

--- 14 unchanged lines hidden (view full) ---

23 .section __ex_table,"a"; \
24 PTR 9b,bad_stack; \
25 .previous
26
27 .set noreorder
28 .set mips1
29 /* Save floating point context */
30LEAF(_save_fp_context)
1/*
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
4 * for more details.
5 *
6 * Copyright (C) 1996, 1998 by Ralf Baechle
7 *
8 * Multi-arch abstraction and asm macros for easier reading:

--- 14 unchanged lines hidden (view full) ---

23 .section __ex_table,"a"; \
24 PTR 9b,bad_stack; \
25 .previous
26
27 .set noreorder
28 .set mips1
29 /* Save floating point context */
30LEAF(_save_fp_context)
31 .set push
32 SET_HARDFLOAT
31 li v0, 0 # assume success
32 cfc1 t1,fcr31
33 EX(swc1 $f0,(SC_FPREGS+0)(a0))
34 EX(swc1 $f1,(SC_FPREGS+8)(a0))
35 EX(swc1 $f2,(SC_FPREGS+16)(a0))
36 EX(swc1 $f3,(SC_FPREGS+24)(a0))
37 EX(swc1 $f4,(SC_FPREGS+32)(a0))
38 EX(swc1 $f5,(SC_FPREGS+40)(a0))

--- 21 unchanged lines hidden (view full) ---

60 EX(swc1 $f27,(SC_FPREGS+216)(a0))
61 EX(swc1 $f28,(SC_FPREGS+224)(a0))
62 EX(swc1 $f29,(SC_FPREGS+232)(a0))
63 EX(swc1 $f30,(SC_FPREGS+240)(a0))
64 EX(swc1 $f31,(SC_FPREGS+248)(a0))
65 EX(sw t1,(SC_FPC_CSR)(a0))
66 cfc1 t0,$0 # implementation/version
67 jr ra
33 li v0, 0 # assume success
34 cfc1 t1,fcr31
35 EX(swc1 $f0,(SC_FPREGS+0)(a0))
36 EX(swc1 $f1,(SC_FPREGS+8)(a0))
37 EX(swc1 $f2,(SC_FPREGS+16)(a0))
38 EX(swc1 $f3,(SC_FPREGS+24)(a0))
39 EX(swc1 $f4,(SC_FPREGS+32)(a0))
40 EX(swc1 $f5,(SC_FPREGS+40)(a0))

--- 21 unchanged lines hidden (view full) ---

62 EX(swc1 $f27,(SC_FPREGS+216)(a0))
63 EX(swc1 $f28,(SC_FPREGS+224)(a0))
64 EX(swc1 $f29,(SC_FPREGS+232)(a0))
65 EX(swc1 $f30,(SC_FPREGS+240)(a0))
66 EX(swc1 $f31,(SC_FPREGS+248)(a0))
67 EX(sw t1,(SC_FPC_CSR)(a0))
68 cfc1 t0,$0 # implementation/version
69 jr ra
70 .set pop
68 .set nomacro
69 EX(sw t0,(SC_FPC_EIR)(a0))
70 .set macro
71 END(_save_fp_context)
72
73/*
74 * Restore FPU state:
75 * - fp gp registers
76 * - cp1 status/control register
77 *
78 * We base the decision which registers to restore from the signal stack
79 * frame on the current content of c0_status, not on the content of the
80 * stack frame which might have been changed by the user.
81 */
82LEAF(_restore_fp_context)
71 .set nomacro
72 EX(sw t0,(SC_FPC_EIR)(a0))
73 .set macro
74 END(_save_fp_context)
75
76/*
77 * Restore FPU state:
78 * - fp gp registers
79 * - cp1 status/control register
80 *
81 * We base the decision which registers to restore from the signal stack
82 * frame on the current content of c0_status, not on the content of the
83 * stack frame which might have been changed by the user.
84 */
85LEAF(_restore_fp_context)
86 .set push
87 SET_HARDFLOAT
83 li v0, 0 # assume success
84 EX(lw t0,(SC_FPC_CSR)(a0))
85 EX(lwc1 $f0,(SC_FPREGS+0)(a0))
86 EX(lwc1 $f1,(SC_FPREGS+8)(a0))
87 EX(lwc1 $f2,(SC_FPREGS+16)(a0))
88 EX(lwc1 $f3,(SC_FPREGS+24)(a0))
89 EX(lwc1 $f4,(SC_FPREGS+32)(a0))
90 EX(lwc1 $f5,(SC_FPREGS+40)(a0))

--- 20 unchanged lines hidden (view full) ---

111 EX(lwc1 $f26,(SC_FPREGS+208)(a0))
112 EX(lwc1 $f27,(SC_FPREGS+216)(a0))
113 EX(lwc1 $f28,(SC_FPREGS+224)(a0))
114 EX(lwc1 $f29,(SC_FPREGS+232)(a0))
115 EX(lwc1 $f30,(SC_FPREGS+240)(a0))
116 EX(lwc1 $f31,(SC_FPREGS+248)(a0))
117 jr ra
118 ctc1 t0,fcr31
88 li v0, 0 # assume success
89 EX(lw t0,(SC_FPC_CSR)(a0))
90 EX(lwc1 $f0,(SC_FPREGS+0)(a0))
91 EX(lwc1 $f1,(SC_FPREGS+8)(a0))
92 EX(lwc1 $f2,(SC_FPREGS+16)(a0))
93 EX(lwc1 $f3,(SC_FPREGS+24)(a0))
94 EX(lwc1 $f4,(SC_FPREGS+32)(a0))
95 EX(lwc1 $f5,(SC_FPREGS+40)(a0))

--- 20 unchanged lines hidden (view full) ---

116 EX(lwc1 $f26,(SC_FPREGS+208)(a0))
117 EX(lwc1 $f27,(SC_FPREGS+216)(a0))
118 EX(lwc1 $f28,(SC_FPREGS+224)(a0))
119 EX(lwc1 $f29,(SC_FPREGS+232)(a0))
120 EX(lwc1 $f30,(SC_FPREGS+240)(a0))
121 EX(lwc1 $f31,(SC_FPREGS+248)(a0))
122 jr ra
123 ctc1 t0,fcr31
124 .set pop
119 END(_restore_fp_context)
120 .set reorder
121
122 .type fault@function
123 .ent fault
124fault: li v0, -EFAULT
125 jr ra
126 .end fault
125 END(_restore_fp_context)
126 .set reorder
127
128 .type fault@function
129 .ent fault
130fault: li v0, -EFAULT
131 jr ra
132 .end fault