Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mips/mips Only jump through t9/ra (or k0) to help a...
details: https://anonhg.NetBSD.org/src/rev/a33d8fb06759
branches: trunk
changeset: 768389:a33d8fb06759
user: matt <matt%NetBSD.org@localhost>
date: Tue Aug 16 06:55:11 2011 +0000
description:
Only jump through t9/ra (or k0) to help avoid hitting
the Loongson2 jump problem.
diffstat:
sys/arch/mips/mips/bds_emul.S | 25 ++++++++++++++-----------
sys/arch/mips/mips/copy.S | 6 +++---
sys/arch/mips/mips/fp.S | 26 +++++++++++++-------------
sys/arch/mips/mips/locore.S | 24 ++++++++++++------------
sys/arch/mips/mips/locore_mips3.S | 32 ++++++++++++++++----------------
sys/arch/mips/mips/mipsX_subr.S | 35 +++++++++++++++++++++++++----------
6 files changed, 83 insertions(+), 65 deletions(-)
diffs (truncated from 555 to 300 lines):
diff -r cb2809d28aba -r a33d8fb06759 sys/arch/mips/mips/bds_emul.S
--- a/sys/arch/mips/mips/bds_emul.S Tue Aug 16 05:28:44 2011 +0000
+++ b/sys/arch/mips/mips/bds_emul.S Tue Aug 16 06:55:11 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bds_emul.S,v 1.4 2011/02/26 11:27:59 tsutsui Exp $ */
+/* $NetBSD: bds_emul.S,v 1.5 2011/08/16 06:55:11 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -66,8 +66,8 @@
srl t0, a0, 26-PTR_SCALESHIFT
andi t0, 0x3F << PTR_SCALESHIFT
- PTR_L t0, bcemul_optbl(t0)
- j t0
+ PTR_L t9, bcemul_optbl(t0)
+ jr t9
.rdata
bcemul_optbl:
@@ -173,7 +173,7 @@
REG_PROLOGUE
REG_L v0, TF_REG_ZERO(t1) # load source
REG_EPILOGUE
- j ra # execute the instruction
+ jr ra # execute the instruction
bcemul_uimmed_prologue:
srl t1, a0, 21-REG_SCALESHIFT # rs (source)
@@ -186,7 +186,7 @@
REG_PROLOGUE
REG_L v0, TF_REG_ZERO(t1) # load source
REG_EPILOGUE
- j ra
+ jr ra
#ifndef __mips_o32
bcemul_daddi:
@@ -441,11 +441,12 @@
andi t0, a0, 0x3f # get special code
sll t1, t0, 3 # calculate index in specialop
sll t0, PTR_SCALESHIFT
- PTR_LA t9, bcemul_special_op(t1)
- PTR_L t0, bcemul_specialtbl(t0)
- j t0
+ PTR_LA t0, bcemul_special_op(t1)
+ PTR_L t9, bcemul_specialtbl(t0)
+ jr t9
bcemul_special_3op_prologue:
+ move t9, t0
srl t0, a0, 21-REG_SCALESHIFT # rs (source1)
srl t1, a0, 16-REG_SCALESHIFT # rt (source2)
srl t2, a0, 11-REG_SCALESHIFT # rd (dest)
@@ -459,9 +460,10 @@
REG_L v0, TF_REG_ZERO(t0) # load source1
REG_L v1, TF_REG_ZERO(t1) # load source2
REG_EPILOGUE
- j t9
+ jr t9
bcemul_special_2src_prologue:
+ move t9, t0
srl t0, a0, 21-REG_SCALESHIFT # rs (source1)
srl t1, a0, 16-REG_SCALESHIFT # rt (source2)
andi t0, REG_REGMASK
@@ -472,9 +474,10 @@
REG_L v0, TF_REG_ZERO(t0) # load source1
REG_L v1, TF_REG_ZERO(t1) # load source2
REG_EPILOGUE
- j t9
+ jr t9
bcemul_special_genshift:
+ move t9, t0
srl t1, a0, 16-REG_SCALESHIFT # rt (source)
srl t2, a0, 11-REG_SCALESHIFT # rd (dest)
srl v1, a0, 6 # sa
@@ -606,7 +609,7 @@
REG_L ra, CALLFRAME_RA(sp)
REG_L s0, CALLFRAME_S0(sp)
PTR_ADDU sp, CALLFRAME_SIZ
- j ra
+ jr ra
/*
* Send SIGILL, SIGFPE.
diff -r cb2809d28aba -r a33d8fb06759 sys/arch/mips/mips/copy.S
--- a/sys/arch/mips/mips/copy.S Tue Aug 16 05:28:44 2011 +0000
+++ b/sys/arch/mips/mips/copy.S Tue Aug 16 06:55:11 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: copy.S,v 1.14 2011/07/06 09:27:35 matt Exp $ */
+/* $NetBSD: copy.S,v 1.15 2011/08/16 06:55:11 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -499,9 +499,9 @@
PTR_S v0, PCB_ONFAULT(v1)
INT_S a1, 0(a0) # store word
PTR_S zero, PCB_ONFAULT(v1)
- PTR_L v1, _C_LABEL(mips_cache_ops) + MIPSX_FLUSHICACHE
+ PTR_L t9, _C_LABEL(mips_cache_ops) + MIPSX_FLUSHICACHE
move v0, zero
- j v1 # NOTE: must not clobber v0!
+ j t9 # NOTE: must not clobber v0!
li a1, 4 # size of word
END(ustore_uint32_isync)
diff -r cb2809d28aba -r a33d8fb06759 sys/arch/mips/mips/fp.S
--- a/sys/arch/mips/mips/fp.S Tue Aug 16 05:28:44 2011 +0000
+++ b/sys/arch/mips/mips/fp.S Tue Aug 16 06:55:11 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fp.S,v 1.43 2011/02/26 15:41:32 tsutsui Exp $ */
+/* $NetBSD: fp.S,v 1.44 2011/08/16 06:55:11 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -151,29 +151,29 @@
single_op:
andi v0, a0, 0x3F # get FUNC field
sll v0, v0, PTR_SCALESHIFT
- PTR_L v0, func_single_tbl(v0)
- j v0
+ PTR_L t9, func_single_tbl(v0)
+ j t9
double_op:
andi v0, a0, 0x3F # get FUNC field
sll v0, v0, PTR_SCALESHIFT
- PTR_L v0, func_double_tbl(v0)
- j v0
+ PTR_L t9, func_double_tbl(v0)
+ j t9
single_fixed_op:
andi v0, a0, 0x3F # get FUNC field
sll v0, v0, PTR_SCALESHIFT
- PTR_L v0, func_single_fixed_tbl(v0)
- j v0
+ PTR_L t9, func_single_fixed_tbl(v0)
+ j t9
long_fixed_op:
andi v0, a0, 0x3F # get FUNC field
sll v0, v0, PTR_SCALESHIFT
- PTR_L v0, func_long_fixed_tbl(v0)
- j v0
+ PTR_L t9, func_long_fixed_tbl(v0)
+ j t9
#if (defined(__mips_n32) || defined(__mips_n64)) && 0
paired_single_op:
andi v0, a0, 0x3F # get FUNC field
sll v0, v0, PTR_SCALESHIFT
- PTR_L v0, func_paired_single_tbl(v0)
- j v0
+ PTR_L t9, func_paired_single_tbl(v0)
+ j t9
#else
#define paired_single_op ill
#endif
@@ -766,8 +766,8 @@
branchc1:
srl v0, a0, 16 - PTR_SCALESHIFT
andi v0, v0, 0x1f << PTR_SCALESHIFT
- PTR_L v0, branchc1_tbl(v0)
- j v0
+ PTR_L t9, branchc1_tbl(v0)
+ j t9
.rdata
branchc1_tbl:
diff -r cb2809d28aba -r a33d8fb06759 sys/arch/mips/mips/locore.S
--- a/sys/arch/mips/mips/locore.S Tue Aug 16 05:28:44 2011 +0000
+++ b/sys/arch/mips/mips/locore.S Tue Aug 16 06:55:11 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.187 2011/04/06 13:30:33 tsutsui Exp $ */
+/* $NetBSD: locore.S,v 1.188 2011/08/16 06:55:12 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -332,7 +332,7 @@
#if IPL_SCHED != IPL_HIGH
j _C_LABEL(splhigh_noprof)
#else
- j ra
+ jr ra
#endif
PTR_ADDU sp, CALLFRAME_SIZ
@@ -412,7 +412,7 @@
/*
* Almost everything (all except sp) is restored so we can return.
*/
- j ra
+ jr ra
PTR_ADDU sp, CALLFRAME_SIZ
END(softint_fast_dispatch)
#endif /* __HAVE_FAST_SOFTINTS */
@@ -435,7 +435,7 @@
li v0, 0 # load success
1:
PTR_S zero, PCB_ONFAULT(t0) # reset fault handler
- j ra # and return.
+ jr ra # and return.
nop
END(lwp_oncpu)
@@ -468,7 +468,7 @@
REG_S ra, PCB_CONTEXT+SF_REG_RA(a0)
REG_S v0, PCB_CONTEXT+SF_REG_SR(a0)
REG_EPILOGUE
- j ra
+ jr ra
move v0, zero
END(savectx)
@@ -497,7 +497,7 @@
REG_S ra, SF_REG_RA(a0)
REG_S v0, SF_REG_SR(a0)
REG_EPILOGUE
- j ra
+ jr ra
move v0, zero
END(setjmp)
@@ -523,7 +523,7 @@
REG_EPILOGUE
mtc0 v0, MIPS_COP_0_STATUS
COP0_SYNC
- j ra
+ jr ra
li v0, 1
END(longjmp)
#endif
@@ -538,7 +538,7 @@
*/
LEAF_NOPROFILE(mips_cp0_cause_read)
mfc0 v0, MIPS_COP_0_CAUSE
- j ra
+ jr ra
nop
END(mips_cp0_cause_read)
@@ -560,7 +560,7 @@
*/
LEAF(mips_cp0_status_read)
mfc0 v0, MIPS_COP_0_STATUS
- j ra
+ jr ra
nop
END(mips_cp0_status_read)
@@ -731,7 +731,7 @@
bgtz a2, 1b
PTR_ADDU a0, 8*SZREG
.set pop
- j ra
+ jr ra
nop
END(mips_pagecopy)
@@ -755,7 +755,7 @@
bgtz a1,1b
PTR_ADDU a0, 8*SZREG
.set pop
- j ra
+ jr ra
nop
END(mips_pagezero)
@@ -813,7 +813,7 @@
REG_L ra, XCALLFRAME_RA(sp)
PTR_ADDU sp, XCALLFRAME_SIZ
- j ra
+ jr ra
nop
#undef XCALLFRAME_RA
#undef XCALLFRAME_SIZ
diff -r cb2809d28aba -r a33d8fb06759 sys/arch/mips/mips/locore_mips3.S
--- a/sys/arch/mips/mips/locore_mips3.S Tue Aug 16 05:28:44 2011 +0000
+++ b/sys/arch/mips/mips/locore_mips3.S Tue Aug 16 06:55:11 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore_mips3.S,v 1.101 2011/07/31 15:39:29 matt Exp $ */
+/* $NetBSD: locore_mips3.S,v 1.102 2011/08/16 06:55:11 matt Exp $ */
/*
* Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author)
@@ -158,7 +158,7 @@
XLEAF(mips64r2_wbflush)
nop
sync
- j ra
+ jr ra
nop
END(mips3_wbflush)
@@ -185,7 +185,7 @@
nop
nop
nop
- j ra
+ jr ra
Home |
Main Index |
Thread Index |
Old Index