Skip to content

Commit 0586ac7

Browse files
Markos Chandrasralfbaechle
authored andcommitted
MIPS: kernel: cps-vec: Use ta0-ta3 pseudo-registers for 64-bit
The cps-vec code assumes O32 ABI and uses t4-t7 in quite a few places. This breaks the build on 64-bit. As a result of which, use the pseudo-registers ta0-ta3 to make the code compatible with 64-bit. Cc: <[email protected]> # 3.16+ Reviewed-by: Paul Burton <[email protected]> Signed-off-by: Markos Chandras <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/10589/ Signed-off-by: Ralf Baechle <[email protected]>
1 parent 977e043 commit 0586ac7

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

arch/mips/kernel/cps-vec.S

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -250,25 +250,25 @@ LEAF(mips_cps_core_init)
250250
mfc0 t0, CP0_MVPCONF0
251251
srl t0, t0, MVPCONF0_PVPE_SHIFT
252252
andi t0, t0, (MVPCONF0_PVPE >> MVPCONF0_PVPE_SHIFT)
253-
addiu t7, t0, 1
253+
addiu ta3, t0, 1
254254

255255
/* If there's only 1, we're done */
256256
beqz t0, 2f
257257
nop
258258

259259
/* Loop through each VPE within this core */
260-
li t5, 1
260+
li ta1, 1
261261

262262
1: /* Operate on the appropriate TC */
263-
mtc0 t5, CP0_VPECONTROL
263+
mtc0 ta1, CP0_VPECONTROL
264264
ehb
265265

266266
/* Bind TC to VPE (1:1 TC:VPE mapping) */
267-
mttc0 t5, CP0_TCBIND
267+
mttc0 ta1, CP0_TCBIND
268268

269269
/* Set exclusive TC, non-active, master */
270270
li t0, VPECONF0_MVP
271-
sll t1, t5, VPECONF0_XTC_SHIFT
271+
sll t1, ta1, VPECONF0_XTC_SHIFT
272272
or t0, t0, t1
273273
mttc0 t0, CP0_VPECONF0
274274

@@ -280,8 +280,8 @@ LEAF(mips_cps_core_init)
280280
mttc0 t0, CP0_TCHALT
281281

282282
/* Next VPE */
283-
addiu t5, t5, 1
284-
slt t0, t5, t7
283+
addiu ta1, ta1, 1
284+
slt t0, ta1, ta3
285285
bnez t0, 1b
286286
nop
287287

@@ -310,7 +310,7 @@ LEAF(mips_cps_boot_vpes)
310310
addu t0, t0, t1
311311

312312
/* Calculate this VPEs ID. If the core doesn't support MT use 0 */
313-
has_mt t6, 1f
313+
has_mt ta2, 1f
314314
li t9, 0
315315

316316
/* Find the number of VPEs present in the core */
@@ -334,13 +334,13 @@ LEAF(mips_cps_boot_vpes)
334334
1: /* Calculate a pointer to this VPEs struct vpe_boot_config */
335335
li t1, VPEBOOTCFG_SIZE
336336
mul v0, t9, t1
337-
lw t7, COREBOOTCFG_VPECONFIG(t0)
338-
addu v0, v0, t7
337+
lw ta3, COREBOOTCFG_VPECONFIG(t0)
338+
addu v0, v0, ta3
339339

340340
#ifdef CONFIG_MIPS_MT
341341

342342
/* If the core doesn't support MT then return */
343-
bnez t6, 1f
343+
bnez ta2, 1f
344344
nop
345345
jr ra
346346
nop
@@ -360,20 +360,20 @@ LEAF(mips_cps_boot_vpes)
360360
ehb
361361

362362
/* Loop through each VPE */
363-
lw t6, COREBOOTCFG_VPEMASK(t0)
364-
move t8, t6
365-
li t5, 0
363+
lw ta2, COREBOOTCFG_VPEMASK(t0)
364+
move t8, ta2
365+
li ta1, 0
366366

367367
/* Check whether the VPE should be running. If not, skip it */
368-
1: andi t0, t6, 1
368+
1: andi t0, ta2, 1
369369
beqz t0, 2f
370370
nop
371371

372372
/* Operate on the appropriate TC */
373373
mfc0 t0, CP0_VPECONTROL
374374
ori t0, t0, VPECONTROL_TARGTC
375375
xori t0, t0, VPECONTROL_TARGTC
376-
or t0, t0, t5
376+
or t0, t0, ta1
377377
mtc0 t0, CP0_VPECONTROL
378378
ehb
379379

@@ -384,8 +384,8 @@ LEAF(mips_cps_boot_vpes)
384384

385385
/* Calculate a pointer to the VPEs struct vpe_boot_config */
386386
li t0, VPEBOOTCFG_SIZE
387-
mul t0, t0, t5
388-
addu t0, t0, t7
387+
mul t0, t0, ta1
388+
addu t0, t0, ta3
389389

390390
/* Set the TC restart PC */
391391
lw t1, VPEBOOTCFG_PC(t0)
@@ -423,9 +423,9 @@ LEAF(mips_cps_boot_vpes)
423423
mttc0 t0, CP0_VPECONF0
424424

425425
/* Next VPE */
426-
2: srl t6, t6, 1
427-
addiu t5, t5, 1
428-
bnez t6, 1b
426+
2: srl ta2, ta2, 1
427+
addiu ta1, ta1, 1
428+
bnez ta2, 1b
429429
nop
430430

431431
/* Leave VPE configuration state */

0 commit comments

Comments
 (0)