Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/fdt more completely gic_fdt_disestablish() such...
details: https://anonhg.NetBSD.org/src/rev/c7f2b8f75354
branches: trunk
changeset: 323278:c7f2b8f75354
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Wed Jun 06 19:49:51 2018 +0000
description:
more completely gic_fdt_disestablish() such that it's possible to
re-establish later
diffstat:
sys/arch/arm/fdt/gic_fdt.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diffs (53 lines):
diff -r 21db9eb4c40f -r c7f2b8f75354 sys/arch/arm/fdt/gic_fdt.c
--- a/sys/arch/arm/fdt/gic_fdt.c Wed Jun 06 18:10:35 2018 +0000
+++ b/sys/arch/arm/fdt/gic_fdt.c Wed Jun 06 19:49:51 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gic_fdt.c,v 1.8 2017/11/30 14:42:37 skrll Exp $ */
+/* $NetBSD: gic_fdt.c,v 1.9 2018/06/06 19:49:51 jakllsch Exp $ */
/*-
* Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.8 2017/11/30 14:42:37 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.9 2018/06/06 19:49:51 jakllsch Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -80,6 +80,7 @@
int intr_level;
int intr_mpsafe;
TAILQ_HEAD(, gic_fdt_irqhandler) intr_handlers;
+ int intr_irq;
};
struct gic_fdt_softc {
@@ -190,6 +191,7 @@
firq->intr_level = level;
firq->intr_mpsafe = mpsafe;
TAILQ_INIT(&firq->intr_handlers);
+ firq->intr_irq = irq;
if (arg == NULL) {
firq->intr_ih = intr_establish(irq, ipl, level | mpsafe,
func, NULL);
@@ -239,8 +241,10 @@
static void
gic_fdt_disestablish(device_t dev, void *ih)
{
+ struct gic_fdt_softc * const sc = device_private(dev);
struct gic_fdt_irqhandler *firqh = ih;
struct gic_fdt_irq *firq = firqh->ih_irq;
+ const int irq = firq->intr_irq;
KASSERT(firq->intr_refcnt > 0);
@@ -251,6 +255,7 @@
if (firq->intr_refcnt == 0) {
intr_disestablish(firq->intr_ih);
kmem_free(firq, sizeof(*firq));
+ sc->sc_irq[irq] = NULL;
}
}
Home |
Main Index |
Thread Index |
Old Index