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 Install a default irq handler that panics w...
details: https://anonhg.NetBSD.org/src/rev/00112050f41c
branches: trunk
changeset: 1018996:00112050f41c
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Tue Feb 23 11:31:52 2021 +0000
description:
Install a default irq handler that panics when no interrupt controller
driver is installed.
diffstat:
sys/arch/arm/fdt/arm_fdt.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diffs (54 lines):
diff -r 1a16a10e99b5 -r 00112050f41c sys/arch/arm/fdt/arm_fdt.c
--- a/sys/arch/arm/fdt/arm_fdt.c Tue Feb 23 10:03:04 2021 +0000
+++ b/sys/arch/arm/fdt/arm_fdt.c Tue Feb 23 11:31:52 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arm_fdt.c,v 1.14 2021/01/27 03:10:19 thorpej Exp $ */
+/* $NetBSD: arm_fdt.c,v 1.15 2021/02/23 11:31:52 jmcneill Exp $ */
/*-
* Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
#include "opt_modular.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arm_fdt.c,v 1.14 2021/01/27 03:10:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm_fdt.c,v 1.15 2021/02/23 11:31:52 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -56,6 +56,8 @@
static int arm_fdt_match(device_t, cfdata_t, void *);
static void arm_fdt_attach(device_t, device_t, void *);
+static void arm_fdt_irq_default_handler(void *);
+
#ifdef EFI_RUNTIME
static void arm_fdt_efi_init(device_t);
static int arm_fdt_efi_rtc_gettime(todr_chip_handle_t, struct clock_ymdhms *);
@@ -76,7 +78,7 @@
static TAILQ_HEAD(, arm_fdt_cpu_hatch_cb) arm_fdt_cpu_hatch_cbs =
TAILQ_HEAD_INITIALIZER(arm_fdt_cpu_hatch_cbs);
-static void (*_arm_fdt_irq_handler)(void *) = NULL;
+static void (*_arm_fdt_irq_handler)(void *) = arm_fdt_irq_default_handler;
static void (*_arm_fdt_timer_init)(void) = NULL;
int
@@ -169,10 +171,16 @@
c->cb(c->priv, ci);
}
+static void
+arm_fdt_irq_default_handler(void *frame)
+{
+ panic("missing interrupt controller driver");
+}
+
void
arm_fdt_irq_set_handler(void (*irq_handler)(void *))
{
- KASSERT(_arm_fdt_irq_handler == NULL);
+ KASSERT(_arm_fdt_irq_handler == arm_fdt_irq_default_handler);
_arm_fdt_irq_handler = irq_handler;
}
Home |
Main Index |
Thread Index |
Old Index