diff options
| author | Andrew Gallatin <gallatin@FreeBSD.org> | 1999-11-19 13:38:22 +0000 |
|---|---|---|
| committer | Andrew Gallatin <gallatin@FreeBSD.org> | 1999-11-19 13:38:22 +0000 |
| commit | d627ab83982688a7a1e0dcf78e393138b51e4144 (patch) | |
| tree | 0c261b0e8a872e3b7474ca3309c4b7ae1ba490c6 | |
| parent | 6c20390aa7fb34538e3ae4600bd600603c6711c2 (diff) | |
Notes
| -rw-r--r-- | sys/alpha/alpha/interrupt.c | 2 | ||||
| -rw-r--r-- | sys/alpha/alpha/ipl_funcs.c | 2 | ||||
| -rw-r--r-- | sys/alpha/include/cpu.h | 7 |
3 files changed, 6 insertions, 5 deletions
diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c index 4f60ddf44f0f..c85e08d857bc 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 ab8a83545e39..d13c47adb342 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 b9ff12de5b60..12436a15e2ba 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 |
