summaryrefslogtreecommitdiffstats
path: root/bsd_eth_drivers/libbsdport/bus.h
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2009-02-20 19:48:28 +0000
committerTill Straumann <strauman@slac.stanford.edu>2009-02-20 19:48:28 +0000
commite9cc6be5ae53e91e1efa2f7c51da80941ec0e70e (patch)
treee88f3eb8bd1daa71e7c8a5c35ceea7672cc227cb /bsd_eth_drivers/libbsdport/bus.h
parent - compute hashes for multicast filtering (UNTESTED) (diff)
downloadlibbsdport-e9cc6be5ae53e91e1efa2f7c51da80941ec0e70e.tar.bz2
- detect use of INTR_FAST and produce a compile-time error with a
hint what the porter has to do.
Diffstat (limited to 'bsd_eth_drivers/libbsdport/bus.h')
-rw-r--r--bsd_eth_drivers/libbsdport/bus.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/bsd_eth_drivers/libbsdport/bus.h b/bsd_eth_drivers/libbsdport/bus.h
index 76d78a8..c971b21 100644
--- a/bsd_eth_drivers/libbsdport/bus.h
+++ b/bsd_eth_drivers/libbsdport/bus.h
@@ -156,10 +156,29 @@ bus_setup_intr(device_t dev, struct resource *r, int flags, driver_filter_t filt
/* Flags currently ignored... */
#define INTR_MPSAFE 0
#define INTR_TYPE_NET 0
-/* INTR_FAST indicates that a 'handler' is actually
- * a 'fast' handler which already uses taskqueues
+
+/*
+ * INTR_FAST handlers are already more like 'filters',
+ * i.e., they disable interrupts and schedule work
+ * on a task queue.
+ *
+ * During porting the fast handler has to be slightly
+ * rewritten (must return an int value, FILTER_HANDLED
+ * if a valid IRQ was detected and work has been scheduled
+ * and FILTER_STRAY if this device didn't interrupt).
+ *
+ * You need to then remove INTR_FAST from the flags,
+ * pass the converted handler as the 'filter' argument
+ * and a NULL handler argument to bus_setup_intr().
+ *
*/
-#define INTR_FAST 1
+extern int __INTR_FAST() __attribute__((
+ error("\n\n==> you need to convert bus_setup_intr(INTR_FAST) to new API;\n"
+ " consult <sys/bus.h>\n\n")
+));
+
+/* Barf at compile time if they try to use INTR_FAST */
+#define INTR_FAST (__INTR_FAST())
int
bus_teardown_intr(device_t dev, struct resource *r, void *cookiep);