Module Name: src Committed By: matt Date: Sun Feb 28 03:28:54 UTC 2010
Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: lock_stubs.S locore.S mipsX_subr.S Log Message: Change from indirect calls to direct calls to spl* routines. To generate a diff of this commit: cvs rdiff -u -r1.9.18.9 -r1.9.18.10 src/sys/arch/mips/mips/lock_stubs.S cvs rdiff -u -r1.167.38.16 -r1.167.38.17 src/sys/arch/mips/mips/locore.S cvs rdiff -u -r1.26.36.1.2.28 -r1.26.36.1.2.29 \ src/sys/arch/mips/mips/mipsX_subr.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/mips/mips/lock_stubs.S diff -u src/sys/arch/mips/mips/lock_stubs.S:1.9.18.9 src/sys/arch/mips/mips/lock_stubs.S:1.9.18.10 --- src/sys/arch/mips/mips/lock_stubs.S:1.9.18.9 Sat Feb 27 19:22:47 2010 +++ src/sys/arch/mips/mips/lock_stubs.S Sun Feb 28 03:28:54 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: lock_stubs.S,v 1.9.18.9 2010/02/27 19:22:47 snj Exp $ */ +/* $NetBSD: lock_stubs.S,v 1.9.18.10 2010/02/28 03:28:54 matt Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -254,8 +254,7 @@ * (only uses a0-a3 and v0-v1) */ move t3, ra # need to save ra - PTR_L t9, _C_LABEL(mips_splsw) + SPLSW_SPLRAISE - jalr t9 + jal _C_LABEL(splraise) move a0, ta0 move ra, t3 # move ra back #ifdef PARANOIA @@ -468,8 +467,7 @@ * call splraise (only uses a0-a3, v0-v1, and ra) */ move t3, ra - PTR_L t9, _C_LABEL(mips_splsw) + SPLSW_SPLRAISE - jalr t9 + jal _C_LABEL(splraise) nop move ra, t3 @@ -630,17 +628,18 @@ #endif /* PARANOIA */ beq a0, a1, 1f # if oldspl == cpl - move t9, ra # no reason to drop ipl + nop # no reason to drop ipl bltz t0, 1f # there are still holders - move t9, ra # so don't drop IPL + nop # so don't drop IPL /* * Mutex count is zero so we need to restore the old IPL */ - PTR_L t9, _C_LABEL(mips_splsw) + SPLSW_SPLX + j _C_LABEL(splx) + nop 1: - j t9 + j ra nop #if defined(DIAGNOSTIC) 2: Index: src/sys/arch/mips/mips/locore.S diff -u src/sys/arch/mips/mips/locore.S:1.167.38.16 src/sys/arch/mips/mips/locore.S:1.167.38.17 --- src/sys/arch/mips/mips/locore.S:1.167.38.16 Thu Feb 25 05:45:12 2010 +++ src/sys/arch/mips/mips/locore.S Sun Feb 28 03:28:54 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.167.38.16 2010/02/25 05:45:12 matt Exp $ */ +/* $NetBSD: locore.S,v 1.167.38.17 2010/02/28 03:28:54 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -148,8 +148,7 @@ /* * Raise to IPLHIGH */ - PTR_L t9, _C_LABEL(mips_splsw) + SPLSW_SPLHIGH - jalr t9 # splhigh() + jal _C_LABEL(splhigh_noprof) # go to splhigh nop /* * Now enable interrupts (but they are all masked). @@ -236,8 +235,9 @@ /* * Switch to new context. */ - PTR_L t9, _C_LABEL(mips_locoresw) + MIPSX_CPU_SWITCH_RESUME - jalr t9 + .globl _C_LABEL(__cpu_switchto_fixup) +_C_LABEL(__cpu_switchto_fixup): + jal _C_LABEL(mips_cpu_switch_resume) move a0, MIPS_CURLWP PTR_L t2, L_CPU(MIPS_CURLWP) @@ -247,7 +247,6 @@ /* Check for restartable atomic sequences (RAS) */ PTR_L a0, L_PROC(MIPS_CURLWP) # argument to ras_lookup PTR_L s5, L_ADDR(MIPS_CURLWP) - nop # patchable load deay slot PTR_L v1, P_RASLIST(a0) # get raslist beqz v1, 1f # skip call if empty nop @@ -374,7 +373,6 @@ PTR_L s1, L_CPU(MIPS_CURLWP) # get curcpu() nop # patchable load delay slot PTR_S MIPS_CURLWP, CPU_INFO_CURLWP(s1) # ... - nop # patchable slot move s2, sp # remember sp move s3, t0 # remember curpcb @@ -387,19 +385,18 @@ move MIPS_CURLWP, s0 # restore curlwp PTR_S MIPS_CURLWP, CPU_INFO_CURLWP(s1) # .... + REG_L ra, CALLFRAME_RA(sp) # load early since we use it + REG_PROLOGUE REG_L s0, U_PCB_CONTEXT+SF_REG_S0(s3) # restore the saved - nop # patchable delay slot REG_L s1, U_PCB_CONTEXT+SF_REG_S1(s3) # registers that we - nop # patchable delay slot REG_L s2, U_PCB_CONTEXT+SF_REG_S2(s3) # used REG_L s3, U_PCB_CONTEXT+SF_REG_S3(s3) REG_EPILOGUE /* - * Almost everything (all except sp) is restored so we ca retrn. + * Almost everything (all except sp) is restored so we can return. */ - REG_L ra, CALLFRAME_RA(sp) j ra PTR_ADDU sp, CALLFRAME_SIZ END(softint_fast_dispatch) Index: src/sys/arch/mips/mips/mipsX_subr.S diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.28 src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.29 --- src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.28 Sat Feb 27 20:32:04 2010 +++ src/sys/arch/mips/mips/mipsX_subr.S Sun Feb 28 03:28:54 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: mipsX_subr.S,v 1.26.36.1.2.28 2010/02/27 20:32:04 snj Exp $ */ +/* $NetBSD: mipsX_subr.S,v 1.26.36.1.2.29 2010/02/28 03:28:54 matt Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -1117,8 +1117,7 @@ /* * We first need to get to IPL_HIGH so that interrupts are masked. */ - PTR_L t9, _C_LABEL(mips_splsw) + SPLSW_SPLHIGH - jalr t9 + jal _C_LABEL(splhigh_noprof) nop #ifdef PARANOIA @@ -1234,8 +1233,7 @@ /* * Restore IPL knowing interrupts are disabled */ - PTR_L t9, _C_LABEL(mips_splsw) + SPLSW_SPLX - jalr t9 # splx(ppl) + jal _C_LABEL(splx_noprof) # splx(ppl) nop #ifdef PARANOIA @@ -1393,8 +1391,7 @@ /* * We first need to get to IPL_HIGH so that interrupts are masked. */ - PTR_L t9, _C_LABEL(mips_splsw) + SPLSW_SPLHIGH - jalr t9 # splhigh() + jal _C_LABEL(splhigh_noprof) # splhigh() nop move s0, v0 # remember previous priority @@ -1469,8 +1466,7 @@ /* * Restore IPL knowing interrupts are off */ - PTR_L t9, _C_LABEL(mips_splsw) + SPLSW_SPLX - jalr t9 + jal _C_LABEL(splx_noprof) move a0, s0 # fetch previous priority level /*