summaryrefslogtreecommitdiffstats
path: root/sys/dev/fdt/mvicu.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/fdt/mvicu.c')
-rw-r--r--sys/dev/fdt/mvicu.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/dev/fdt/mvicu.c b/sys/dev/fdt/mvicu.c
index 0659c81a158..805aac01c82 100644
--- a/sys/dev/fdt/mvicu.c
+++ b/sys/dev/fdt/mvicu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mvicu.c,v 1.5 2020/07/14 15:34:15 patrick Exp $ */
+/* $OpenBSD: mvicu.c,v 1.6 2020/07/17 08:07:34 patrick Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
*
@@ -96,6 +96,7 @@ void mvicu_register(struct mvicu_softc *, int, int);
void *mvicu_intr_establish(void *, int *, int, struct cpu_info *,
int (*)(void *), void *, char *);
void mvicu_intr_disestablish(void *);
+void mvicu_intr_barrier(void *);
int
mvicu_match(struct device *parent, void *match, void *aux)
@@ -171,6 +172,7 @@ mvicu_register(struct mvicu_softc *sc, int node, int idx)
sn->sn_ic.ic_cookie = sn;
sn->sn_ic.ic_establish = mvicu_intr_establish;
sn->sn_ic.ic_disestablish = mvicu_intr_disestablish;
+ sn->sn_ic.ic_barrier = mvicu_intr_barrier;
while (node && !phandle) {
phandle = OF_getpropint(node, "msi-parent", 0);
@@ -198,6 +200,7 @@ mvicu_intr_establish(void *cookie, int *cell, int level,
struct mvicu_subnode *sn = cookie;
struct mvicu_softc *sc = sn->sn_sc;
struct interrupt_controller *ic = sn->sn_parent_ic;
+ struct arm_intr_handle *ih;
uint32_t idx, flags;
uint64_t addr, data;
int edge = 0;
@@ -258,7 +261,11 @@ mvicu_intr_establish(void *cookie, int *cell, int level,
(edge ? ICU_INT_EDGE : 0));
}
- return cookie;
+ ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
+ ih->ih_ic = ic;
+ ih->ih_ih = cookie;
+
+ return ih;
}
void
@@ -266,3 +273,12 @@ mvicu_intr_disestablish(void *cookie)
{
panic("%s", __func__);
}
+
+void
+mvicu_intr_barrier(void *cookie)
+{
+ struct arm_intr_handle *ih = cookie;
+ struct interrupt_controller *ic = ih->ih_ic;
+
+ ic->ic_barrier(ih->ih_ih);
+}