-/* $OpenBSD: fdt.h,v 1.8 2018/08/06 10:52:30 patrick Exp $ */
+/* $OpenBSD: fdt.h,v 1.9 2018/08/08 11:06:33 patrick Exp $ */
/*
* Copyright (c) 2016 Patrick Wildt <patrick@blueri.se>
*
void *fdt_find_cons(const char *);
+#define fdt_intr_enable arm_intr_enable
#define fdt_intr_establish arm_intr_establish_fdt
#define fdt_intr_establish_idx arm_intr_establish_fdt_idx
#define fdt_intr_establish_imap arm_intr_establish_fdt_imap
#define fdt_intr_establish_msi arm_intr_establish_fdt_msi
+#define fdt_intr_disable arm_intr_disable
#define fdt_intr_disestablish arm_intr_disestablish_fdt
#define fdt_intr_get_parent arm_intr_get_parent
#define fdt_intr_parent_establish arm_intr_parent_establish_fdt
-/* $OpenBSD: intr.c,v 1.12 2018/07/30 10:56:00 kettenis Exp $ */
+/* $OpenBSD: intr.c,v 1.13 2018/08/08 11:06:33 patrick Exp $ */
/*
* Copyright (c) 2011 Dale Rahn <drahn@openbsd.org>
*
free(ih, M_DEVBUF, sizeof(*ih));
}
+void
+arm_intr_enable(void *cookie)
+{
+ struct arm_intr_handle *ih = cookie;
+ struct interrupt_controller *ic = ih->ih_ic;
+
+ KASSERT(ic->ic_enable != NULL);
+ ic->ic_enable(ih->ih_ih);
+}
+
+void
+arm_intr_disable(void *cookie)
+{
+ struct arm_intr_handle *ih = cookie;
+ struct interrupt_controller *ic = ih->ih_ic;
+
+ KASSERT(ic->ic_disable != NULL);
+ ic->ic_disable(ih->ih_ih);
+}
+
/*
* Some interrupt controllers transparently forward interrupts to
* their parent. Such interrupt controllers can use this function to
-/* $OpenBSD: fdt.h,v 1.5 2018/08/06 10:52:30 patrick Exp $ */
+/* $OpenBSD: fdt.h,v 1.6 2018/08/08 11:06:33 patrick Exp $ */
/*
* Copyright (c) 2016 Patrick Wildt <patrick@blueri.se>
*
void *fdt_find_cons(const char *);
+#define fdt_intr_enable arm_intr_enable
#define fdt_intr_establish arm_intr_establish_fdt
#define fdt_intr_establish_idx arm_intr_establish_fdt_idx
#define fdt_intr_establish_imap arm_intr_establish_fdt_imap
#define fdt_intr_establish_msi arm_intr_establish_fdt_msi
+#define fdt_intr_disable arm_intr_disable
#define fdt_intr_disestablish arm_intr_disestablish_fdt
#define fdt_intr_get_parent arm_intr_get_parent
#define fdt_intr_parent_establish arm_intr_parent_establish_fdt
-/* $OpenBSD: intr.h,v 1.10 2018/04/09 18:35:13 kettenis Exp $ */
+/* $OpenBSD: intr.h,v 1.11 2018/08/08 11:06:33 patrick Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
void *(*ic_establish_msi)(void *, uint64_t *, uint64_t *, int,
int (*)(void *), void *, char *);
void (*ic_disestablish)(void *);
+ void (*ic_enable)(void *);
+ void (*ic_disable)(void *);
void (*ic_route)(void *, int, struct cpu_info *);
void (*ic_cpu_enable)(void);
void *arm_intr_establish_fdt_msi(int, uint64_t *, uint64_t *, int ,
int (*)(void *), void *, char *);
void arm_intr_disestablish_fdt(void *);
+void arm_intr_enable(void *);
+void arm_intr_disable(void *);
void arm_intr_route(void *, int, struct cpu_info *);
void arm_intr_cpu_enable(void);
void *arm_intr_parent_establish_fdt(void *, int *, int,
-/* $OpenBSD: intr.c,v 1.13 2018/07/06 13:08:10 patrick Exp $ */
+/* $OpenBSD: intr.c,v 1.14 2018/08/08 11:06:33 patrick Exp $ */
/*
* Copyright (c) 2011 Dale Rahn <drahn@openbsd.org>
*
free(ih, M_DEVBUF, sizeof(*ih));
}
+void
+arm_intr_enable(void *cookie)
+{
+ struct arm_intr_handle *ih = cookie;
+ struct interrupt_controller *ic = ih->ih_ic;
+
+ KASSERT(ic->ic_enable != NULL);
+ ic->ic_enable(ih->ih_ih);
+}
+
+void
+arm_intr_disable(void *cookie)
+{
+ struct arm_intr_handle *ih = cookie;
+ struct interrupt_controller *ic = ih->ih_ic;
+
+ KASSERT(ic->ic_disable != NULL);
+ ic->ic_disable(ih->ih_ih);
+}
+
/*
* Some interrupt controllers transparently forward interrupts to
* their parent. Such interrupt controllers can use this function to
-/* $OpenBSD: intr.h,v 1.8 2018/07/06 13:08:10 patrick Exp $ */
+/* $OpenBSD: intr.h,v 1.9 2018/08/08 11:06:33 patrick Exp $ */
/* $NetBSD: intr.h,v 1.12 2003/06/16 20:00:59 thorpej Exp $ */
/*
void *(*ic_establish_msi)(void *, uint64_t *, uint64_t *, int,
int (*)(void *), void *, char *);
void (*ic_disestablish)(void *);
+ void (*ic_enable)(void *);
+ void (*ic_disable)(void *);
void (*ic_route)(void *, int, struct cpu_info *);
LIST_ENTRY(interrupt_controller) ic_list;
void *arm_intr_establish_fdt_msi(int, uint64_t *, uint64_t *, int ,
int (*)(void *), void *, char *);
void arm_intr_disestablish_fdt(void *);
+void arm_intr_enable(void *);
+void arm_intr_disable(void *);
void arm_intr_route(void *, int, struct cpu_info *);
void *arm_intr_parent_establish_fdt(void *, int *, int,