Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: cps-vec: Use macros for various arithmetics and memory operations

Replace lw/sw and various arithmetic instructions with macros so the
code can work on 64-bit kernels as well.

Cc: <stable@vger.kernel.org> # 3.16+
Reviewed-by: Paul Burton <paul.burton@imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: stable@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/10591/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Markos Chandras and committed by
Ralf Baechle
b677bc03 717f1425

+16 -16
+16 -16
arch/mips/kernel/cps-vec.S
··· 108 108 mul t1, t1, t2 109 109 110 110 li a0, CKSEG0 111 - add a1, a0, t1 111 + PTR_ADD a1, a0, t1 112 112 1: cache Index_Store_Tag_I, 0(a0) 113 - add a0, a0, t0 113 + PTR_ADD a0, a0, t0 114 114 bne a0, a1, 1b 115 115 nop 116 116 icache_done: ··· 135 135 mul t1, t1, t2 136 136 137 137 li a0, CKSEG0 138 - addu a1, a0, t1 139 - subu a1, a1, t0 138 + PTR_ADDU a1, a0, t1 139 + PTR_SUBU a1, a1, t0 140 140 1: cache Index_Store_Tag_D, 0(a0) 141 141 bne a0, a1, 1b 142 - add a0, a0, t0 142 + PTR_ADD a0, a0, t0 143 143 dcache_done: 144 144 145 145 /* Set Kseg0 CCA to that in s0 */ ··· 152 152 153 153 /* Enter the coherent domain */ 154 154 li t0, 0xff 155 - sw t0, GCR_CL_COHERENCE_OFS(v1) 155 + PTR_S t0, GCR_CL_COHERENCE_OFS(v1) 156 156 ehb 157 157 158 158 /* Jump to kseg0 */ ··· 178 178 nop 179 179 180 180 /* Off we go! */ 181 - lw t1, VPEBOOTCFG_PC(v0) 182 - lw gp, VPEBOOTCFG_GP(v0) 183 - lw sp, VPEBOOTCFG_SP(v0) 181 + PTR_L t1, VPEBOOTCFG_PC(v0) 182 + PTR_L gp, VPEBOOTCFG_GP(v0) 183 + PTR_L sp, VPEBOOTCFG_SP(v0) 184 184 jr t1 185 185 nop 186 186 END(mips_cps_core_entry) ··· 299 299 LEAF(mips_cps_boot_vpes) 300 300 /* Retrieve CM base address */ 301 301 PTR_LA t0, mips_cm_base 302 - lw t0, 0(t0) 302 + PTR_L t0, 0(t0) 303 303 304 304 /* Calculate a pointer to this cores struct core_boot_config */ 305 - lw t0, GCR_CL_ID_OFS(t0) 305 + PTR_L t0, GCR_CL_ID_OFS(t0) 306 306 li t1, COREBOOTCFG_SIZE 307 307 mul t0, t0, t1 308 308 PTR_LA t1, mips_cps_core_bootcfg 309 - lw t1, 0(t1) 310 - addu t0, t0, t1 309 + PTR_L t1, 0(t1) 310 + PTR_ADDU t0, t0, t1 311 311 312 312 /* Calculate this VPEs ID. If the core doesn't support MT use 0 */ 313 313 has_mt ta2, 1f ··· 334 334 1: /* Calculate a pointer to this VPEs struct vpe_boot_config */ 335 335 li t1, VPEBOOTCFG_SIZE 336 336 mul v0, t9, t1 337 - lw ta3, COREBOOTCFG_VPECONFIG(t0) 338 - addu v0, v0, ta3 337 + PTR_L ta3, COREBOOTCFG_VPECONFIG(t0) 338 + PTR_ADDU v0, v0, ta3 339 339 340 340 #ifdef CONFIG_MIPS_MT 341 341 ··· 360 360 ehb 361 361 362 362 /* Loop through each VPE */ 363 - lw ta2, COREBOOTCFG_VPEMASK(t0) 363 + PTR_L ta2, COREBOOTCFG_VPEMASK(t0) 364 364 move t8, ta2 365 365 li ta1, 0 366 366