summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/alpha/alpha/interrupt.c2
-rw-r--r--sys/alpha/alpha/ipl_funcs.c2
-rw-r--r--sys/alpha/include/cpu.h7
3 files changed, 6 insertions, 5 deletions
diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c
index 4f60ddf..c85e08d 100644
--- a/sys/alpha/alpha/interrupt.c
+++ b/sys/alpha/alpha/interrupt.c
@@ -75,6 +75,7 @@ interrupt(a0, a1, a2, framep)
struct trapframe *framep;
{
+ atomic_add_int(&intr_nesting_level, 1);
{
struct proc* p = curproc;
if (!p) p = &proc0;
@@ -134,6 +135,7 @@ interrupt(a0, a1, a2, framep)
a0, a1, a2);
/* NOTREACHED */
}
+ atomic_subtract_int(&intr_nesting_level, 1);
}
void
diff --git a/sys/alpha/alpha/ipl_funcs.c b/sys/alpha/alpha/ipl_funcs.c
index ab8a835..d13c47a 100644
--- a/sys/alpha/alpha/ipl_funcs.c
+++ b/sys/alpha/alpha/ipl_funcs.c
@@ -127,6 +127,7 @@ do_sir()
u_int32_t pend;
int i;
+ atomic_add_int(&intr_nesting_level, 1);
splsoft();
while ((pend = atomic_readandclear(&ipending)) != 0) {
for (i = 0; pend && i < 32; i++) {
@@ -139,6 +140,7 @@ do_sir()
}
}
}
+ atomic_subtract_int(&intr_nesting_level, 1);
}
#define GENSET(name, ptr, bit) \
diff --git a/sys/alpha/include/cpu.h b/sys/alpha/include/cpu.h
index b9ff12d..12436a1 100644
--- a/sys/alpha/include/cpu.h
+++ b/sys/alpha/include/cpu.h
@@ -65,11 +65,7 @@ struct clockframe {
#define CLKF_BASEPRI(framep) \
(((framep)->cf_tf.tf_regs[FRAME_PS] & ALPHA_PSL_IPL_MASK) == 0)
#define CLKF_PC(framep) ((framep)->cf_tf.tf_regs[FRAME_PC])
-/*
- * XXX No way to accurately tell if we were in interrupt mode before taking
- * clock interrupt.
- */
-#define CLKF_INTR(framep) (0)
+#define CLKF_INTR(framep) (intr_nesting_level >= 2)
/*
* Preempt the current process if in interrupt from user mode,
@@ -96,6 +92,7 @@ struct clockframe {
#ifdef KERNEL
u_int32_t astpending; /* need to trap before returning to user mode */
+u_int32_t intr_nesting_level; /* bookeeping only; counts software intr */
u_int32_t want_resched; /* resched() was called */
#endif
OpenPOWER on IntegriCloud