summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2019-01-26 14:38:29 +0000
committerthorpej <thorpej@NetBSD.org>2019-01-26 14:38:29 +0000
commit28a4eb563aa5bbb18868436898ca46df873b6b2c (patch)
treeb0c8a6a8f37c5fec81c1419dd9e51ca433819582 /sys/dev
parentb3493680a2df58c6d31273379697a43968745800 (diff)
Define constants for representing the standard interrupt types
({pos,neg,double}-edge, {high,low}-level) from the FDT "interrupts" bindings. Use these defined constants rather than magic numbers.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/fdt/fdtvar.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/fdt/fdtvar.h b/sys/dev/fdt/fdtvar.h
index 14219477db7..d5210e3d5c0 100644
--- a/sys/dev/fdt/fdtvar.h
+++ b/sys/dev/fdt/fdtvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtvar.h,v 1.46 2019/01/23 04:21:55 thorpej Exp $ */
+/* $NetBSD: fdtvar.h,v 1.47 2019/01/26 14:38:30 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@@ -63,6 +63,14 @@ struct fdt_attach_args {
/* flags for fdtbus_intr_establish */
#define FDT_INTR_MPSAFE __BIT(0)
+/* Interrupt trigger types defined by the FDT "interrupts" bindings. */
+#define FDT_INTR_TYPE_POS_EDGE __BIT(0)
+#define FDT_INTR_TYPE_NEG_EDGE __BIT(1)
+#define FDT_INTR_TYPE_DOUBLE_EDGE (FDT_INTR_TYPE_POS_EDGE | \
+ FDT_INTR_TYPE_NEG_EDGE)
+#define FDT_INTR_TYPE_HIGH_LEVEL __BIT(2)
+#define FDT_INTR_TYPE_LOW_LEVEL __BIT(3)
+
struct fdtbus_interrupt_controller_func {
void * (*establish)(device_t, u_int *, int, int,
int (*)(void *), void *);