summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-12-16 20:07:14 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-12-16 20:07:14 +0000
commit6f8d9e0a09f0cdc616315b01c007f3bbe0562922 (patch)
tree7d610d7bc5109e291b704a6b8b14aeb183998adf /sys/dev
parentb8f8aae75ebe583cfa182d98fd47852c16aa56a9 (diff)
Make hil(4) shared interrupts aware, by exiting early if the stat register
does not indicate data being available; for some reason on hppa hil_intr() gets invoked when serial ports interrupt.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/hil/hil.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/hil/hil.c b/sys/dev/hil/hil.c
index 16edb15dd05..8888fe226e2 100644
--- a/sys/dev/hil/hil.c
+++ b/sys/dev/hil/hil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hil.c,v 1.22 2006/11/05 14:39:32 miod Exp $ */
+/* $OpenBSD: hil.c,v 1.23 2006/12/16 20:07:13 miod Exp $ */
/*
* Copyright (c) 2003, 2004, Miodrag Vallat.
* All rights reserved.
@@ -284,9 +284,18 @@ hil_intr(void *v)
return (0);
stat = bus_space_read_1(sc->sc_bst, sc->sc_bsh, HILP_STAT);
+
+ /*
+ * This should never happen if the interrupt comes from the
+ * loop.
+ */
+ if ((stat & HIL_DATA_RDY) == 0)
+ return (0); /* not for us */
+
c = bus_space_read_1(sc->sc_bst, sc->sc_bsh,
HILP_DATA); /* clears interrupt */
DELAY(1);
+
hil_process_int(sc, stat, c);
if (sc->sc_status != HIL_STATUS_BUSY)