summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-02-03 03:26:39 +0000
committerpeter <peter@FreeBSD.org>2001-02-03 03:26:39 +0000
commit73c13f25927dd338ada35906c9cf2229e94214d6 (patch)
tree66363e30a6d2eec14a426b2ba0b71428e80af006 /sys
parenta18e9522d7f81130773dc35f9eba627411355301 (diff)
downloadFreeBSD-src-73c13f25927dd338ada35906c9cf2229e94214d6.zip
FreeBSD-src-73c13f25927dd338ada35906c9cf2229e94214d6.tar.gz
Conditionalize the alpha interrupt preemption for now to buy us some
time to sort out the quirks. Add 'options PREEMPTION' to test it on the Alpha. Reviewed by: jhb
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/alpha/interrupt.c27
-rw-r--r--sys/conf/options.alpha1
2 files changed, 28 insertions, 0 deletions
diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c
index 852358b..3df42e9 100644
--- a/sys/alpha/alpha/interrupt.c
+++ b/sys/alpha/alpha/interrupt.c
@@ -34,6 +34,7 @@
*/
#include "opt_ddb.h"
+#include "opt_preemption.h"
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
@@ -553,6 +554,8 @@ alpha_dispatch_intr(void *frame, unsigned long vector)
* is higher priority than their current thread, it gets run now.
*/
ithd->it_need = 1;
+#ifdef PREEMPTION
+ /* Does not work on 4100 and PC164 */
if (i->disable) {
CTR1(KTR_INTR,
"alpha_dispatch_intr: disabling vector 0x%x", i->vector);
@@ -579,6 +582,30 @@ alpha_dispatch_intr(void *frame, unsigned long vector)
need_resched();
}
mtx_exit(&sched_lock, MTX_SPIN);
+#else
+ mtx_enter(&sched_lock, MTX_SPIN);
+ if (ithd->it_proc->p_stat == SWAIT) {
+ /* not on the run queue and not running */
+ CTR1(KTR_INTR, "alpha_dispatch_intr: setrunqueue %d",
+ ithd->it_proc->p_pid);
+
+ alpha_mb(); /* XXX - ??? */
+ ithd->it_proc->p_stat = SRUN;
+ setrunqueue(ithd->it_proc);
+ aston();
+ } else {
+ CTR3(KTR_INTR, "alpha_dispatch_intr: %d: it_need %d, state %d",
+ ithd->it_proc->p_pid, ithd->it_need, ithd->it_proc->p_stat);
+ }
+ if (i->disable) {
+ CTR1(KTR_INTR,
+ "alpha_dispatch_intr: disabling vector 0x%x", i->vector);
+ i->disable(i->vector);
+ }
+ mtx_exit(&sched_lock, MTX_SPIN);
+
+ need_resched();
+#endif
}
void
diff --git a/sys/conf/options.alpha b/sys/conf/options.alpha
index 41d733c..9456c7b 100644
--- a/sys/conf/options.alpha
+++ b/sys/conf/options.alpha
@@ -20,6 +20,7 @@ API_UP1000 opt_cpu.h
PPC_PROBE_CHIPSET opt_ppc.h
PPC_DEBUG opt_ppc.h
+PREEMPTION
SHOW_BUSYBUFS
PANIC_REBOOT_WAIT_TIME opt_panic.h
OpenPOWER on IntegriCloud