Skip to content

Commit 6179ef4

Browse files
committed
xtensa: use callx0 opcode in fast_coprocessor
Instead of emulating call0 in fast_coprocessor use that opcode directly. Use 'ret' instead of 'jx a0'. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
1 parent 9fa8c59 commit 6179ef4

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

arch/xtensa/kernel/coprocessor.S

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
.align 4; \
3131
.Lsave_cp_regs_cp##x: \
3232
xchal_cp##x##_store a2 a3 a4 a5 a6; \
33-
jx a0; \
33+
ret; \
3434
.endif
3535

3636
#define SAVE_CP_REGS_TAB(x) \
@@ -47,7 +47,7 @@
4747
.align 4; \
4848
.Lload_cp_regs_cp##x: \
4949
xchal_cp##x##_load a2 a3 a4 a5 a6; \
50-
jx a0; \
50+
ret; \
5151
.endif
5252

5353
#define LOAD_CP_REGS_TAB(x) \
@@ -163,21 +163,20 @@ ENTRY(fast_coprocessor)
163163
s32i a5, a4, THREAD_CPENABLE
164164

165165
/*
166-
* Get context save area and 'call' save routine.
166+
* Get context save area and call save routine.
167167
* (a4 still holds previous owner (thread_info), a3 CP number)
168168
*/
169169

170170
movi a5, .Lsave_cp_regs_jump_table
171-
movi a0, 2f # a0: 'return' address
172171
addx8 a3, a3, a5 # a3: coprocessor number
173172
l32i a2, a3, 4 # a2: xtregs offset
174173
l32i a3, a3, 0 # a3: jump address
175174
add a2, a2, a4
176-
jx a3
175+
callx0 a3
177176

178177
/* Note that only a0 and a1 were preserved. */
179178

180-
2: rsr a3, exccause
179+
rsr a3, exccause
181180
addi a3, a3, -EXCCAUSE_COPROCESSOR0_DISABLED
182181
movi a0, coprocessor_owner
183182
addx4 a0, a3, a0
@@ -187,19 +186,18 @@ ENTRY(fast_coprocessor)
187186
1: GET_THREAD_INFO (a4, a1)
188187
s32i a4, a0, 0
189188

190-
/* Get context save area and 'call' load routine. */
189+
/* Get context save area and call load routine. */
191190

192191
movi a5, .Lload_cp_regs_jump_table
193-
movi a0, 1f
194192
addx8 a3, a3, a5
195193
l32i a2, a3, 4 # a2: xtregs offset
196194
l32i a3, a3, 0 # a3: jump address
197195
add a2, a2, a4
198-
jx a3
196+
callx0 a3
199197

200198
/* Restore all registers and return from exception handler. */
201199

202-
1: l32i a6, a1, PT_AREG6
200+
l32i a6, a1, PT_AREG6
203201
l32i a5, a1, PT_AREG5
204202
l32i a4, a1, PT_AREG4
205203

0 commit comments

Comments
 (0)