From 651c378316119ce7911952aa0b17d41455352653 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 15 Nov 2000 21:56:50 +0000 Subject: [PATCH] - Don't acquire/release Giant during an interrupt context for machine checks, clock interrupts, and device interrupts. - Assert that Giant is not owned during the main loop of ithd_loop(). --- sys/alpha/alpha/interrupt.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c index a95564aa70c7..4d3ddc948c62 100644 --- a/sys/alpha/alpha/interrupt.c +++ b/sys/alpha/alpha/interrupt.c @@ -99,7 +99,6 @@ interrupt(a0, a1, a2, framep) struct proc *p = curproc; if (!p) p = &proc0; if ((caddr_t) framep < (caddr_t) p->p_addr + 1024) { - mtx_enter(&Giant, MTX_DEF); panic("possible stack overflow\n"); } } @@ -121,33 +120,25 @@ interrupt(a0, a1, a2, framep) return; } - mtx_enter(&Giant, MTX_DEF); alpha_clock_interrupt(framep); - mtx_exit(&Giant, MTX_DEF); break; case ALPHA_INTR_ERROR: /* Machine Check or Correctable Error */ - mtx_enter(&Giant, MTX_DEF); a0 = alpha_pal_rdmces(); if (platform.mcheck_handler) (*platform.mcheck_handler)(a0, framep, a1, a2); else machine_check(a0, framep, a1, a2); - mtx_exit(&Giant, MTX_DEF); break; case ALPHA_INTR_DEVICE: /* I/O device interrupt */ - mtx_enter(&Giant, MTX_DEF); cnt.v_intr++; if (platform.iointr) (*platform.iointr)(framep, a1); - mtx_exit(&Giant, MTX_DEF); break; case ALPHA_INTR_PERF: /* interprocessor interrupt */ - mtx_enter(&Giant, MTX_DEF); perf_irq(a1, framep); - mtx_exit(&Giant, MTX_DEF); break; case ALPHA_INTR_PASSIVE: @@ -157,7 +148,6 @@ interrupt(a0, a1, a2, framep) break; default: - mtx_enter(&Giant, MTX_DEF); panic("unexpected interrupt: type 0x%lx vec 0x%lx a2 0x%lx\n", a0, a1, a2); /* NOTREACHED */ @@ -638,6 +628,7 @@ ithd_loop(void *dummy) * lock. This may take a while and it_need may get * set again, so we have to check it again. */ + mtx_assert(&Giant, MA_NOTOWNED); mtx_enter(&sched_lock, MTX_SPIN); if (!ithd->it_need) { ithd->it_proc->p_stat = SWAIT; /* we're idle */