From 28a4eb563aa5bbb18868436898ca46df873b6b2c Mon Sep 17 00:00:00 2001 From: thorpej Date: Sat, 26 Jan 2019 14:38:29 +0000 Subject: 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. --- sys/dev/fdt/fdtvar.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sys/dev') 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 @@ -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 *); -- cgit