Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips For MIPS software masking option, when returni...



details:   https://anonhg.NetBSD.org/src/rev/c31a0f3cdf46
branches:  trunk
changeset: 500642:c31a0f3cdf46
user:      jeffs <jeffs%NetBSD.org@localhost>
date:      Thu Dec 14 21:29:51 2000 +0000

description:
For MIPS software masking option, when returning to user mode apply
the mask to all interrupts to catch changes in the mask state faster.
Does not affect platforms w/o this option enabled.

diffstat:

 sys/arch/mips/include/asm.h       |  7 ++++++-
 sys/arch/mips/mips/locore.S       |  9 ++++++++-
 sys/arch/mips/mips/locore_mips3.S |  8 ++++----
 3 files changed, 18 insertions(+), 6 deletions(-)

diffs (82 lines):

diff -r 9d2a1b232719 -r c31a0f3cdf46 sys/arch/mips/include/asm.h
--- a/sys/arch/mips/include/asm.h       Thu Dec 14 21:24:53 2000 +0000
+++ b/sys/arch/mips/include/asm.h       Thu Dec 14 21:29:51 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: asm.h,v 1.28 2000/08/30 22:31:12 jeffs Exp $   */
+/*     $NetBSD: asm.h,v 1.29 2000/12/14 21:29:51 jeffs Exp $   */
 
 /*
  * Copyright (c) 1992, 1993
@@ -310,8 +310,13 @@
 #define DYNAMIC_STATUS_MASK(sr,scratch)        \
        lw      scratch, mips_dynamic_status_mask; \
        and     sr, sr, scratch
+
+#define DYNAMIC_STATUS_MASK_TOUSER(sr,scratch1)                \
+       ori     sr, (MIPS_INT_MASK | MIPS_SR_INT_IE);   \
+       DYNAMIC_STATUS_MASK(sr,scratch1)
 #else
 #define DYNAMIC_STATUS_MASK(sr,scratch)
+#define DYNAMIC_STATUS_MASK_TOUSER(sr,scratch1)
 #endif
 
 #endif /* _MIPS_ASM_H */
diff -r 9d2a1b232719 -r c31a0f3cdf46 sys/arch/mips/mips/locore.S
--- a/sys/arch/mips/mips/locore.S       Thu Dec 14 21:24:53 2000 +0000
+++ b/sys/arch/mips/mips/locore.S       Thu Dec 14 21:29:51 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.119 2000/10/31 23:39:25 jeffs Exp $       */
+/*     $NetBSD: locore.S,v 1.120 2000/12/14 21:29:51 jeffs Exp $       */
 
 /*
  * Copyright (c) 1992, 1993
@@ -297,6 +297,13 @@
        jal     _C_LABEL(uvm_pageidlezero)
        nop
 1:
+#ifdef MIPS_DYNAMIC_STATUS_MASK
+       # Do this again since the mask may have changed.
+       li      t3, (MIPS_INT_MASK | MIPS_SR_INT_IE)
+       DYNAMIC_STATUS_MASK(t3,t1)              # machine dependent masking
+       mtc0    t3, MIPS_COP_0_STATUS           # enable all interrupts
+       nop
+#endif
        lw      t0, _C_LABEL(sched_whichqs)     # look for non-empty queue
        nop
        beq     t0, zero, 1b
diff -r 9d2a1b232719 -r c31a0f3cdf46 sys/arch/mips/mips/locore_mips3.S
--- a/sys/arch/mips/mips/locore_mips3.S Thu Dec 14 21:24:53 2000 +0000
+++ b/sys/arch/mips/mips/locore_mips3.S Thu Dec 14 21:29:51 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore_mips3.S,v 1.60 2000/11/27 06:37:32 nisimura Exp $       */
+/*     $NetBSD: locore_mips3.S,v 1.61 2000/12/14 21:29:51 jeffs Exp $  */
 
 /*
  * Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author)
@@ -595,7 +595,7 @@
        REG_L   t8, FRAME_T8(k1)
        REG_L   t9, FRAME_T9(k1)
        REG_L   k0, FRAME_SR(k1)
-       DYNAMIC_STATUS_MASK(k0,ra)              # machine dependent masking
+       DYNAMIC_STATUS_MASK_TOUSER(k0,ra)       # machine dependent masking
        REG_L   gp, FRAME_GP(k1)
        REG_L   sp, FRAME_SP(k1)
        REG_L   s8, FRAME_S8(k1)
@@ -730,7 +730,7 @@
        REG_L   t8, FRAME_T8(k1)
        REG_L   t9, FRAME_T9(k1)
        REG_L   k0, FRAME_SR(k1)
-       DYNAMIC_STATUS_MASK(k0,ra)              # machine dependent masking
+       DYNAMIC_STATUS_MASK_TOUSER(k0,ra)       # machine dependent masking
        REG_L   gp, FRAME_GP(k1)
        REG_L   sp, FRAME_SP(k1)
        REG_L   s8, FRAME_S8(k1)
@@ -1012,7 +1012,7 @@
        REG_L   t8, FRAME_T8(k1)
        REG_L   t9, FRAME_T9(k1)
        REG_L   k0, FRAME_SR(k1)
-       DYNAMIC_STATUS_MASK(k0,ra)              # machine dependent masking
+       DYNAMIC_STATUS_MASK_TOUSER(k0,ra)       # machine dependent masking
        REG_L   gp, FRAME_GP(k1)
        REG_L   sp, FRAME_SP(k1)
        REG_L   ra, FRAME_RA(k1)



Home | Main Index | Thread Index | Old Index